Some notes on how to install Cantera

334 views
Skip to first unread message

Daniel

unread,
Nov 25, 2009, 7:26:34 AM11/25/09
to Cantera User's Group

After struggling to install Cantera with Matlab and python I finally
managed to do so.
I figured that others may have similar problems so I documented my
steps

This is my setup:
OSX10.5.7 but most of the stuff should be the same for other OS's I
think

The following steps installs
Cantera from SVN vers 266
Sundials 2.4
Python 2.64
As well as other tools needed to run cantera.

There may be additional parts needed but this is what I did:


Python and other prerequisites:
I had problems with the default install of Python so I upgraded it.
Best way (I think) to do so is to use Macports

Install XCode and all the developers tools from Apple. You can either
find it on the CD or from Apple's webpage

Install Macports.
From Macports you can then install most of the required tools.

In order to upgrade Python I sugest that you install

python_select

The way to to do this from macports is:
sudo port install python_select

With this tool you can jump from version 2.5 that is the default
installation in OSX to Python 2.5 or e.g 2.6 etc that is the
standard python dist. OSX use some features in Python so DO NOT remove
the original installation.

Then install
Python 2.6.4 or Python 2.5
( I installed 2.6.4)

sudo port install python26

After you have installed python 2.6.4, change your default python to
python 2.6.4 if it was not done automatically

sudo python_select python26
or
sudo python_select python25

When you have selected python26 all add-ons will be installed for
python26 and if you switch back to the apple version of python (or any
other python version) the add-ons will need to be reinstalled in order
to work with that version of python.

Then install gcc ( I selected 4.3) It takes a few hours.
This can also be done from Macports

also install gfortran and f2c from Macports

Then install tkinter - it is needed for gui's
If you have Python25 you can install it from Macports
otherwise http://wiki.python.org/moin/TkInter

Then you need to install numpy, numarray and numeric.
You can find this from Macports as well.

You might as well install graphviz as well from macports.

Finaly I also installed matplotlib since that is used by the reactor
example:
http://matplotlib.sourceforge.net/



Sundials:
Download the version 2.4.0
I tested with version 2.3 and I got some strange errors... Not sure
what it was

https://computation.llnl.gov/casc/sundials/main.html

To install you do the following:


cd sundials
mkdir BUILD
cd BUILD
../configure --prefix=path_to_install --enable-examples CC=gcc
F77=gfortran --with-cflags='-g3 -O2 -fPIC' --with-fflags='-g3 -O0
-fPIC' --disable-mpi
(The path_to_install can be e.g. /opt/sundials-2.4/)
make
make install

(I edited the version of this info from this page:)
(ref: http://groups.google.com/group/cantera-users/browse_thread/thread/01843d5e90924cb3)

Edit you .bash_profile
(you find it in your home dir... e.g. open -e .bash_profile)
I am not 100% sure about what needs to be in here but I added:
SUNDIALS_HOME=/opt/sundials-2.4/:
YLD_LIBRARY_PATH=/opt/sundials-2.4/lib:

Then save the file and source it so cantera finds the changes
->source .bash_profile

Cantera:
I downloaded version 266 from SVN

Open the preconfig script and change python to FULL install
I also added the path to Sundials
/opt/sundials-2.4/
(Assuming you used the same path as I did)

When you run the preconfig script make sure it finds the sundials
installation. It comes in the first 20 or 30 lines of the output
If the script do not find Sundials - check the paths.

If the preconfig works
make
sudo make install

Then edit your .bash_profile file again.
I had some issues so I added all the paths in my PYTHONPATH:
Here is my version:

PYTHONPATH=/opt/local/Library/Frameworks/Python.framework/Versions/
Current/:/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/:/opt/local/Library/Frameworks/
Python.framework/Versions/2.6/lib/python2.6/site-packages/Cantera:/opt/
local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/
site-packages/MixMaster:/opt/local/Library/Frameworks/Python.framework/
Versions/Current/bin:/opt/local/bin/python:/Applications/Cantera/:/
Applications/Cantera/bin:

Then add the config script for cantera to the .bash_profiel
Add the line:
source setup_cantera

close the file and

source .bash_profile


Now it should work.



Manuel

unread,
Dec 7, 2009, 4:23:50 AM12/7/09
to Cantera User's Group
Hi,

have you been able to run this Installation also from MATLAB ? On my
MBP Matlab crashes if i try to run ctmethods.mexmaci ...

regards!

Manuel

On Nov 25, 1:26 pm, Daniel <daniel_he...@yahoo.se> wrote:
> After struggling to install Cantera withMatlaband python I finally
> otherwisehttp://wiki.python.org/moin/TkInter
>
> Then you need to install numpy, numarray and numeric.
> You can find this from Macports as well.
>
> You might as well install graphviz as well from macports.
>
> Finaly I also installed matplotlib since that is used by the reactor
> example:http://matplotlib.sourceforge.net/
>
> Sundials:
> Download the version 2.4.0
> I tested with version 2.3 and I got some strange errors... Not sure
> what it was
>
> https://computation.llnl.gov/casc/sundials/main.html
>
> To install you do the following:
>
> cd sundials
> mkdir BUILD
> cd BUILD
> ../configure --prefix=path_to_install --enable-examples CC=gcc
> F77=gfortran --with-cflags='-g3 -O2  -fPIC' --with-fflags='-g3 -O0
> -fPIC' --disable-mpi
> (The path_to_install can be e.g. /opt/sundials-2.4/)
> make
> make install
>
> (I edited the version of this info from this page:)
> (ref:http://groups.google.com/group/cantera-users/browse_thread/thread/018...)

Daniel

unread,
Dec 7, 2009, 1:09:16 PM12/7/09
to Cantera User's Group
Hi,
Yes with Matlab2008b

I pref. Python so I have not done any work with Matlab and Cantera

I tested the demos and they all work

See if you can you isolate it to anything?

Daniel

Manuel Landstorfer

unread,
Dec 7, 2009, 3:44:10 PM12/7/09
to canter...@googlegroups.com
Hi,

thanks for your fast reply.

I was able to build the Matlab Toolbox in 64 Bit on Mac OS 10.6, and it's working.
Maybe that's interesting for other users too.

Regards,

Manuel
> --
>
> You received this message because you are subscribed to the Google Groups "Cantera User's Group" group.
> To post to this group, send email to canter...@googlegroups.com.
> To unsubscribe from this group, send email to cantera-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cantera-users?hl=en.
>
>

--
-------------------------------------------------------------------------

http://www.monde-diplomatique.de/

Daniel

unread,
Dec 8, 2009, 4:07:06 AM12/8/09
to Cantera User's Group
Good news.

Can you tell us some more info on the environment you used since my
notes is based on the 32 bit system OSX 10.5.8


Daniel

On Dec 7, 9:44 pm, Manuel Landstorfer <manuel.landstor...@gmail.com>
wrote:
> > For more options, visit this group athttp://groups.google.com/group/cantera-users?hl=en.
>
> --
> -------------------------------------------------------------------------
>
> http://www.monde-diplomatique.de/

Daniel

unread,
Dec 9, 2009, 7:44:14 AM12/9/09
to Cantera User's Group
MacOSX users
For F2c and g77 install:
Also look at this:
http://hpc.sourceforge.net/

Daniel

On Nov 25, 1:26 pm, Daniel <daniel_he...@yahoo.se> wrote:
> otherwisehttp://wiki.python.org/moin/TkInter
>
> Then you need to install numpy, numarray and numeric.
> You can find this from Macports as well.
>
> You might as well install graphviz as well from macports.
>
> Finaly I also installed matplotlib since that is used by the reactor
> example:http://matplotlib.sourceforge.net/
>
> Sundials:
> Download the version 2.4.0
> I tested with version 2.3 and I got some strange errors... Not sure
> what it was
>
> https://computation.llnl.gov/casc/sundials/main.html
>
> To install you do the following:
>
> cd sundials
> mkdir BUILD
> cd BUILD
> ../configure --prefix=path_to_install --enable-examples CC=gcc
> F77=gfortran --with-cflags='-g3 -O2  -fPIC' --with-fflags='-g3 -O0
> -fPIC' --disable-mpi
> (The path_to_install can be e.g. /opt/sundials-2.4/)
> make
> make install
>
> (I edited the version of this info from this page:)
> (ref:http://groups.google.com/group/cantera-users/browse_thread/thread/018...)
Reply all
Reply to author
Forward
0 new messages