Warning
This documentation is for an old version of Cantera. You can find docs for newer versions here.
Windows installers are provided for stable versions of Cantera. These installation instructions are for Cantera 2.1.2.
Choose your Python version and architecture
Install Python
Install Numpy
Remove old versions of Cantera
Install Cantera
Configure Matlab (optional)
Test the installation
Python:
import cantera
gas = cantera.Solution('gri30.cti')
h2o = cantera.PureFluid('liquidvapor.cti', 'water')
Matlab:
gas = IdealGasMix('gri30.cti')
h2o = importPhase('liquidvapor.cti','water')
The easiest way to install Cantera on OS X is by using Homebrew. These instructions have been tested on Mac OS X 10.9 (Mavericks) with Xcode 5.1.
If you’ve used Homebrew before, you may have already completed some of these steps and can skip them.
Install Xcode from the App store
From a Terminal, run:
sudo xcodebuild
and agree to the Xcode license agreement
Install Homebrew
Run the following commands:
brew tap homebrew/science brew update brew install python scons sundials
Put /usr/local/bin at the front of your path, e.g. add the following to ~/.bash_profile (creating this file if it doesn’t already exist):
export PATH=/usr/local/bin:$PATH
Run:
source ~/.bash_profile
If you want to build the Cantera Python 2 module, run:
pip install cython numpy
If you want to build the Cantera Python 3 module, run:
brew install python3
pip3 install numpy cython
The installation command for Cantera supports several options:
Install Cantera by adding the desired options to the brew install command, e.g.:
brew install cantera --devel --with-matlab=/Applications/MATLAB_R2014a.app/
Ubuntu packages are provided for recent versions of Ubuntu using a Personal Package Archive (PPA). As of Cantera 2.1.2, packages are available for Ubuntu 12.04 LTS (Precise Pangolin) and Ubuntu 14.04 LTS (Trusty Tahr). To see which Ubuntu releases and Cantera versions are currently available, visit https://launchpad.net/~speth/+archive/ubuntu/cantera
The available packages are:
To add the Cantera PPA:
sudo aptitude install python-software-properties
sudo apt-add-repository ppa:speth/cantera
sudo aptitude update
To install all of the Cantera packages:
sudo aptitude install cantera-python cantera-python3 cantera-dev
or install whichever subset you need by adjusting the above command.