Building on Windows

From BibleTime
Jump to: navigation, search

Contents

Prebuilt packages

For users who do not wish to follow the build instructions, some pre-built binaries are available. Go to http://sourcearchives.com/downloads

You will see files that look like this: bibletime-2.3.+svnr1684-win32.exe

The svn revision number of the build is the set of 4 numbers shown in bold above. You will probably want to choose the latest revision number to download.

You don't have to set the SWORD_PATH environment variable. BibleTime uses the same locations for packages that Xiphos and BibleDesktop do.

How to build

Visual Studio 2008

What follows is how the system can be built on Windows using the commercial version of Visual Studio 2008. It might also be possible with the Express Edition.

Install VS 2008

  1. Install VS 2008, or download and install VS Express (C++ version)
  2. You may need to add some VS folders to the Path environment variable: C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools; C:\Program Files\Microsoft Visual Studio 9.0\VC\bin (with VS Express 2008). Otherwise the next steps may not work. (Using the following command of launching the cmd.exe instance from the Start Menu option under Visual Studio should take care of this problem Greg.hellings)(I think it was on the contrary with VSExpress: the command line didn't work until the path was set. --Eeli)
  3. Launch the VS 2008 Command Line from your Start Menu -> Visual Studio 2008 -> Visual Studio Tools -> Visual Studio 2008 Command Line
  4. You may need to run the command "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat" (adjusted to your VC++ version/location) in order to set environment variables. In VS Express the command line window tells it's doing this when it's opened. If it doesn't find a command, set the Path (see above).

Install Microsoft Redistributable Library (optional, for installer)

If you installed either Visual C++ 2008 Express or Visual C++ 2008 Express with SP1 you will need to download the Visual C++ 2008 Redistributable Package if you want to be able to build an installable version of BibleTime.

DON'T LOAD the Visual C++ 2008 SP1 Redistributable Package. For more information read this. and this

Microsoft Visual C++ 2008 Redistributable Package (x86)

Create these directories C:\Bt\msvcrt and put file there (C:\Bt\msvcrt\vcredist_x86.exe)

Install NSIS (optional, for installer)

If you want to be able to build an installable version of BibleTime, install NSIS.

Download NSIS

Install CMake

CMake (available from http://www.cmake.org) is a build tool used by both BibleTime and some of the libraries below.

Install Qt library

Update 2009-12-04: The VS2008 build of Qt has been released. Today it's not yet listed in the download page but there's a link in http://labs.trolltech.com/blogs/2009/12/01/hot-from-the-oven-qt-creator-13/. It may be possible to install Qt without compiling it.

  1. Download the Qt4 source code. I found it by going to http://www.qtsoftware.com/downloads and selecting the LGPL/Free Downloads tab. I think clicked on Download Qt Libraries 4.5 for Windows and did NOT download the executable. I instead clicked on the .zip file link that was on that page. Direct link for 4.5.1: http://get.qtsoftware.com/qt/source/qt-win-opensource-src-4.5.1.zip. Since there are performance issues, it seems, with 4.5, you might want to consider using 4.4.3 for now.
  2. Unpack the Qt4 source into a directory. The dir name shouldn't contain spaces - nmake failed for me (Eeli) if it had spaces. This is because nmake would require quoting the paths - I (Greg) did all my work directly in D:\Qt\4.4.3 or D:\Qt\4.5.1. Be warned, this means I have many GB of hard drive dedicated to storing multiple built versions of Qt libraries and source.
  3. In the VS command line window, switch to the directory with the unpacked Qt4 source
  4. Run the command "configure" (this might take about a half hour or so).
    * (TODO: find a good set of configure options, e.g. "examples" aren't needed and maybe we can leave out those library modules which we don't use. Greg: This can be accomplished by editing projects.pro and editing line 11 to remove "examples", "demos" and "docs" and then commenting out lines 31, 32, 33, 34, 37 and 38 after configure has completed and before nmake begins.
    * Research the qconfig tool.)
  5. Run the command "nmake" (this will probably take several hours (or several days, with an old laptop with 256MB RAM :) ))
  6. Set an environment variable called QTDIR and set its value equal to the root of your Qt4 folder. This is D:\Qt\4.5.1 if you use my scheme (Greg) or something similar.
  7. Add the Qt4 subdirectory bin\ to your Path

Install other libraries

  1. Download and unpack cURL into C:\Bt (Direct source download: http://curl.haxx.se/download/curl-7.19.5.tar.bz2 -- you can use 7-zip or WinRAR to unpack the files)
    1. Rename the directory to curl\
    2. Open CMake
      1. Point to the Source Code in C:\Bt\curl
      2. Build the binaries in C:\Bt\curl-build
      3. Click Configure and select Visual Studio 9 2008 project files. Say "Yes" if it asks to create the -build directory.
      4. After the configure finishes, change the CURL_STATICLIB option to "ON."
      5. Click Configure again. If there were no problems, then the Generate button should be un-grayed. Click it.
  2. Setup the SWORD library:
    1. Download SWORD (v.1.6.0 or later) source code from ftp://ftp.crosswire.org/pub/sword/source/ and unpack it into C:\Bt. OR get it with svn, see http://crosswire.org/sword/develop/swordapi/index.jsp.
    2. Rename the directory to C:\Bt\sword\ if needed.
    3. Open Visual Studio and create a new empty project (Visual C++ -> General -> Empty Project) in C:\Bt named Bibletime, and uncheck the "Create directory for solution" box.
    4. Right click on Bibletime in Solution Explorer and remove it
    5. Right click on Solution 'Bibletime' (0 projects) -> Add -> Existing Project and open sword/lib/vcppmake/vc8/libsword.vcproj
    6. Right click on "Solution 'Bibletime' (1 project)" -> Add -> Existing Project
    7. Navigate to the curl-build\lib\libcurl.vcproj and open it
    8. Right click on the libsword project entry in Solution Explorer -> Project Dependencies
    9. Click the box so that libsword depends on libcurl and select OK
    10. Right click on libcurl -> Properties
    11. Under Configuration Properties -> General set the Character Set to Unicode
    12. Under Configuration Properties -> C/C++ -> Command Line add /Zc:wchar_t- to the options. (In VS Express there's Properties -> Configuration Properties -> C/C++ -> Language -> Treat wchar_t as Built-in type which should do the same.)
    13. Under Configuration Properties -> Librarian remove the ..\ from near the end of the Output File line so it reads C:\Bt\curl-build\lib\Debug\libcurl.lib
    14. Select the Release configuration and repeat editing the Character Set and Command Line and the Output File so it reads C:\Bt\curl-build\lib\Release\libcurl.lib
    15. Select OK
    16. Select File -> Save all
    17. Select Build -> Batch Build -> set curllib to build both Release and Debug versions and choose Build
    18. Select the Configuration Manager. Under Active solution Configuration, choose Debug and press "Close."
    19. Right click libsword -> Properties
    20. Under Configuration Properties -> General select Character Set to be Unicode
    21. Configuration Properties -> C/C++ -> Command Line: add /Zc:wchar_t- to the options
    22. Configuration Properties -> Linker -> General. In Additional Library Directories change the entry to ../../../../curl-build/lib/Debug
    23. Under Release configuration change the entry to ../../../../curl-build/lib/Release and make the same changes to Character Set and Command Line.
    24. Select All Configurations from the drop down menus
    25. Go to Configuration Properties -> Linker -> Input, under Additional Dependencies add "libcurl.lib ws2_32.lib winmm.lib wldap32.lib" and select OK when finished
    26. Edit the file swbuf.cpp and add SWDLLEXPORT before the line that declares the nullStr variable.
    27. Build -> Batch Build. This time select Debug and Release versions of libsword to build.
    28. Copy sword\src\utilfuns\win32\dirent.h to sword\include\
    29. Add the directory with the libsword.dll to your path: e.g. C:\Bt\sword\lib\vcppmake\vc8\Debug
  3. Download and unpack clucene-core to C:\Bt (Available from https://sourceforge.net/projects/clucene/)
    1. Rename the directory to clucene-core\
    2. Open CMake and point its source directory to C:\Bt\clucene-core and its binary directory to C:\Bt\clucene-core also. Click "Configure" and choose Visual Studio 9 2008 for the file type it produces. After it is done Configuring, click "Configure" again and select OK to the dialog that pops up. Click Generate on the main CMake window.
    3. Copy the file clucene-core\src\CLucene\clucene-config.h to clucene-core\build\lib\CLucene\clucene-config.h (you need to make this folder)
    4. In VS right click on Solution 'Bibletime' (2 projects) -> Add -> Existing Project and navigate to clucene-core\src\CLucene\clucene-core.vcproj (NOT clucene-core\CLucene.vcproj and NOT clucene-core\win32\CLucene.vcproj) and open it
    5. Right click on clucene-core -> Properties
    6. Under Configuration Properties -> General for the Character Set option choose Use Unicode Character Set then C/C++ -> Command Line add /Zc:wchar_t-
    7. Change configuration to Release and repeat the above step.
    8. Select Build -> Batch Build and choose clucene-core Debug and Release versions, then click Build
  4. Download the Boost library headers. NOTE: The HEAD version of BibleTime no longer requires Boost. Simply unpack them to C:\Bt - don't bother building or installing anything, all you need are headers. (Available from https://sourceforge.net/projects/boost/)
    1. Create an environment variable BOOST_ROOT and set it to the root of the directory where BOOST is installed (C:\Bt\boost_1_39_0 or the like)

Install BibleTime

  1. Pull the latest bibletime sources into C:\Bt into a directory titled bibletime-svn
    1. Open Cmake and tell it the source is in the recently pulled SVN folder
    2. Tell it to build in a parallel folder with -build or something like that
    3. Click Configure and select Visual Studio 9 2008
    4. Tell it to create the build directory, if it asks
    5. When it complains about not finding DBUS, click OK
    6. If you have not installed the files where I suggested, you'll be forced to manually enter in some variables, do so now.
    7. Add an entry CMAKE_BUILD_TYPE with a value of "Release".
    8. Add an entry MSVC_REDIST with a value of "c:\Bt\msvcrt\vcredist_x86.exe".
    9. Change the CMAKE_INSTALL_PREFIX variable to point to a directory under C:\Bt - for example C:\Bt\install
    10. Select the Generate button next to the Configure button when it is available (You probably have to click Configure a second time)
  2. Now go back to VS 2008 and right click on Solution 'Bibletime' (3 projects) -> Add -> Existing Project
    1. Navigate to C:\Bt\bibletime-build\bibletime.vcproj and open it
    2. Right-click bibletime and select Set as StartUp Project
    3. Right click Bibletime and select Project Dependencies, select CLucene and libsword and click OK
    4. Right click Bibletime and click Build
  3. Open Bibletime's INSTALL.vcproj from the current solution, right click and Build
  4. Copy your sword\lib\vcppmake\vc8\Debug\libsword.dll into the location of your install in the same subdirectory where bibletime.exe is located.
  5. If you want to build an installer for BibleTime, open Bibletime's PACKAGE.vcproj from the current solution, right click and Build. Look for the results in C:\Bt\bibletime-build.

MinGW

  1. Download the MSYS installer (the .exe file) and run it.
  2. Download the technology preview version of the .tar.bz2 files for more recent updates to the MSYS packages and install them.
  3. Download and install either the standard MinGW compiler (woefully out of date) or one of the drop-in replacements (e.g. http://www.tdragon.net/recentgcc/)
  4. Then just download and install the libraries that are required -
    1. CLucene,
    2. libicu (Update: actually this is not needed, just compile libsword without icu support)
    3. cURL,
    4. libsword,
    5. cmake (tool, not a library),
    6. boost (only headers are needed, no need to compile)

etc - the same way you would in Linux using the MSYS shell.

Last I checked, CLucene headers caused problems when trying to build with MinGW. That remains an important TODO.

  • TODO: finish figuring out how to compile with MinGW

Other

Creator 1.30beta changelog says: "Support cmake with Microsoft Visual Studio Compiler (only works with cmake 2.8 )". We haven't tested this. Anyways, Qt Creator uses MS Visual Studio compiler, so probably everything said about VS will be true for Creator, too. Creator is just an IDE which can be used if you want to edit and recompile the source code.

We would like to hear if people manage to compile BibleTime with e.g. Intel compiler.

Issues

General/UI

  • Sometimes when BT is opened the main toolbar is shown on top of the menu bar, covering it. Switching it on/off with View menu may help.
  • UI doesn't show all non-ascii characters correctly. E.g. Kechi and Norwegian Bokmal language names in bookshelf views have boxes instead of characters, even though the same characters are shown correctly in some other places, e.g. the Norwegian Norsk module info. --Eelik 13:51, 24 October 2009 (UTC)

Module support

For those who report problems: please indicate where the modules have been obtained, their version and "Minimum Sword version" config field! I didn't find e.g. LiddelScott or FDen_fr from CrossWire repos. Eelik 18:51, 9 March 2009 (UTC)

  • Opening the Institutes caused the program to hang and then go into the "Not Responding" state, but Josephus and other big genbooks opened fine.
    • Institutes module has been broken and apparently still is. Very annoying. Eelik 20:05, 6 March 2009 (UTC)

Fixed

  • Synchronizing Bible/Commentary windows does not work.
    • Should be fixed already by Gary. Eelik 20:05, 6 March 2009 (UTC)
  • On (some?) systems where the .msi is used, images do not display in the executable. So far on the 3 systems it's been tried on, two of them, both XP systems, did not display the icons, while one of them, a Vista system and also my development box, did. More reports from people would be very helpful in tracking down if this is an XP/Vista problem or a packaging problem or what. Update: With the latest alpha build, icons display in Windows XP.
  • Program crashes on first-run when either OK or Apply is clicked
    • Creating .sword/, setting the SWORD_PATH and installing modules helped for me...
    • ...but it crashes again with the same "(BibleTime 1.7.1.cvs) _FATAL_: ASSERT failure in QSettings: "empty key", file io\qsettings.cpp, line 293" if I remove all modules and try to use Config. Eelik 18:26, 9 March 2009 (UTC)
      • Possibly fixed. Must be tested with a Windows build. Eelik 19:51, 11 March 2009 (UTC)
  • Trying to launch Bookshelf Manager causes the program to crash
    • Fixed by Gary Eelik 20:05, 6 March 2009 (UTC)
  • On some systems, as seen above in the screenshot, some fonts do not display, eg the Chinese Bible. That system, though, is an extremely bare-bones, minimal system with just Windows XP Pro 64-bit, SWORD, Firefox, an antivirus and Bibletime. On my Vista dev box, which has more software than I can even count installed, including Office and the like, the Chinese fonts display fine. Strangely to me, it's not a straight ASCII/non-ASCII issue, since Arabic and Hebrew fonts both display fine on both boxes.
    • Not a BT problem. Xiphos installer may has some fonts which are installed. Co-operation or "stealing" would be reasonable.
  • By default the navigation pane/mag window take up half the screen.
    • Also Search dialog has problems with initial layout.
  • Searching FinPR (which includes non-ascii unicode) crashes. Message: "File: f:\dd\vctools\crt_bld\self_x86\crt\src\isctype.c Line: 56 Expression: (unsigned)(c+1)<=256" (BTW, it's very "nice" to have an error message dialog where you can't copy text!) Eelik 18:26, 9 March 2009 (UTC)
  • Indexing the ESV produced a "Debug Assertion Failed!" message and caused the program to crash.
    • This also seem to be fixed, see the FinPR crash.
  • Opening the ZhHanzi lexicon causes the program to crash - strange (so also LiddelScott and FDen_fr). Other lexica work. Perhaps it is because the lexical keys are in non-ASCII? From some fortune of fate, I randomly chose ZhHanzi as one of the modules to install on my local system. I've checked ZhHanzi in BibleCS and it doesn't crash, although it doesn't display text for the keys on the XP box in the key chooser, the entries do display with rendered text on both of my machines and the keys appear properly under Vista.
  • Opening a Vietnamese Genbook available at http://www.biblevietnam.org produced a "Debug Assertion Failed!" message and caused the program to crash.
    • "(BibleTime 1.7.1.cvs) _FATAL_: ASSERT: "mod" in file ..\bibletime-svn\src\backend\filters\bt_osishtml.cpp, line 577" Eelik 18:36, 9 March 2009 (UTC)
    • I can open this under Linux in BT and Xiphos, but it shows nothing, not even keys (TOC). Please confirm that this module works at all. Specify the SWORD library version. Eelik 21:25, 16 March 2009 (UTC)
    • The assert crash may be fixed. Must be tested. Eelik 22:07, 16 March 2009 (UTC)
    • The genbook works with the latest package. However, the Vietnamese-English dictionary from the same site crashes (see the ZhHanzi bug). Eelik 19:30, 7 April 2009 (UTC)
    • All those Vietnamese modules work with 2.4.svn. --Eelik 20:03, 14 October 2009 (UTC)
  • Images in modules do not display.
    • This was a bug in thml filter which created links like "file:C:\..." and "file:/usr/..." which worked on unix but not on Windows. Fixed but needs testing. --Eelik 21:21, 14 October 2009 (UTC)
    • Doesn't work yet, because QtWebKit needs file:///C: instead of file://C:. --Eelik 14:23, 16 October 2009 (UTC)
    • Works with the latest version. --Eelik 13:47, 24 October 2009 (UTC)
  • I just installed the latest package where a Bookshelf Manager crash should be fixed on Vista. It crashes every time I try to open the Bookshelf Manager. Maybe this is caused by nonexistent SWORD directory and SWORD_HOME? Eelik 20:27, 6 March 2009 (UTC)
  • It is necessary to create a manual Environment Variable (User-level, not System-level) called SWORD_HOME that points to where the modules are stored. TODO: test to see if this is the only way Bibletime can locate installed files or if it can also locate ones in its current directory or relative to it, etc.
  • Work is underway to find out how to cope with variable and paths so that all Windows frontends work together. Eelik 14:44, 14 October 2009 (UTC)
Personal tools