09-28-2012, 07:43 PM | #1 |
Addict
Posts: 254
Karma: 69786
Join Date: May 2006
Location: Oslo, Norway
Device: Kobo Aura, Sony PRS-650
|
Problems building Sigil on Win7/64
Hi! I'd like to build Sigil from source on Win7/64, both to get a sneak preview of features, and to maybe aid minorily in development (although the following question might suggest that I'm a noob coder, I have been known to contribute usefully to other C++ projects in the past, using Linux).
I don't want the devs to waste their time with me, but I ask others who have successfully compiled it whether they could share their notes about the steps necessary to do so. I don't use VS, and thus tried the alternate method with the windows SDK. I'm not well versed with building under Windows, but have successfully compiled lots of things from source under Linux. It just seems a lot easier So what I would like to see is a step-by-step description of how to get from a fresh install of win7 to being able to compile Sigil (without VS, as I don't have a licence and wouldn't want to be dependent on it in the future). From there I could likely figure where I'm stuck, and what I need to do. If anyone has made notes, I'd appreciate seeing them. I installed all the dependencies mentioned in the readme, which was an adventure in itself (turns out that you have to uninstall the C++ 2010 runtimes, otherwise the Windows SDK install will error out with a nonsensical error message referring to a non-existant local html file. Makes perfect sense). I currently gave up with a (probably simple) "Could NOT find Qt4 (missing: <a lot of stuff>) error from cmake, including QT_QMAKE_EXECUTABLE. I find qmake.exe 14 times in the QT tree, and none of the seem to work when referencing them (Windows additionally gave me a "path environment variable too long" error on some of them. As we all know, computers easily get bored when they have to read long text strings. They are not good at handling large amounts of data accurately, especially when the amount of data is immense, to the tune of about 2300 characters). Ok, enough with the snide remarks. Could anyone post their notes about this? Last edited by Man Eating Duck; 09-28-2012 at 07:47 PM. |
09-28-2012, 07:52 PM | #2 |
Grand Sorcerer
Posts: 12,155
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
I wonder if the VS Express would suffice for calibre building?
|
Advert | |
|
09-28-2012, 08:08 PM | #3 |
Evangelist
Posts: 416
Karma: 1045911
Join Date: Sep 2011
Location: Cape Town, South Africa
Device: Kindle 3
|
You could likely get away with using CodeBlocks, QtCreator, CodeLite? or Eclipse - all will require a bit of playing around.
At the moment it sounds like you're trying to use the cli interface for CMake, try using the cmake gui - it makes life a lot easier. |
09-28-2012, 09:10 PM | #4 | |
Addict
Posts: 254
Karma: 69786
Join Date: May 2006
Location: Oslo, Norway
Device: Kobo Aura, Sony PRS-650
|
Quote:
I also tried cmake-gui, it complained that cmake.exe (not qmake.exe, no spelling mistake) was not found, I'm pretty sure I have it as I installed them together (and cmake runs from cmd without a path appended). Shit happens. I'm currently installing VS Express 2012 as per PeterT's suggestion. I'm probably missing something stupid, but I'll probably also come back to you for further advice |
|
09-28-2012, 09:18 PM | #5 |
Evangelist
Posts: 416
Karma: 1045911
Join Date: Sep 2011
Location: Cape Town, South Africa
Device: Kindle 3
|
It works fine when everything is correctly detected, but if you need to do manual configuration it's pretty tricky to get a quick overview of things. The gui also somewhat guides you through problems.
It sounds like you used the zip, rather than the installer to 'install' cmake, if so it can get quite annoying in regards to not finding the cmake detection rules and stuff, since it will work, but tries to look for stuff in PATH, rather than the local directory... it seems anyway. Just remember that if you've manually moved libs and sdk's around, cmake will not be able to guess that, you may have to tell it where your new location is (as it does find some stuff from registry keys). Not sure about VS Express, but since there's no MFC or anything like that, it may work. |
Advert | |
|
09-28-2012, 09:20 PM | #6 |
Calibre Plugins Developer
Posts: 4,636
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
@Man Eating Duck - did you remember to put the Qt bin folder into your path, *before* running the cmake command line?
|
09-28-2012, 10:09 PM | #7 |
Addict
Posts: 254
Karma: 69786
Join Date: May 2006
Location: Oslo, Norway
Device: Kobo Aura, Sony PRS-650
|
You shouldn't waste your time on me
I made a stupid mistake, I added paths to my user account, while the SDK cmd runs as administrator. I added "D:\QtSDK\mingw\bin" to the system path, and I still get an error while running "cmake ." [Should I run that with no target? Does that question even make sense? ] after adding the path to the System path, however, it's probably another mistake of mine. The file C:\Users\andlia\AppData\Local\Temp\nmE9D.tmp did not exist when I tried to retrieve it. I'm on thin ice in Windows, I'm sorry... Code:
D:\prog\sigil>cmake . -- Building for: NMake Makefiles -- The C compiler identification is MSVC 16.0.30319.1 -- The CXX compiler identification is MSVC 16.0.30319.1 -- Check for CL compiler version -- Check for CL compiler version - 1600 -- Check if this is a free VC compiler -- Check if this is a free VC compiler - no -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/amd64/cl.exe -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/amd64/cl.exe -- broken CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE): The C compiler "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/amd64/cl.exe" is not able to compile a simple test program. It fails with the following output: Change Dir: D:/prog/sigil/CMakeFiles/CMakeTmp Run Build Command:nmake /NOLOGO "cmTryCompileExec2829198104\fast" "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\amd64\nmake.exe" -f CMakeFiles\cmTryCompileExec2829198104.dir\build.make /nologo -L CMakeFiles\cmTryCompileExec2829198104.dir\build "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report D:\prog\sigil\CMakeFiles\CMakeTmp\CMakeFiles 1 Building C object CMakeFiles/cmTryCompileExec2829198104.dir/testCCompiler.c.obj C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe @C:\Users\andlia\AppData\Local\Temp\nmD63.tmp testCCompiler.c Linking C executable cmTryCompileExec2829198104.exe "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E vs_link_exe C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe /nologo @CMakeFiles\cmTryCompileExec2829198104.dir\objects1.rsp @C:\Users\andlia\AppData\Local\Temp\nmE9D.tmp LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt LINK Pass 1 failed. with 2 NMAKE : fatal error U1077: '"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe"' : return code '0xffffffff' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\amd64\nmake.exe"' : return code '0x2' Stop. CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:12 (project) -- Configuring incomplete, errors occurred! D:\prog\sigil> |
09-28-2012, 10:26 PM | #8 | |
Addict
Posts: 254
Karma: 69786
Join Date: May 2006
Location: Oslo, Norway
Device: Kobo Aura, Sony PRS-650
|
Quote:
I installed everything from downloaded install files, no manual trickery at all except for custom location (but I don't believe that being installed on d: instead of c: will matter). I get a lot more, and uglier, error messages from the cmake-gui than from cli, I strongly suspect that the problem is that I miss something obvious. Hence the request for notes from someone who did manage to set it all up. The path problem was my mistake, I set the path for my user, while the SDK cmd runs as admin. On a side note I'm comfortable with the cli, even on Windows, I have a full range of relatively POSIX-compliant cli utilities installed on my Win7 computer at work (and my Win7 partition at home). Highly recommended if you're used to Linux/Unix/BSD Last edited by Man Eating Duck; 09-28-2012 at 10:32 PM. |
|
09-29-2012, 06:06 AM | #9 |
Calibre Plugins Developer
Posts: 4,636
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
@Man Eating Duck - I use VS 2010 to develop, so I can't give you a completely 100% list for what you need to do without that installed.
However I did a few days ago setup a cmake/nmake directory for building outside of VS to test something, so I can tell you what I did for that... (Windows builds only). If John or anyone else spots any obvious errors, tell me and I will correct the post. Preparation work: Spoiler:
To create an nmake based debug build: Spoiler:
To create an nmake based release build / 32-bit MSI installer: Spoiler:
To create a VS 2010 based build: Spoiler:
There are more complications if you want to build the 64-bit build/installer - not something I have done as yet. The instructions John gave me a long time ago are included below for completeness: Spoiler:
Last edited by kiwidude; 09-29-2012 at 06:28 AM. |
09-29-2012, 07:38 AM | #10 |
Grand Sorcerer
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Your instructions for cmake/nmake seem spot-on to me. That's how I did it on Windows. I've never done much building on the Windows platform before, but it seemed fairly painless.
|
09-29-2012, 11:38 AM | #11 |
Calibre Plugins Developer
Posts: 4,636
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
@DiapDealer - thanks very much for confirming that. What I know about cmake/nmake wouldn't fill a paragraph.
I will add this as a warning to anyone out there doing Visual Studio 2010 builds of Sigil and then using them. As brilliant as it is for debugging Sigil, there are a number of issues I have found with the executables it produces. These result in very undesired behaviour in Sigil and can have you panicking about bugs in the code that don't exist when you do an nmake build. Here are just two examples I have seen:
My guess is that the fault lies in the cmake configuration somewhere - some flags are not being set for the Visual Studio configuration that are in the nmake one. So if there are any cmake gurus out there who also have Visual Studio and want to nut this one out I would be extremely grateful... |
10-03-2012, 02:51 PM | #12 |
Addict
Posts: 254
Karma: 69786
Join Date: May 2006
Location: Oslo, Norway
Device: Kobo Aura, Sony PRS-650
|
I am finally able to build head, these instructions are invaluable
Thanks a lot, kiwidude! A few points if anyone else has problems (these are probably newbie mistakes), no need to read the rest if you're OK. It's been a long-ish process, mainly reinstalling the SDK and NET 4 components. Before installing the SDK, uninstall any C++ 2010 redistributables. If not you'll get bizarre problems. The vast majority of my time went to reinstalling the SDK and/or NET 4. The installers seems to muck up each others installs at times. For me this resulted in "cl is not able to compile a simple program", LNKXXXX errors or a host of other problems (for which the suggested solution from Googling invariably was "reinstall something"). Uninstalling via the normal interface frequently just froze. I used uninstall tools for VS 2010 and the SDK instead. I have really no idea why it worked in the end, so I can't provide good instructions. After getting "a simple program" to compile I got a lot of errors about x64/x86 mixups when linking. Again, I tried a lot of tips from Google which got me a small bit further, not too sure what clinched it. But I do know that having the VC/bin/amd64/cl.exe in your path might make the SDK use that instead of the x86 one, giving problems to the linker. Remove the path entry if it's there. I also had to add -D "CMAKE_EXE_LINKER_FLAGS=/STACK:10000000 /machine:x86" to the cmake command line, again that's probably because I mucked something up. After correcting arch stuff, nmake clean seems necessary. This post didn't turn out to be very useful after all... but it reflects my confusion after this process |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Building Sigil under Linux | st_albert | Sigil | 1 | 08-07-2011 03:19 PM |
USB connection problems in Win7 x64 | taosaur | Nook Color & Nook Tablet | 6 | 05-17-2011 12:10 AM |
Installing Calibre- Problems on Win7 | natgovender | Devices | 9 | 03-24-2011 09:43 AM |
Having problems building calibre 0.15.4 | angevin | Calibre | 11 | 06-12-2009 07:54 PM |