Difference between revisions of "Tutorial:Compiling & Installing SWORD on Windows"
(→Compiling cURL) |
(added CLucene build instructions) |
||
Line 9: | Line 9: | ||
# Extract the ZIP to $dir$ | # Extract the ZIP to $dir$ | ||
# Rename the cURL directory to "curl" (with no version number) | # Rename the cURL directory to "curl" (with no version number) | ||
− | # Start a Developer Command Prompt (find this on your Start Menu in the | + | # Start a Developer Command Prompt (find this on your Start Menu in the Visual Studio 2013 | Visual Studio Tools menu) |
# cd to $dir$/curl/winbuild | # cd to $dir$/curl/winbuild | ||
# Execute: nmake /f Makefile.vc mode=static DEBUG=no | # Execute: nmake /f Makefile.vc mode=static DEBUG=no | ||
Line 28: | Line 28: | ||
# Download the latest release of xz prebuilt for Windows from [http://tukaani.org/xz/ tukaani.org]. At writing, the latest version is 5.0.5: [http://tukaani.org/xz/xz-5.0.5-windows.zip] | # Download the latest release of xz prebuilt for Windows from [http://tukaani.org/xz/ tukaani.org]. At writing, the latest version is 5.0.5: [http://tukaani.org/xz/xz-5.0.5-windows.zip] | ||
# Extract the archive to $dir$/xz | # Extract the archive to $dir$/xz | ||
− | # Start a Developer Command Prompt (find this on your Start Menu in the | + | # Start a Developer Command Prompt (find this on your Start Menu in the Visual Studio 2013 | Visual Studio Tools menu) |
# cd to $dir$/xz/bin_i486 | # cd to $dir$/xz/bin_i486 | ||
# Execute: lib /def:../doc/liblzma.def /out:liblzma.lib /machine:x86 | # Execute: lib /def:../doc/liblzma.def /out:liblzma.lib /machine:x86 | ||
+ | |||
+ | === Compiling CLucene === | ||
+ | # Install [http://www.cmake.org/ cmake] | ||
+ | # Download the latest version of [http://www.boost.org/users/download/ boost]. At writing, the latest version is 1.5.5: [http://sourceforge.net/projects/boost/files/boost/1.55.0/] | ||
+ | # Extract the archive to $dir$ | ||
+ | # Rename the boost directory to "boost" | ||
+ | # Download a snapshot of the [http://sourceforge.net/p/clucene/code/ci/master/tree/ CLucene 2_3_2 branch] | ||
+ | # Extract the archive to $dir$ | ||
+ | # Rename the CLucene directory to "clucene" | ||
+ | # Start a regular Command Prompt (cmd.exe) | ||
+ | # cd to $dir$/clucene | ||
+ | # Set Boost environment variables by executing the following (with replacements for $dir$): | ||
+ | :: set BOOST_BUILD_PATH=$dir$\boost\tools\build\v2 | ||
+ | :: set BOOST_PATH=$dir$ | ||
+ | :: set BOOST_ROOT=$dir$\boost | ||
+ | # Execute: mkdir cmakebuild | ||
+ | # Execute: cd cmakebuild | ||
+ | # Execute: cmake -G "Visual Studio 12" .. | ||
+ | # Open $dir$\clucene\cmakebuild\clucene.sln | ||
+ | # Ensure that the Release configuration is selected and build the BUILD_ALL solution | ||
=== Compiling libsword === | === Compiling libsword === | ||
# Download the latest release of [http://www.crosswire.org/ftpmirror/pub/sword/source/sword.tar.gz The SWORD Project] | # Download the latest release of [http://www.crosswire.org/ftpmirror/pub/sword/source/sword.tar.gz The SWORD Project] | ||
# Extract the tarball to $dir$ | # Extract the tarball to $dir$ | ||
− | + | ::If you are building utilities or diatheke, the following steps are not necessary: | |
# Open $dir$\sword-$version$\lib\vcppmake\vc8\libsword.vcproj | # Open $dir$\sword-$version$\lib\vcppmake\vc8\libsword.vcproj | ||
# Build all (Click Build | Batch Build... | Select All | Build) | # Build all (Click Build | Batch Build... | Select All | Build) |
Revision as of 09:41, 19 March 2014
- For compiling on Linux, see Tutorial:Compiling & Installing SWORD.
Contents
Compiling The SWORD Project using MS Visual Studio 2013
- Create a build directory, hereafter referred to as $dir$. Much of the Sword build process expects that various downloads be unpacked to the same directory.
Compiling cURL
- Download the latest release of cURL
- Extract the ZIP to $dir$
- Rename the cURL directory to "curl" (with no version number)
- Start a Developer Command Prompt (find this on your Start Menu in the Visual Studio 2013 | Visual Studio Tools menu)
- cd to $dir$/curl/winbuild
- Execute: nmake /f Makefile.vc mode=static DEBUG=no
Compiling ICU
- Download the latest release of ICU. At writing, the latest version is 52.1: [1]
- Extract the tarball to $dir$
- Open $dir$\icu\source\allinone\allinone.sln
- Build all (Click Build | Batch Build... | Select All | Build)
Compiling bzip2
- Download the latest release of bzip2. At writing, the latest version is 1.0.6: [2]
- Extract the archive to $dir$ and rename the directory bzip2
- Open $dir$\bzip2\libbz2.dsp and allow Visual Studio to update the project
- Build all (Click Build | Batch Build... | Select All | Build)
Downloading liblzma
- Download the latest release of xz prebuilt for Windows from tukaani.org. At writing, the latest version is 5.0.5: [3]
- Extract the archive to $dir$/xz
- Start a Developer Command Prompt (find this on your Start Menu in the Visual Studio 2013 | Visual Studio Tools menu)
- cd to $dir$/xz/bin_i486
- Execute: lib /def:../doc/liblzma.def /out:liblzma.lib /machine:x86
Compiling CLucene
- Install cmake
- Download the latest version of boost. At writing, the latest version is 1.5.5: [4]
- Extract the archive to $dir$
- Rename the boost directory to "boost"
- Download a snapshot of the CLucene 2_3_2 branch
- Extract the archive to $dir$
- Rename the CLucene directory to "clucene"
- Start a regular Command Prompt (cmd.exe)
- cd to $dir$/clucene
- Set Boost environment variables by executing the following (with replacements for $dir$):
- set BOOST_BUILD_PATH=$dir$\boost\tools\build\v2
- set BOOST_PATH=$dir$
- set BOOST_ROOT=$dir$\boost
- Execute: mkdir cmakebuild
- Execute: cd cmakebuild
- Execute: cmake -G "Visual Studio 12" ..
- Open $dir$\clucene\cmakebuild\clucene.sln
- Ensure that the Release configuration is selected and build the BUILD_ALL solution
Compiling libsword
- Download the latest release of The SWORD Project
- Extract the tarball to $dir$
- If you are building utilities or diatheke, the following steps are not necessary:
- Open $dir$\sword-$version$\lib\vcppmake\vc8\libsword.vcproj
- Build all (Click Build | Batch Build... | Select All | Build)
Compiling utilities
- Open $dir$\sword-$version$\utilities\vcppmake\utilities.sln
- Build all (Click Build | Batch Build... | Select All | Build)
Cross Compiling Sword for MS Windows on Suse Linux with MingW
Suse with MingW
Installation of all necessary dependencies of Sword, but for CLucene - libcurl, ICU, libgnurx etc -
Compilation of Clucene
clucene 0.9.21b source
The scripts for compiling sword and clucene in xiphos/win32/suse are meant to be used from ~/source/ with the clucene and sword directories directly under that. I would suggest reading the scripts. They aren't complicated, and I'm sure that I made assumptions about my environment (which is basically the *sole* reason for the warning that they aren't ready, I never meant they couldn't be used). You can go ahead and try to use them to cross-compile clucene. It will probably fail. If at that point, you send me config.log, that will help me remember what to do to fix it.
edit m4/dps_static_const_type.m4, the last AC_DEFINE line. Change from:
AC_MSG_ERROR([Cannot figure out how to write static consts in classes. Check the m4 script or upgrade your compiler])
to:
AC_DEFINE([LUCENE_STATIC_CONSTANT_SYNTAX], 1, [How to define a static const in a class])
eg, the same as the first AC_DEFINE. I have no idea if it's correct, actually, but it seems to work ;)
Next, edit src/Makefile.am, line 6. Add -no-undefined at the end, like so:
libclucene_la_LDFLAGS = --version-info $(CLLIB_VERSION) --release $(PACKAGE_VERSION) -no-undefined
src/CLucene/store/FSDirectory.cpp
At the top of that file, after the #include directives, I just added this:
#define _mkdir mkdir
After changing these, you'll have to run autogen.sh and then re-configure using my script. It *should* build after this, at which point run sudo make install. Check to be sure it created a dll rather than just a static library (which will end in .la). It should be located in /usr/i686-w64-mingw32/sys-root/mingw/bin
After this Clucene compiles without errors and creates a working dll.
Compilation of Sword
Application of 2 patches:
patch1 patch2