CERFACS Chemistry Sharing knowledge for CFD chemical kinetics

Cantera installation

CERFACS developed its own version based on the official release of the software to suit its particular needs, namely :

  • The simplified transport models that are implemented in AVBP
  • The thickened flame model
  • The use of Quasi-steady State species (QSS) in computations
  • many other CERFACS specific features

The version presented here works with Python 3.
If you want to keep it simple, the official version of Cantera will do. The official website will get you through the installation of the latest version.

This section aims at giving you all the steps to install cantera-avbp on your specific operating system.

 

1. Retrieving the sources

Cantera git repository

The sources of cantera-avbp are available on the public CERFACS’ Gitlab at this link. This version is a read only mirror of the nitrox version (private CERFACS’ Gitlab) which is hosting the development version.

CERFACS only : If you want an access to cantera-avbp nitrox repository, please contact the person in charge (see contact page).

Once you have access to cantera-avbp git repository, copy the git link and launch the following command in your terminal from the directory you chose for installation:

git clone {link}

 

Load NFS module (CERFACS only)

If you only need to run Cantera without a need to change the source code, you can simply use the following command on NFS machines:

module load cantera

 

2. Installing the sources

On Mac OSX

Before starting Cantera installation, check that Xcode is installed and up-to-date on your mac. Then, launch the install_cantera.py script with:

python install_cantera.py

Many dependencies will be installed. At the end of the (quite long) compilation, a message will give you the source command for your newly installed Cantera.
You should copy this line into your .bashrc (or .zshrc depending on your shell) so that Cantera will be loaded each time you open a terminal.

 

Note : If you work with the new mac architecture (Silicon M1), you might face problems with :

  • boost library that is not linked correctly,
    • if it is not already done, launch the installation script, python3 install_cantera.py. An error will occur but, don’t worry, all the packages required for Cantera to work are installed.
    • Then, you should check which version of boost is installed, write in a terminal :
      ls /opt/homebrew/Cellar/boost
    • After, you should add in the cantera.conf file the following line with the corresponding boost version : boost_inc_dir='/opt/homebrew/Cellar/boost/1.75.0_2/include'
    • Then, in your shell, you should type, scons build and scons install.
    • Finally, don’t forget to add the source command in your  .bashrc / .zshrc.
  • If you struggle with the installation on a Mac M1, please send an email to the person in charge (see contacts page).

 

Note : For MacOS more recent than 12.0, an additional line should be added in your .bashrc /.zshrc to use *.f90 files in Cantera :

  • export DYLD_LIBRARY_PATH=$CUSTOM_LIB:$DYLD_LIBRARY_PATH

 

On Linux machines

First, go into the sources directory and create a file named cantera.conf. This script contains the compilation options of the code.
In that file, just write prefix='$CANTERA-AVBP/INSTALL_DIR'. This option will create an install directory in your sources ($CANTERA-AVBP must be replaced by the path to your directory).

The compilation is then launched by the command python3 /usr/local/bin/scons build && python3 /usr/local/bin/scons install or scons build && scons install if python3 is your OS default python.
At the end of the (quite long) compilation, a message will give you the source command for your newly installed Cantera.
You should copy this line into your .bashrc so that Cantera will be loaded each time you open a terminal.

 

On Windows 10 machines

For installing the CERFACS version on cantera on windows machine, you have two different ways :

  • Either you install a virtual box (tutorial). If you have some questions, please contact mouze@cerfacs.fr.
  • Install a Unix distribution as an app (no need for a virtual machine or a duel boot), a tutorial is available here. Once it is done, just follow the instructions for Linux machines.

 

On NFS machines (CERFACS only)

First, load the python 3.7 anaconda module with:

module load python/3.7-anaconda

Then launch the install_cantera.py script with:

python install_cantera.py

At the end of the (quite long) compilation, a message will give you the source command for your newly installed Cantera.
You should copy this line into your .bashrc so that Cantera will be loaded each time you connect.

 

3. Modifying the sources

Remember that you will have to recompile Cantera each time you modify something in the sources for your changes to be effective.
For that, go into your cantera-avbp directory and launch the command:

– On Linux and NFS machines (default python3 installation): scons build && scons install
– On
Mac OSX : python3 /usr/local/bin/scons build && python3 /usr/local/bin/scons install

Don’t forget to source again your .bashrc

 

If there is any problem with this installation procedure, don’t hesitate to send an email at the person in charge (see contact page).

No content defined in the sidebar.