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

Compiling from Source

In order to compile the bindings from source, you have to download the COPASI sources either from our download section or from our github repository.

You will also need a number of dependencies installed, the easiest thing is to go and grab the copasi-dependencies project, where we have bundled all the dependency open source projects that we use. For the landuage bindings you won't need to have Qt installed. Just follow the steps as described here:

The language bindings are created using SWIG, additionally you will need CMake, to configure the project, and of course the development packages for the programming language that you want to build for. Our CMake scripts has the option for the following language bindings:

  • -DENABLE_CSHARP=ON: This will create the language bindings for .NET.
  • -DENABLE_JAVA=ON: This will create the language bindings for Java.
  • -DENABLE_PYTHON=ON: This will create the language bindings for Python.
  • -DENABLE_R=ON: This will create the language bindings for R.
  • -DENABLE_PERL=ON: This will create the language bindings for Perl.
  • -DENABLE_OCTAVE=ON: This will create the language bindings for Octave.

So for example, on a system with java installed (and the jdk dev package, cmake, swig) you would create the python bindings like so:

git clone https://github.com/copasi/COPASI
mkdir build_copasi
cd build_copasi
cmake -DBUILD_GUI=OFF -DENABLE_JAVA=ON -DCMAKE_INSTALL_PREFIX=~/copasi -DCOPASI_DEPENDENCY_DIR=../copasi-dependencies/bin ../COPASI
make
make install

If you are compiling on Visual Studio on Windows, we recommend that you do define the flag: -DWITH_STATIC_RUNTIME=ON for both the copasi-dependencies project, as well as COPASI, as otherwise you will have to ensure that the matching Visual Studio Runtime is installed wherever you want to use the bindings.