Getting Started with the API Implementation (read this first)

Getting Started with the API Implementation (read this first)

Obtaining the CellML API

Summary of how to obtain the API Implementation:

  Stable Bleeding Edge
Using Binary SDK Release page under 'Stable Releases'. Nightly builds
From source hg clone http://cellml-api.hg.sourceforge.net/hgroot/cellml-api/cellml-api/; cd cellml-api; hg checkout 1.10 hg clone http://cellml-api.hg.sourceforge.net/hgroot/cellml-api/cellml-api/

If you check out the source code, you can keep up-to-date with new changes, by changing into the cellml-api directory and running:

  hg pull -u

Note that bleeding edge versions may have problems which stop them from compiling or working correctly. You can check the status of the compilation and automated tests on different platforms here.

Binaries (SDK packages) for Linux (x86 and AMD64), Windows (32 bit Microsoft Visual C++ 2010 and MinGW), and Mac OS X (PowerPC, x86, and x86_64 universal binaries) are built every night (at 11 PM New Zealand time) on days where there have been changes to source code. Nightly builds can be found here under the version of the API currently being worked towards. Note: old nightlies are not guaranteed to be hosted forever, so please do not publish links to specific binaries; instead either host the binary elsewhere, or link to a stable release.

The SDK is packaged in a way that is specific to the platform you are on; tar.bz2 for Linux platforms, .dmg on Mac OS X, and a choice of a self-extracting executable or a zip file on Windows.

Using a binary SDK

Once you have extracted the SDK, you need to set up your build environment to work with the SDK by following these steps:

  • On Windows, you need to make sure you have the appropriate C++ standard library in your path (even if you only plan to use the CellML SDK from Java or Python). If you downloaded the MSVC 2010 version of the SDK, you can do this by installing the MSVC Redistributable from Microsoft. If you downloaded the MinGW version of the SDK, you need to put the directory containing the libstdc++-6.dll library in your path (this file comes with MinGW).
  • To compile C++ programs, you need to ensure the SDK include directory is in your include path. If you are using gcc (including MinGW), you can do this with a shell command like: export CPLUS_INCLUDE_PATH=/path/to/sdk/include:$CPLUS_INCLUDE_PATH On MSVC10, a different environment variable is used; at the cmd.exe prompt:
        set INCLUDE="c:\path\to\sdk\include;%INCLUDE%"
    
  • For C++ program compilation, you also need to set your library path. On gcc systems (including MinGW) use the following bash command: export LIBRARY_PATH=/path/to/sdk/lib:$LIBRARY_PATH On MSVC10 (at the cmd.exe prompt):
        set LIB="c:\path\to\sdk\libs;%LIB%"
    
  • To run any program using the API (whether C++, Python or Java), you need to tell the dynamic linker where to find the DLLs from the CellML SDK. We suggest you distribute the relevant binaries with your application. However, for development, you may want to point the path into your SDK install like this: On Linux (and other glibc based systems) use this bash command:
        export LD_LIBRARY_PATH=/path/to/sdk/lib:$LD_LIBRARY_PATH
    
    On Mac OS X use this bash command:
        export DYLD_LIBRARY_PATH=/path/to/sdk/lib:$DYLD_LIBRARY_PATH
    
    On Windows (at the cmd.exe prompt):
        set PATH="c:/path/to/sdk/lib;%PATH%"
    
  • To compile and / or run Java code that uses the CellML API, you need to put cellml.jar into the classpath, using a command like this: Non-Windows (bash shell):
          export CLASSPATH=/path/to/sdk/lib/cellml.jar:$CLASSPATH
    
    Windows (at cmd.exe):
          set CLASSPATH="c:/path/to/sdk/lib/cellml.jar;%CLASSPATH%"
    
  • When running Java programs, you need to set the java.library.path property to include the CellML SDK lib directory. One way to do this is to pass an option to java like this: "-Djava.library.path=/path/to/sdk/lib"
  • When running Python programs, you need to set the PYTHON_PATH environment variable to point to the Python subdirectory of the SDK lib directory:
          export PYTHON_PATH=/path/to/sdk/lib/python:$PYTHON_PATH