Previous Page Parent Page Previous Page TOC
Installation | Language Bindings | Compiling from Source

Compiling from Source

Compiling From Source

In order to compile the bindings from source, you have to download the COPASI sources for Build-30 from the COPASI server as well as the patch for the bindings on the same server. To apply the patch, you unpack the sources and change into the top level directory of the sources. Under any UNIX system you use the program patch to apply the patch. The command line for that could look like this:
bunzip2 -c PATCHFILE | patch -p1

Once the patch has been applied, you have to tell the build system where to find the needed libraries and include files. In order to compile the sources you will need an implementation of LAPACK or CLAPACK, libSBML 3.2.0, expat (2.0.1), raptor(1.4.18), swig 1.3.31 (other version will most likely not work), a Java SDK and/or a python installation with header files.

Since the build system relies on qmake, a version of Qt 4 (or at least qmake) is needed as well. The build system probably also requires you to have qwt (5.0.2) installed.

On MacOS X, an implementation of LAPACK is already included in the form of the Accelerate framework, on windows and Linux the Intel Math Kernel Libraries can be used as well as one of the implementations mentioned above.

Configuration under windows is slightly different from the UNIX systems. Under windows configure.bat is the script that is used to configure the sources. With configure.bat most options are passed as variables rather then command line arguments. A call to configure.bat might for example look like this:
configure.bat --enable-release \
              "SWIG_PATH=C:\Devel\swigwin1.3.31" \
              "BUILD_GUI=no" \
              "CLAPACK_PATH=C:\Devel\clapack" \
              "EXPAT_PATH=C:\Devel\expat-2.0.1" \
              "RAPTOR_PATH=C:\Devel\raptor-1.4.18" \
              "SBML_PATH=c:\Devel\libsbml-3.1.1-src" \
              "QWT_PATH=c:\Devel\qwt-5.0.2" \
              "ENABLE_PYTHON=yes" \
              "PYTHON_LIB_PATH=C:\Python25\libs" \
              "PYTHON_INCLUDE_PATH=C:\Python25\include" \
              "ENABLE_JAVA=yes" \
              "JAVA_PATH=C:\Java\jdk1.5.0_15" \
              "JAVA_HOME=C:\Java\jdk1.5.0_15"

This would configure the build of a release version of the python and the java bindings (as well as CopasiSE) with expat and libsbml dynamically linked.

On some systems tweaking of copasi/common.pri in the source directory might be necessary to get COPASI to compile.

One last word of caution. The bindings are automatically created using the SWIG package. Although the bindings an be created using the latest SWIG 2, the code generated by SWIG 2 seemed to contain some bugs and not all features worked. So in my opinion, SWIG 1.3.40 currently provides the better results.