Skip to content

How to install AtChem2

R. Sommariva edited this page Dec 29, 2019 · 17 revisions

AtChem2 can be installed on Unix/Linux or macOS systems. Download the latest stable release at: https://github.com/AtChem/AtChem2/releases. Alternatively, download the zip file with the development version (master branch) or use git to clone the repository.

For more information, see the AtChem2 manual in the doc/ directory.

Requirements

  • Fortran compiler: GNU gfortran (default) or Intel ifort.
  • Python, cmake, Ruby (optional).
  • BLAS, LAPACK.

Dependencies

The dependencies are installed in a dependencies directory (e.g., $HOME/atchem-lib/) using the scripts in the tools/install/ directory.

  • CVODE and openlibm:

    ./tools/install/install_cvode.sh ~/atchem-lib/
    ./tools/install/install_openlibm.sh ~/atchem-lib/
    
  • numdiff (only required to run the Test Suite) may already be installed. If not, it can be installed locally in the dependencies directory:

    ./tools/install/install_numdiff.sh ~/atchem-lib/numdiff/
    

    Add PATH=$PATH:$HOME/atchem-lib/numdiff/bin to .bash_profile (or .profile).

  • FRUIT (only required to run the Test Suite, needs Ruby). Add to .bash_profile (or .profile):

    GEM_HOME=$HOME/.gem
    PATH=$PATH:$GEM_HOME/bin
    

    Then, run the installation script:

    ./tools/install/install_fruit.sh ~/atchem-lib/
    

Installation

  1. After installing the dependencies, copy the example Makefile to the AtChem2 main directory: cp ./tools/install/Makefile.skel ./Makefile (v1.2) OR cp ./tools/Makefile ./Makefile (v1.1.1 and earlier)

  2. Edit ./Makefile to set the correct paths of CVODE, openlibm and (optionally) FRUIT.

  3. To test the installation, compile and run the example mechanism:

    • for v1.2:
      ./build/build_atchem2.sh ./mcm/mechanism_test.fac
      ./atchem2
      
    • for v1.1.1 and earlier:
      ./tools/build.sh ./tools/mcm_example.fac
      ./atchem2
      

Note for macOS users

When AtChem2 is run for the first time, it may give an error like this:

dyld: Library not loaded: @rpath/libsundials_cvode.2.dylib
Referenced from: /Users/username/AtChem2/./atchem2
Reason: image not found
Abort trap: 6

In this case, type at the terminal prompt the following command (change the path to the CVODE library as appropriate):

export DYLD_LIBRARY_PATH=$(HOME)/atchem-lib/cvode/lib

To make it permanent, add the command to .bash_profile (or .profile).

Advanced users may wish to use instead the accepted answer in this Stack Overflow post and hardcode rpath in this instance for each of libsundials_cvode.2.dylib, libsundials_fvecserial.2.dylib, libsundials_vecserial.2.dylib.

Clone this wiki locally