Requirements
Build System
In order to build Zorba, you need the Cross-Platform Make CMake 2.6 or later (except CMake 2.6.3 that has a serious bug preventing Zorba from building). You can download CMake from http://www.cmake.org/.
Compilers
Zorba is tested with the following compilers:
- GNU Compiler: GCC 3.4.x (32-bit & 64-bit) and GCC 4.x.x
- Microsoft Compiler: MS VC++ 2008, and MS VC++ 2010 (including Express)
Required Libraries
In order to build Zorba, you need the following libraries and development headers:
Required for Core Zorba
The following packages are mandatory to build the core part of Zorba.
Optional for Core Zorba
The following packages are only required to build Zorba with some features (e.g. XML Schema or HTTP support).
-
Xerces-C 2.8.0, 3.0.0 or later (http://xerces.apache.org/xerces-c/). This package is only required if built with XML schema support. This feature is enabled by default. In order to disable XML schema support, you need to provide the CMake configuration variable
ZORBA_NO_XMLSCHEMA=ON
.
-
CURL 7.12 or later (http://curl.haxx.se/). This package is only required if Zorba's HTTP module should be available. Zorba will automatically be built with this module if the curl packages are installed. In order to suppress HTTP support even though curl is installed, please set the CMake configuration variable
ZORBA_SUPPRESS_CURL=ON
. Please note that other modules depend on this module (i.e. import it). Hence, those depending modules will not work if the http module is not available. Please see our module dependency graph for the module inter-dependencies.
-
LibXslt version 1.1.24 or later (http://xmlsoft.org/XSLT/). The LibXslt package is required for XQueryX support (XQuery 1.0, XQuery 3.0, XQuery Update, and XQuery Full Text). This feature is not enabled by default. It can be enabled if Zorba is compiled using the the CMake configuration variable
ZORBA_XQUERYX=ON
.
-
Flex 2.5.33 or later (http://flex.sourceforge.net/) and Bison 2.4 or later (http://www.gnu.org/software/bison/) are required to generate the XQuery scanner and XQuery parser. These packages are optional and only required if you want to make modifications to the scanner or parser, respectively.
Required for Language Bindings
In order to build the various language bindings that come with Zorba, you need at least Swig 1.3.40 or later (http://www.swig.org/download.html). All bindings are generated using Swig.
For a particular language binding, you need the corresponding language tools and development headers.
Building Zorba
- Install the Zorba source distribution (see Installation). The directory in which the Zorba sources are installed is referred to as
[ZORBA] in the following.
- If desired, also install or download the source for any non-core modules that you would like to build along with Zorba, and ensure that you have any libraries required by those modules available. See Building Non-core Zorba Modules for more details.
- Zorba requires an out-of-source build. We suggest to create the directory
[ZORBA]/build and refer to this directory as
[ZORBABUILD] in the following.
- 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, you can 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.
- If CMake executed successfully, you should be able to build the project. For Makefile-based builds, just type
make
(or make
-j2 to do a parallel build on a multi-core machine). For IDE-based builds, open the project created in the previous step and build the ALL
target. The build will take some time. If it finishes successfully, you're ready to install and run Zorba (see Installation).
Build Options
- CMake is a meta build system, meaning that it is able to generate native makefiles (e.g. GNU Make or NMake) and workspaces (e.g. KDevelop or Visual Studio Projects). For example, you can create a KDevelop Project by executing the following command in the
[ZORBA] directory: cmake -G KDevelop3 [ZORBABUILD]
.
- CMake supports multiple build configurations (e.g. Debug, Release, or MinSizeRel). By default, Zorba is built in the Release configuration. To change the build mode (to Debug, Release, RelWithDebInfo or MinSizeRel), you can pass an additional parameter to CMake, e.g.,
cmake -D CMAKE_BUILD_TYPE=Debug [ZORBA]
.
- Zorba has other build options as well (see Zorba Build Options). You can tweak the performance and library footprint by enabling or disabling various features from Zorba.
Notes for Mac OS X Users
The easiest way to install the required packages (like CMake or Xerces-C) is to use Macports (http://macports.org/).
Once all the required packages are installed you can execute CMake. By default, CMake on Mac OS X uses the Makefile generator. Alternatively, you can specify different generators (e.g., Xcode) by starting CMake using the -G option (e.g., -G Xcode).
Swig Version
Due to a bug in older swig version, Zorba with SWIG support requires SWIG version 1.3.40 or later.
To do this, the swig package from macports should be installed and point cmake to use the new version:
sudo port install swig
cmake -DCMAKE_PREFIX_PATH=/opt/local ..
Notes for Windows Users
- In order to compile Zorba on Windows, you need a working Visual Studio (Express) installation (2008, 2010).
- If you want to compile Zorba using Visual Studio 2008, you will need to install the Visual C++ 2008 Feature Pack Release.
- Make sure that the libraries required for Zorba are built with the same version of Visual Studio that you use.
- The Windows version of some required packages are distributed by other web sites (all of them are pointed to from the main package web sites indicated in the Required Libraries section):
- Zorba has in place an automatic DLL detection mechanism. This will try to automatically gather all the DLLs from the third party librbaries and install them with Zorba when you do "name install" or you build the Visual Studio INSTALL project. Zorba will search for the third party libraries in order in:
- all the directories pointed by the
ZORBA_THIRD_PARTY_REQUIREMENTS
cmake variable
- e.g. if you have Xerces in "C:\tools" and IConv in "D:\tools", you must build with
-D ZORBA_THIRD_PARTY_REQUIREMENTS=C:\tools;D:\tool
and Zorba will find all it needs from Xerces and Iconv. (The directory names must contain "xerces" and "iconv" respectively, case insensitive)
- in the program files directory on your system
- e.g. if you have cURL installed in "C:\Program Files*cURL*", Zorba will find all it needs from cURL. (The directory must contain "curl" case insensitive.)
- all the paths in the
PATH
variable
- e.g. if you have "C:\tools*ICU*\bin" in your path, Zorba will find all it needs from ICU. (The directory must only contain "icu".)
- Note: you can also use CMake's graphical interface. This can usually be found in the Start menu. This eases the setup and makes it more intuitive.
Building Zorba using a NMake Project
- Start a Visual Studio Command Line.
- Change the current working directory to the
[ZORBA] directory.
- It is not allowed to have in-source builds. So you must create a build directory (e.g.,
[ZORBA]/build
). We refer to this directory as
[ZORBABUILD] in the following steps.
- Change the current working directory to the
[ZORBABUILD] directory.
- Execute CMake as follows
cmake -G "NMake Makefiles" [ZORBA]
. CMake will try to find the necessary packages in the program files directory on your system and in the PATH
environment variable. If one of the required dependencies were not found, CMake will stop with an error. See the next step only if this step did not find the required third party dependencies on your system.
- If the command above fails or if you see that some optional packages were not found, you can help CMake a little by providing the lists of path where it should look for the libraries you need. In this case the CMake command should look like:
"cmake" -G "NMake Makefiles" -D ZORBA_THIRD_PARTY_REQUIREMENTS=path\to\dir1;path\to\dir2;...
But you can also manually set the paths to individual libraries and include directory by directly providing the variables set by each find package module (in the cmake_modules
directory).
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"
Now you are ready to call nmake
from the
[ZORBABUILD] directory.
Building Visual Studio Project
- Start Visual Studio Command Line
- Change the current working directory into the
[ZORBA] directory.
- Execute CMake as described above but with the appropriate CMake Visual Studio generator (
-G "Visual Studio ..."
instead of -G "NMake Makefiles"
.
- Start Visual Studio, open the generated
zorba.sln
project file, and start compilation.
HTTPS support
- In order to have SSL support in Zorba, you have to use the CURL library that has SSL support.
- There is one more thing: in order to validate the server's certificate, CURL+SSL needs to know about the root Certificates of Authenticity (CA): a set of public keys freely available on the internet.
- On Windows, Zorba expects this file to be called
cacert.pem
and searches for it in the current directory and system paths.
- This
cacert.pem
file can be found on the curl page: http://curl.haxx.se/docs/caextract.html .
- In order to disable the validation of the server certificate, the
ZORBA_VERIFY_PEER_SSL_CERTIFICATE
can be set to OFF
in cmake (and actually this is the default value). Set it to ON
to validate server certificate chain on every access to https://
.
- To read more about CURL+SSL: http://curl.haxx.se/docs/sslcerts.html .
- As an
https
test page, we used for example the rss feed fn:doc('https://www.npr.org/rss/rss.php?id=1001') .