Build Instructions

Requirements

Build System

In order to build Zorba, you need the Cross-Platform Make CMake 2.4 or higher, but not CMake 2.6.3 which has a serious bug preventing Zorba build. You can download it from http://www.cmake.org/.

Compilers

Zorba is tested with the following compilers:

Packages

In order to build Zorba, you need the following libraries and development headers to be installed:

Building Zorba

  1. Install the Zorba source distribution (see Installation). The directory in which the Zorba sources are installed is referred to as [ZORBA] in the following.
  2. Change the working directory into [ZORBA].
  3. The recommended way to build Zorba is by creating an out-of-source build. We suggest to create the directory [ZORBA]/build and refer to this directory as [ZORBABUILD] in the following.
  4. Change the working directory into the [ZORBABUILD] directory and execute cmake as follows: cmake [ZORBA]. In case the [ZORBABUILD] is located directly within the [ZORBA] directory just type cmake .. . This command should configure Zorba and prepare for the build. CMake will tell you if your installation is missing some of the required libraries or development headers.
  5. If CMake was executed successfully, you should be able to run make. Running make will take some time. If make finished successfully, you're ready to install and run Zorba (see Installation).

Build Options

Note for Mac OS Users

The easiest way to install the required packages (like CMake, etc.) is to use Darwin Ports (http://darwinports.com/). After installing Darwin Ports, you should run sudo port -d selfupdate to upgrade the package lists. If this was successful, you can simply install packages by typing e.g. sudo port install cmake. Note that versions of libcurl and libtidy, that are already installed as part of Mac OS X are sufficient. However, a newer version of libxml2 than the one that is part of Mac OS X (v 2.6.16) is needed which can be obtained from Darwin Ports (v 2.6.31) or from source (v 2.2.7 ). Assumming the latter, one add the following to the cmake configuration options

cmake -D LIBXML2_LIBRARIES=/usr/local/lib/libxml2.dylib

Building as Universal binaries

To build zorba as a universal binary one must also build the required external libraries as universal. In most cases this is as easy as building them non-universal. Following are instructions on how to do so.

For Xerces-C the instructions given by Apple almost just work. One should change the CFLAGS to CXXFLAGS because Xerces is written in C++. Zorba developers prefer a variation on those instructions like this ...

./configure CXXFLAGS="-arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk" \
-disable-dependency-tracking LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk \
-arch i386 -arch ppc"

Since libxml2 is written in C, change CXXFLAGS to CFLAGS in the above. As noted by Apple, dependency generation by gcc doesn't work when building universal, thus it is turned off with the above command.

For ICU, one must build the libraries seperately on PPC and Intel platforms then combine the them into a Universal library. The reason for this is that ICU tests for endianess at configure time (i.e. before compiling), thus the compiled code will only have endianess correct for one platform. The script zorba/scripts/makefat.sh shows one how to do the combining.

Once all the external libraries are built and installed Universal, one can build zorba Universal setting the CMake variable UNIVERSAL on like this

cmake -D UNIVERSAL=1 ..

Building Mac OS X Installer

In order to build an installer package, one should run cmake with an extra flag as follows...

> cmake -DCMAKE_SKIP_BUILD_RPATH=1 .. 

This will remove the build path from the installed executables and libraries. It will also add some symbolic links to the libraries.

Notes for Windows Users

Building Zorba using a NMake Project

  1. Start a Visual Studio Command Line
  2. Change the current working directory into the [ZORBA] directory.
  3. The recommended way to build Zorba is by creating an out-of-source build. We suggest to create the directory [ZORBA]/build and refer to this directory as [ZORBABUILD] in the following.
  4. Execute CMake as follows cmake -G "NMake Makefiles" [ZORBA]. Unfortunately, CMake does not find all the development headers and libraries itself. Hence, you need to tell CMake where they are located. This can be done by the following command:
    "cmake" 
    -G "NMake Makefiles"
    -D ICU_LIBRARY="path_to_icu\lib\icuuc.lib" 
    -D ICU_DATA_LIBRARY="path_to_icu\lib\icudt.lib" 
    -D ICU_I18N_LIBRARY="path_to_icu\lib\icuin.lib" 
    -D ICU_INCLUDE="path_to_icu\include" 
    -D ICONV_INCLUDE_DIR="path_to_iconv\include" 
    -D ICONV_LIBRARY="path_to_iconv\lib\iconv.lib" 
    -D LIBXML2_INCLUDE_DIR="path_to_libxml2\include" 
    -D LIBXML2_LIBRARIES="path_to_libxml2\lib\libxml2.lib" 
    -D XERCESC_INCLUDE="path_to_xerces\include" 
    -D XERCESC_LIBRARY="path_to_xerces\lib\xerces-c_2.lib"
    ..\
    

If you need CURL (e.g. to have REST support) you have to point two CMake variables to CURL's include directory and the CURL library.

- D ZORBA_WITH_REST=ON
- D CURL_INCLUDE_DIR="path_to_curl\include"
- D CURL_LIBRARY="path_to_curl\lib\curllib.lib"

If you additionally want to have support for Tidy in order to syntactically cleanup HTML documents, you have to set the following CMake variables:

- D ZORBA_WITH_TIDY=ON
- D LIBTIDY_INCLUDE_DIR="path_to_tidy\include"
- D LIBTIDY_LIBRARIES="path_to_tidy\lib\tidy.lib"

In order to add XQueryX support you have to add ZORBA_XQUERYX=ON and add the paths to libxslt

-D ZORBA_XQUERYX=ON
-D LIBXSLT_INCLUDE_DIR="path_to_libxslt\include"
-D LIBXSLT_LIBRARIES="path_to_libxslt\lib\libxslt.lib"

For using the email functionality you have to add the cclient lib:

-D CCLIENT_INCLUDE="path_to_imap_2007e\c-client"
-D CCLIENT_LIBRARY="path_to_imap_2007e\c-client\release\cclient.lib"

After you've provided all of the required variables, you are ready to call nmake from the [ZORBABUILD] directory.

Building Visual Studio Project

  1. Start Visual Studio Command Line
  2. Change the current working directory into the [ZORBA] directory.
  3. Execute CMake as described above but with the -G "Visual Studio X 200Y" option instead of -G "NMake Makefiles".
  4. Start Visual Studio, open the generated zorba.sln project file, and start compilation.

HTTPS support

 All Files