Build Instructions

Requirements

Build System

In order to build Zorba, you need the Cross-Platform Make CMake 2.4 or higher. You can download it from http://www.cmake.org/.

Compilers

Zorba is tested with the following compilers:

Packages

In order ot 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 refered to as [ZORBA] in the following.
  2. Change the working directory into [ZORBA].
  3. The recommended way to build Zorba is by creating and 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 installating Darwin Ports, you should run sudo port -d selfupdate to upgrade the package lists. If this was successfull, you can simply install packages by typing e.g. sudo port install cmake. Note that libxml2 is already installed as part of Mac OS X.

Building as Universal binaries

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

For ICU and Xerces-C the instructions given by Apple almost just work. One should change the CFLAGS to CXXFLAGS. 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"

As noted by Apple, dependency generation by gcc doesn't work when building universal, thus it is turned off with the above command.

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 and 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"
    ..\
    
  5. Compile Zorba by calling 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.