Installing Cantera: Difference between revisions
From charlesreid1
(Created page with "{{Main|:Category:Cantera}} This page is primarily focused on explaining the Cantera installation procedure for Linux, Mac OS X, and Windows. Also, this page is designed to be u...") |
No edit summary |
||
| Line 1: | Line 1: | ||
{{Main|:Category:Cantera}} | {{Main|:Category:Cantera|l1=Cantera}} | ||
This page is primarily focused on explaining the Cantera installation procedure for Linux, Mac OS X, and Windows. | This page is primarily focused on explaining the Cantera installation procedure for Linux, Mac OS X, and Windows. | ||
| Line 39: | Line 39: | ||
Before (broken): | Before (broken): | ||
{{scroll box | |||
|width=75% | |||
|content= | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
NUMPY_HOME=${NUMPY_HOME:="/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include"} | NUMPY_HOME=${NUMPY_HOME:="/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include"} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | |||
After (fixed): | After (fixed): | ||
{{scroll box | |||
|width=75% | |||
|content= | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# NUMPY_HOME=${NUMPY_HOME:="/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include"} | # NUMPY_HOME=${NUMPY_HOME:="/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include"} | ||
| Line 49: | Line 56: | ||
export NUMPY_INC_DIR | export NUMPY_INC_DIR | ||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | |||
You can find my preconfig file here: [[Cantera Preconfig]] | You can find my preconfig file here: [[Cantera Preconfig]] | ||
Revision as of 09:14, 12 May 2011
This page is primarily focused on explaining the Cantera installation procedure for Linux, Mac OS X, and Windows.
Also, this page is designed to be useful for anyone installing Cantera. If you don't think it's useful, or if you're having a problem not addressed by the page, please email me at root (at) charlesmartinreid.com with your problem and (if you found it) the solution, or with any comments or suggestions, and I will adjust the page accordingly.
Downloading
You can download Cantera from Google Code: http://code.google.com/p/cantera/downloads/list
(it used to be hosted at SourceForge, but the project has since moved to Google Code)
This guide will cover version 1.8.0.
Linux
You probably already know what to do. You can follow the Mac instructions - the main thing that will change is the procedure for installing Numpy (you can probably use aptitude or yum or whatever package manager your distro uses), and the corresponding path to Numpy include files.
Mac OS X
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. This guide will only cover this method.
Anther package that is not required by Cantera, but that is useful, is Sundials, a suite of nonlinear and differential equation solvers.
Leopard
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.
One of the problems with using Cantera with Numpy is that Cantera incorrectly parses the path to the Numpy home directory to get a Numpy include directory that doesn't exist. This causes the 'import_array' error (below). This can be resolved by pointing Cantera configure to the Numpy include directory, by removing the variable NUMPY_HOME and adding a variable NUMPY_INC_DIR.
Before (broken):
NUMPY_HOME=${NUMPY_HOME:="/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include"}
|
After (fixed):
# NUMPY_HOME=${NUMPY_HOME:="/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include"}
NUMPY_INC_DIR=${NUMPY_INC_DIR:="/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include/numpy"}
export NUMPY_INC_DIR
|
You can find my preconfig file here: Cantera Preconfig
Your next steps are obvious:
$ ./preconfig
$ make
$ make install
Snow Leopard
Mac Installation Errors
(Many details forthcoming...)