Difference between revisions of "Compilation"

From Kiwix
Jump to navigation Jump to search
 
(18 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{translations}}
{{translations}}
<translate><!--T:1-->
These are the '''instructions to download and compile (depreacted) Kiwix (kiwix-desktop based on Xulrunner) source code'''.


These are the instructions to compile Kiwix. The source code is on:
To find up2date compilation instructions for each of the Kiwix products, please have a look to the README.md file in each code repository at http://code.kiwix.org.
* svn: https://kiwix.svn.sourceforge.net/svnroot/kiwix
</translate>
* download: http://download.kiwix.org/src/


<translate>== Get the code == <!--T:2-->
</translate>


== GNU/Linux ==
<translate><!--T:3-->
The source code of Kiwix is available:
* Directly from the source code repository: https://github.com/kiwix/kiwix/
* As a tarball: http://download.kiwix.org/src/
</translate>


GNU/Linux build uses shared libraries by default. You will need the following dependencies to compile Kiwix for Linux Debian/Ubuntu packages: build-essential autoconf automake libtool libicu-dev libclucene-dev libxapian-dev libmicrohttpd-dev liblzma-dev xulrunner-dev zlib1g-dev libssl-dev
<translate>
<!--T:10-->
Before to continue, read the [http://compile.kiwix.org README] file.
</translate>


* ./autogen.sh to generate the ./configure file if not already done.
<translate>== Dependencies == <!--T:4-->
* ./configure to prepare the compilation and check if all necessary libraries are installed. You may get more information by running ./configure --help
Kiwix relies on many open source libraries to compile. If it does not compile this probably means one of these libraries is not available. Check the configure log file. Some of the libraries you may miss:
* make to compile kiwix
* [http://openzim.org/wiki/Libzim libzim]
* make install to install it on the system
* [http://tukaani.org/xz/ liblzma]
* [http://ctpp.havoc.ru/en/ libctpp2]
</translate>


== Mac OSX (i386 only for now) ==
<translate>== Compilation == <!--T:5-->
 
</translate>
Mac OS build is close to the Linux one but it compile everything statically. [warning] To build the Mac OS version you will have to install proprietary software which are free of charge.
 
;You will also need to build on an Apple Mac computer.
 
* Install OSX 10.6.5+ (proprietary)
* Install XCode 3.2.5+ (proprietary) -
::http://developer.apple.com/technologies/xcode.html (requires registration)
::http://download.kiwix.org/dev/xcode_3.2.5_and_ios_sdk_4.2_final.dmg
* Install XulRunner
::http://download.kiwix.org/dev/xulrunner-1.9.2.13.en-US.mac-pkg.dmg
* Install MacPorts - http://www.macports.org/install.php
* Configure Macports
 
* Install the following tools and libraries
sudo port install autogen +universal
sudo port install pkgconfig +universal
sudo port install wget +universal
sudo port install gmake +universal
sudo port install coreutils +universal
sudo port install libidl +universal
sudo port install autoconf213 +universal
sudo port install icu +universal
* short-circuit libtoolize which is a different tool on OSX.
sudo ln -s /opt/local/bin/glibtoolize /opt/local/bin/libtoolize
* set default target architecture by replacing gcc and g++ files
sudo mv /usr/bin/gcc /usr/bin/gcc.default
sudo mv /usr/bin/g++ /usr/bin/g++.default
sudo echo "/usr/bin/gcc-4.2 -arch i386 -m32 "$@"" > /usr/bin/gcc
sudo echo "/usr/bin/g++-4.2 -arch i386 -m32 "$@"" > /usr/bin/g++
sudo chmod +x /usr/bin/g{cc,++}
Alternatively, you can choose to prepend CFLAGS=" -arch i386 -m32"
CXXFLAGS=" -arch i386 -m32" to the configure command.
* ./autogen.sh to generate the ./configure script.
* ./configure --prefix=/opt/local
::to prepare the compilation and check if all
::necessary libraries are installed. You may get more information by
::running ./configure --help
::/opt/local is the path where you installed MacPorts (/opt/local is default)
* make in src/dependences to fetch dependencies.
* re-do ./configure script so it knows about new dependencies.
* make to compile kiwix
* make distmac to generate a complete dmg archive.
* Debugging tips:
 
- components file type can be either Mach-O dynamically linked shared library
:or Mach-O bundle but above instructions will create dynamic libraries.
- Shared Object (.so files on Linux) have .dylib extension on OSX.
- use dtruss to inspect program execution like strace.
 
== Windows ==
 
* You have to install a MinGW environnement. You have to download it here: "http://download.kiwix.org/dev/MozillaBuildSetup-1.4.exe" and install it in the default proposed directory "C:mozilla-build".
 
* Go to "c:mozilla-build" with the Windows explorer and start the script start-msvc9.bat. You have now an UNIX shell.
 
* Change the current directory by typing:
> cd /c/mozilla-build/
 
* Check out the kiwix client code by typing:
svn co https://kiwix.svn.sourceforge.net/svnroot/kiwix/moulinkiwix
 
* You need to install Perl. Download it here: "http://download.kiwix.org/dev/ActivePerl-5.10.1.1007-MSWin32-x86-291969.msi" and install it in the default directory "c:Perl"
 
* You need now to install the free (as free beer) Microsoft Visual Studio express C++ compiler. You can download the installer here: "http://download.kiwix.org/dev/vcsetup.exe"
 
* To install it, run the self installer. Choose none of the optional features and install it in the default directory: "c:Program FilesMicrosft Visual Studio 9.0"
 
* If installed sucessfuly run one time VS to configure it and maybe register it (follow the instructions).
 
* You have also to install gcc (for liblzma). You can download it here:
::"http://download.kiwix.org/dev/gcc-4.3.0-20080502-mingw32-alpha-bin.7z"
::... and unzip it (with 7zip) in "c:mozilla-buildmsys"
 
* You have also to install GNU binutils. Please download it here:
::"http://download.kiwix.org/dev/binutils-2.20.1-2-mingw32-bin.tar.gz"
::... and detar it in "c:mozilla-buildmsys"
 
* Now we will download, configurate and compile kiwix.
::Run the following commands:
> cd /c/mozilla-build/moulinkiwix/
> ./autogen.sh
> ./configure
> make win
 
The compilation is standard.
 
Please follow these steps:


<translate><!--T:6-->
The compilation on UNIX (GNU/Linux) follows the GNU autotools procedure:
</translate>
<source lang="bash">
<source lang="bash">
./autogen.sh
./autogen.sh
Line 111: Line 39:
</source>
</source>


On [http://fedoraproject.org/ Fedora], the compilation is a little bit more complicated. You have to:
<translate><!--T:7-->
 
On Apple Mac OS X and Microsoft Windows, the compilation is far more complicated. Please have a look to the COMPILE file in Kiwix source directory.
<source lang="bash">
</translate>
./autogen.sh
./configure --with-xpidl=/usr/lib/xulrunner-`pkg-config --modversion libxul`/ --with-gecko-idl=/usr/lib/xulrunner-sdk-`pkg-config --modversion libxul`/sdk/idl
make
</source><noinclude>


== See also ==
<translate>== Other == <!--T:8-->
* [[Kiwix-serve]]
The Kiwix project provides also many additional tools. You may have a look to other code repositories [//code.kiwix.org here].
* [[Translation]]
</translate>
* [[PPA]]
</noinclude>


[[Category:Developer's Guide]]
<translate>== See also == <!--T:9-->
* [[{{ll|Development}}|Development]]
</translate>

Latest revision as of 10:36, 11 November 2017

Other languages:
Bahasa Melayu • ‎Deutsch • ‎English • ‎azərbaycanca • ‎català • ‎español • ‎français • ‎galego • ‎italiano • ‎magyar • ‎português • ‎русский • ‎فارسی • ‎বাংলা • ‎日本語

These are the instructions to download and compile (depreacted) Kiwix (kiwix-desktop based on Xulrunner) source code.

To find up2date compilation instructions for each of the Kiwix products, please have a look to the README.md file in each code repository at http://code.kiwix.org.

Get the code

The source code of Kiwix is available:

Before to continue, read the README file.

Dependencies

Kiwix relies on many open source libraries to compile. If it does not compile this probably means one of these libraries is not available. Check the configure log file. Some of the libraries you may miss:

Compilation

The compilation on UNIX (GNU/Linux) follows the GNU autotools procedure:

./autogen.sh
./configure
make

On Apple Mac OS X and Microsoft Windows, the compilation is far more complicated. Please have a look to the COMPILE file in Kiwix source directory.

Other

The Kiwix project provides also many additional tools. You may have a look to other code repositories here.

See also