Prerequisites

YAML

</p>
<pre>git clone https://github.com/jbeder/yaml-cpp.git YAML<br />cd YAML &amp;&amp; mkdir build &amp;&amp; cd build &amp;&amp; \<br />    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 &amp;&amp; \<br />    make -j8 &amp;&amp; \<br />   make -j8 install</pre>
<p>

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:

</p>
<p>apt-get install python3-ruamel.yaml<br />


scons and cython

</p>
<p>conda install scons cython</p>
<p>

Checkout Cantera

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

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

Build Cantera

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

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

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

scons test

and then install Cantera:

scons install

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