From charlesreid1

Revision as of 17:47, 6 October 2010 by Admin (talk | contribs) (→‎Mac)

Cantera is a C++ package that provides objects for solving chemical kinetics, thermodynamics, and transport problems. The core of Cantera is written in C++, but it provides interfaces for using Cantera through Matlab (via a Matlab toolbox), Python, or Fortran.


Installation

Mac

If you're installing Cantera on a Mac, you have to build it from source.

Start by downloading the Cantera 1.7 or 1.8 source code, and unzip it. Go to this directory, and edit the preconfig file. This is a wrapper for configure (so when you are ready to configure, you don't run ./configure, you run ./preconfig). Preconfig contains many options that are laid out very clearly, so go through the file and set values appropriate to your system.

You can find my preconfig file here: Cantera Preconfig

Dependencies

If you wish to use Cantera from Python, you have two options:

  • Use version 1.8.0 and install Numpy
  • Use version 1.7.x and install Numarray

I highly recommend using version 1.8.0 and Numpy, as Numarray is no longer supported.

Anther package that is not required by Cantera, but that is useful, is sundials, a suite of nonlinear and differential equation solvers.

Building

Your next steps are obvious:

$ ./preconfig
$ make
$ make install

Mac Installation Errors

If you see this error:

src/pycantera.cpp: In function ‘void init_cantera()’:
src/pycantera.cpp:95: error: ‘import_array’ was not declared in this scope
error: command 'g++' failed with exit status 1
make[1]: *** [_build] Error 1
make: *** [python] Error 2

this means Cantera isn't including Numpy header files, meaning you probably didn't set the path to Numpy home correctly in your preconfig file. This is set by the NUMPY_HOME variable.

Resources

Cantera Google Groups Page - https://code.google.com/p/cantera/

  • Download Cantera 1.8.0 (beta), source code ONLY
  • Check out a copy of the subversion repository

Cantera (Google) Users Group Page - https://groups.google.com/group/cantera-users?pli=1

  • Download Cantera documentation
  • Use the discussion board

Cantera SourceForge Page - http://sourceforge.net/projects/cantera/files/

  • Download Cantera 1.7.1, source code or (Windows) binaries
  • Download (more) Cantera documentation