Prerequisites

YAML

[code .sh]

git clone https://github.com/jbeder/yaml-cpp.git YAML
cd YAML && mkdir build && cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_GMOCK=OFF -DBUILD_MOCK=OFF -DINSTALL_GTEST=OFF -DYAML_BUILD_SHARED_LIBS=ON -DYAML_CPP_BUILD_TESTS=OFF -DYAML_CPP_BUILD_TESTS=OFF && \
make -j8 && \
make -j8 install

[/code]

This will install to /usr/local if you are root. Otherwise, you’ll need to do sudo make install.

If you don’t have root access, you can set -DCMAKE_INSTALL_PREFIX=[install dir] when configuring above.

Other libraries

ruamel.yaml

On ubuntu, I found that I had to install ruamel.yaml:

[code .sh]

apt-get install python3-ruamel.yaml
[/code]


scons and cython

[code .sh]

conda install scons cython

[/code]

Checkout Cantera

We use a slightly modified version of cantera which is hosted on our software repository.  To check this out:

[code .sh]

git clone --single-branch --branch multiscale-api-mods https://gitlab.multiscale.utah.edu/common/Cantera.git

[/code]

Build Cantera

Go to your Cantera source code directory (see the Checkout Cantera section above) and build Cantera:

[code]
cd [cantera-source-dir]
scons build -j 8 \
    python_package=minimal \
    prefix=[install path]  \
    boost_inc_dir=[boost header path] \
    python_cmd=[python cmd with path] \
    system_yamlcpp=y \
    f90_interface=n \
    skip_slow_tests=yes \
    extra_inc_dirs=/usr/local/include \
    extra_lib_dirs=/usr/local/lib[/code]

If the build succeeds, then you should run a test:

[code]scons test[/code]

and then install Cantera:

[code]scons install[/code]

Configure System Settings

At this point, the installation will dump out some information about paths.  Pay particular attention to where the setup_cantera script is placed.  You should add this script to your .bashrc or .zshrc (for bash) script to ensure that the proper environment is setup for using Cantera.

At this point, you should have a functional cantera installation.

Docker Image

If you want a docker image that has a functioning cantera build, you can find one based on ubuntu on docker hub at jsutherland/ubuntu_cantera

Categories: Uncategorized

0 Comments

Leave a Reply

Avatar placeholder