From charlesreid1

Revision as of 19:24, 12 May 2011 by Admin (talk | contribs)

The following is my Cantera preconfig file for Mac OS X Leopard (10.5) and Cantera 1.8.0.

<syntaxhighlight lang="bash">

  1. !/bin/sh
  2. Cantera Configuration File
  3. Edit this file to control how Cantera is built. Parameters can be set
  4. here, or alternatively environment variables may be set before calling
  5. this script.
  6. The default configuration uses GNU compilers (gcc/g++/g77) and
  7. builds as much of Cantera and its language interfaces as it can
  8. (e.g. if MATLAB is installed on your system, the MATLAB toolbox
  9. will be built automatically, otherwise it will be skipped. On linux
  10. or Mac OS X, this default configuration should work, and most
  11. likely you don't need to edit this file at all - just run it.
  12. NOTE: if you DO make changes to this file, save it with another name
  13. so that it will not be overwritten if you update the source
  14. distribution.
  1. Set CANTERA_CONFIG_PREFIX to the directory where you want Cantera
  2. installed into. The default is /usr/local/Cantera
  3. If you define this to be <prefix>, then instead of running this
  4. script as ./preconfig --prefix=<prefix> you can just run it as
  5. ./preconfig.

CANTERA_CONFIG_PREFIX=${CANTERA_CONFIG_PREFIX:="/Users/charles/pkg/cantera/1.8.0"}

  1. ----------------------------------------------------------------------
  2. Language Interfaces
  3. ----------------------------------------------------------------------
  4. Cantera has several programming language interfaces. Select the ones
  5. you want to build. The default is to try to build all language
  6. interfaces.
  7. ----------------- Python --------------------------------------------
  8. In addition to being one of the supported language interfaces,
  9. Python is used internally by Cantera, both in the build process and
  10. at run time (to process .cti input files). Therefore, you generally
  11. need to have Python on your system; if you don't, first install it
  12. from http://www.python.org before proceeding with the installation
  13. of Cantera.
  14. If you plan to work in Python, or you want to use the graphical
  15. MixMaster application, then you need the full Cantera Python
  16. Package. If, on the other hand, you will only use Cantera from some
  17. other language (e.g. MATLAB or Fortran 90/95) and only need Python
  18. to process .cti files, then you only need a minimal subset of the
  19. package (actually, only one file).
  1. Set PYTHON_PACKAGE to one of these four strings:
  2. full install everything needed to use Cantera from Python
  3. minimal install only enough to process .cti files
  4. none Don't install or run any Python scripts during the
  5. build process
  6. default try to do a full installation, but fall back to a minimal
  7. one in case of errors

PYTHON_PACKAGE=${PYTHON_PACKAGE:="full"}

  1. Cantera needs to know where to find the Python interpreter. If
  2. PYTHON_CMD is set to "default", then the configuration process will
  3. look for the Python Interpreter somewhere on your PATH, either as
  4. 'python2' or as 'python'. If it is not on the PATH, or has a
  5. different name, set this to the full path to the Python interpreter.

PYTHON_CMD=${PYTHON_CMD:="/Library/Frameworks/Python.framework/Versions/2.6/bin/python"}


  1. The Cantera Python interface can be built with either the numarray
  2. numeric, or numpy packages. Set this to "y" to use Numeric.

USE_NUMERIC=${USE_NUMERIC:="n"}

  1. USE_NUMARRAY=${USE_NUMARRAY:="n"}
  1. The Cantera Python interface can be built with either the numarray
  2. or Numeric packages. Set this to "y" to use numpy, or 'n'
  3. to use numarray. set USE_NUMERIC to 'n' also if you want to use numarray.
  4. Using numpy is preferred, and is the supported option going forwards.

USE_NUMPY=${USE_NUMPY:="y"}

  1. If numpy was installed using the --home option, set this to the
  2. home directory for numpy. This will be needed for all numpy installations
  3. that don't put the include files into python's native include directory.
  1. NOTE: modified because Cantera tacks "/include/python" onto the end of NUMPY_HOME,
  2. which means the compiler doesn't point to include files in the correct directory

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

  1. If numarray was installed using the --home option, set this to the
  2. home directory for numarray.
  3. NUMARRAY_HOME=${NUMARRAY_HOME:="/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/numarray"}


  1. If you want to install the Cantera Python package somewhere other
  2. than the default 'site-packages' directory within the Python library
  3. directory, then set this to the desired directory. This is useful when
  4. you do not have write access to the Python library directory.
  5. CANTERA_PYTHON_HOME=${CANTERA_PYTHON_HOME:="$HOME/python_modules"}
  1. Set this to 'y' when site packages must be put in system directories
  2. but Cantera tutorials must be put in user space. An alternative to
  3. doing this is to keep this setting on "n" . Then everything is
  4. put into the user space by running this script
  5. with the 'prefix' option. The environment variable PYTHONPATH
  6. may then be set to tell Python where to find the Cantera package.

SET_PYTHON_SITE_PACKAGE_TOPDIR=${SET_PYTHON_SITE_PACKAGE_TOPDIR:="n"}

  1. If the SET_PYTHON_SITE_PACKAGE_TOPDIR is set to y, the entry below
  2. sets the location where the Cantera site package is installed.

PYTHON_SITE_PACKAGE_TOPDIR=${PYTHON_SITE_PACKAGE_TOPDIR:="/usr/local"}

  1. ----------- MATLAB --------------------------------------------------
  1. This variable controls whether the MATLAB toolbox will be built. It
  2. should be set to one of these strings:
  3. "default" the 'configure' script will try to build a simple
  4. MATLAB MEX file. If this succeeds, BUILD_MATLAB_TOOLBOX
  5. will be set to "y", otherwise it will be set to "n".
  6. "y" build the MATLAB toolbox.
  7. "n" do not build the MATLAB toolbox, even if MATLAB is
  8. installed.
  9. Note that you may need to run 'mex -setup' within MATLAB to
  10. configure it for your C++ compiler before running this script.

BUILD_MATLAB_TOOLBOX=${BUILD_MATLAB_TOOLBOX:="n"}

  1. ----------- Fortran 90/95 --------------------------------------------------
  1. This variable controls whether the Fortran 90/95 interface will be
  2. built. It should be set to one of these strings:
  3. "default" The 'configure' script will attempt to compile a small
  4. Fortran 90/05 program; if this succeeds,
  5. BUILD_F90_INTERFACE will be set to "y", and otherwise to "n".
  6. "y" Build the Fortran 90/95 interface.
  7. "n" Do not build the Fortran 90/95 interface, even if a
  8. Fortran 90/95 compiler is installed.

BUILD_F90_INTERFACE=${BUILD_F90_INTERFACE:="no"}

  1. The Fortran 90/95 compiler. If set to "default", the script will
  2. look for a Fortran 90/95 compiler on your system by the name of
  3. "f95", "gfortran", or "g95".

F90=${F90:="gfortran"}

  1. Compiler option flags for the Fortran 90/95 compiler. If you are
  2. using the Absoft or the NAG compiler, additional options specific to
  3. these compilers will be added automatically, and you do not need to
  4. specify them here. Otherwise, add any required compiler-specific
  5. flags here.

F90FLAGS=${F90FLAGS:='-O3'}

  1. ---------------------------------------------------------------------
  2. Purify
  3. ---------------------------------------------------------------------
  1. Add entries here for compiling Cantera with Purify extensions
  2. This command is put in front of every compilation and linking
  3. step

PURIFY=${PURIFY:=""}

  1. ----------------------------------------------------------------------
  2. Customizations / Extensions
  3. ----------------------------------------------------------------------
  4. You can build your own libraries as part of the Cantera build process.
  5. This allows you to derive your own classes from those provided by
  6. Cantera and build them automatically along with the rest of Cantera.
  7. All you need to do is specify the directory where your source code is
  8. located. This capability is not yet fully functional, but should work
  9. for C++ applications.

USER_SRC_DIR="Cantera/user" # don't change this

  1. In some cases, extra printing has been put into the code to aid
  2. in debugging and verification. In order for the printing to occur
  3. an additional switch must be turned on. However, compilation
  4. of the printing is affected by the following DEBUG_MODE option.
  5. This is turned off here by default.

DEBUG_MODE=${DEBUG_MODE:='n'}

  1. ----------------------------------------------------------------------
  2. Kernel Configuration
  3. ----------------------------------------------------------------------
  1. If you are only planning to use a portion of Cantera, you may only
  2. need a stripped-down kernel. Set those features you want enabled to
  3. 'y', and set those you want to skip to 'n' (actually anything but
  4. 'y') or comment them out. Some features are dependent on others; for
  5. example, enabling 'CK' automatically enables KINETICS and THERMO.
  1. If you only need to use Cantera to evaluate thermodynamic, kinetic,
  2. and transport properties, it is sufficient to enable only KINETICS
  3. and TRANSPORT.
  1. Note: if you are building the full Python interface or the MATLAB
  2. interface, it is necessary to build the full kernel.
  1. thermodynamic properties

ENABLE_THERMO='y'

  1. optional phase types. These may not be needed by all users. Set them
  2. to 'n' to omit them from the kernel.

WITH_LATTICE_SOLID=${WITH_LATTICE_SOLID:="y"} WITH_METAL=${WITH_METAL:="y"} WITH_STOICH_SUBSTANCE=${WITH_STOICH_SUBSTANCE:="y"} WITH_SEMICONDUCTOR=${WITH_SEMICONDUCTOR:="y"} WITH_ADSORBATE=${WITH_ADSORBATE:="y"} WITH_SPECTRA=${WITH_SPECTRA:="y"}

  1. This flag enables the inclusion of accurate liquid/vapor equations
  2. of state for several fluids, including water, nitrogen, hydrogen,
  3. oxygen, methane, andd HFC-134a.

WITH_PURE_FLUIDS='y'

  1. This flag enables the inclusion of ideal solution capabilities

WITH_IDEAL_SOLUTIONS=${WITH_IDEAL_SOLUTIONS:="y"}

  1. Enable expanded electrochemistry capabilities, include thermo
  2. models for electrolyte solutions

WITH_ELECTROLYTES=${WITH_ELECTROLYTES:="y"}

  1. Enable generating phase models from PrIMe models. For more
  2. information about PrIME, see http://www.primekinetics.org
  3. WARNING: Support for PrIMe is experimental!

WITH_PRIME=${WITH_PRIME:="y"}

  1. Enable changing the 298K heats of formation directly
  2. via the C++ layer. To do this, modify the variable below
  3. to have a value of "y"

WITH_H298MODIFY_CAPABILITY=${WITH_H298MODIFY_CAPABILITY:="n"}

  1. if set to 'y', the ck2cti program that converts Chemkin input files
  2. to Cantera format will be built. If you don't use Chemkin format
  3. files, or if you run ck2cti on some other machine, you can set this to 'n'.

ENABLE_CK=${ENABLE_CK:='y'}

  1. Enable homogeneous kinetics

WITH_KINETICS='y'

  1. Enable heterogeneous kinetics (surface chemistry). This also enables
  2. charge transfer reactions for electrochemistry.

WITH_HETERO_KINETICS='y'

  1. Enable reaction path analysis

WITH_REACTION_PATHS='y'

  1. Enable vcs equilibrium package for nonideal phases

WITH_VCSNONIDEAL=${WITH_VCSNONIDEAL:="n"}

  1. transport properties

ENABLE_TRANSPORT='y'

  1. chemical equilibrium

ENABLE_EQUIL='y'

  1. stirred reactor models

ENABLE_REACTORS='y'

  1. One-dimensional flows

ENABLE_FLOW1D='y'

  1. ODE integrators and DAE solvers

ENABLE_SOLVERS='y'

  1. reaction path analysis

ENABLE_RXNPATH='y'

  1. two phase pure fluids

ENABLE_TPX='y'

  1. write HTMl log files. Some multiphase equilibrium procedures can
  2. write copious diagnostic log messages. Set this to anything but 'y'
  3. to remove this capability (results in slightly faster equilibrium
  4. calculations)

WITH_HTML_LOG_FILES='y'

  1. -----------------------------------------------------------------
  2. CVODE / CVODES
  3. -----------------------------------------------------------------
  4. Cantera uses the CVODE or CVODES ODE integrator to time-integrate
  5. reactor network ODE's and for various other purposes. An older
  6. version of CVODE comes with Cantera, but it is possible to use the
  7. latest version as well, which now supports sensitivity analysis
  8. (CVODES). CVODES is a part of the 'sundials' package from Lawrence
  9. Livermore National Laboratory. Sundials is not distributed with
  10. Cantera, but it is free software that may be downloaded and
  11. installed separately. If you leave USE_SUNDIALS = 'default', then it
  12. will be used if you have it, and if not the older CVODE will be
  13. used. Or set USE_SUNDIALS to 'y' or 'n' to force using it or not.
  14. Note that sensitivity analysis with Cantera requires use of
  15. sundials.
  16. See: http://www.llnl.gov/CASC/sundials

USE_SUNDIALS=${USE_SUNDIALS:='y'}

  1. This is where you installed sundials if you used the --prefix option
  2. when you configured sundials. If you didn't use the prefix option,
  3. then comment this line out.

SUNDIALS_HOME=${SUNDIALS_HOME:="/Users/charles/pkg/sundials-2.3.0"}


  1. It is recommended that you install the newest release of sundials
  2. (currently 2.3.0) before building Cantera. But if you want to use an
  3. older version, set SUNDIALS_VERSION to the version you have.
  4. Acceptable values are '2.2' and '2.3' only; anything else will cause
  5. Cantera to not use sundials.

SUNDIALS_VERSION=${SUNDIALS_VERSION:='2.3'}

  1. -----------------------------------------------------------------
  2. BLAS and LAPACK
  3. -----------------------------------------------------------------
  4. Cantera comes with Fortran (or c) versions of those parts of BLAS and
  5. LAPACK it requires. But performance may be better if you use a
  6. version of these libraries optimized for your machine hardware. If
  7. you want to use your own libraries, set BLAS_LAPACK_LIBS to the
  8. string that should be passed to the linker to link to these
  9. libraries, and set BLAS_LAPACK_DIR to the directory where these
  10. libraries are located. Otherwise, leave these lines commented out.
  11. BLAS_LAPACK_LIBS='-llapack -lblas'
  12. BLAS_LAPACK_LIBS'-llapack -lf77blas -lcblas -latlas'
  13. BLAS_LAPACK_DIR='/usr/lib'
  14. Note that on Mac OSX, BLAS and LAPACK from the built-in 'Accelerate'
  15. framework are used by default, and nothing needs to be specified
  16. here.
  17. The options below do not need to be set if you are using the default
  18. libraries.
  19. Set to 'lower' or 'upper', depending on whether the procedure names
  20. in the libraries are lowercase or uppercase. If you don't know, run
  21. 'nm' on the library file (e.g. 'nm libblas.a') Note that the these options
  22. apply to both the BLAS and LAPACK libraries.

LAPACK_NAMES='lower' LAPACK_FTN_TRAILING_UNDERSCORE='y'

  1. Currently this must be set to 'y'.

LAPACK_FTN_STRING_LEN_AT_END='y'


  1. ------------------------------------------------------------------
  2. C++ compiler options
  3. ------------------------------------------------------------------
  1. The number of bits to compile with, if different than the
  2. default on the computer

BITCOMPILE=${BITCOMPILE:=""}

  1. the C++ compiler to use.

CXX=${CXX:=g++}

  1. the C compiler to use. This is only used to compile CVODE and
  2. the Python extension module.

CC=${CC:=gcc}

  1. C++ compiler flags

CXXFLAGS=${CXXFLAGS:="-Wall"}

  1. the C++ flags required for linking. Uncomment if additional flags
  2. need to be passed to the linker.
  1. Ending libraries to tack onto the linking of all C++ programs

LCXX_END_LIBS=${LCXX_END_LIBS:="-lm"}

  1. The compiler flag to use to compile code that will be inserted into
  2. shared libraries.

PIC=${PIC:=""}

  1. the compiler option to create a shared library from object files

SHARED=${SHARED:="-dynamic"}

  1. -------------------------------------------------------------------
  2. Thread Safety
  3. -------------------------------------------------------------------
  1. Cantera can be built so that it is thread safe. Doing so requires
  2. using procedures from the boost library, so if you want thread
  3. safety then you need to get and install boost (http://www.boost.org)
  4. if you don't have it. This is turned off by default, in which case
  5. boost is not required to build Cantera.

BUILD_THREAD_SAFE=${BUILD_THREAD_SAFE:="n"}

  1. where boost header and library files may be found

BOOST_INC_DIR=${BOOST_INC_DIR:="/Users/charles/pkg/boost_1_44_0"} BOOST_LIB_DIR=${BOOST_LIB_DIR:="/Users/charles/pkg/boost_1_44_0/libs"}

  1. the boost thread library

BOOST_THREAD_LIB=${BOOST_THREAD_LIB:="boost_thread-mt-1_44"}

  1. -------------------------------------------------------------------
  2. External Procedures
  3. -------------------------------------------------------------------
  1. Cantera uses several external software packages, which are all in
  2. the 'ext' directory.. These options control how these packages are
  3. built.
  1. For external procedures written in Fortran 77, both the original F77
  2. source code and C souce code generated by the 'f2c' program are
  3. included. Set this to "y" if you want to build Cantera using the
  4. f2c-generated C sources instead of using the F77 sources in the ext
  5. directory.
  1. The default is to use the f2c code. Set this to "n" to never do
  2. this on any platform. Note, if set to "y", Cantera does not need a
  3. fortran compiler, and all fortran compiler parameters below are
  4. irrelevant.

BUILD_WITH_F2C=${BUILD_WITH_F2C:="y"}

  1. if you are building the external Fortran 77 procedures from the Fortran
  2. source code, enter the compiler here.

F77=${F77:=g77}

  1. Fortran 77 compiler flags. Note that the Fortran compiler flags must be set
  2. to produce object code compatible with the C/C++ compiler you are using.

FFLAGS=${FFLAGS:='-O3'}

  1. the additional Fortran flags required for linking, if any. Leave commented
  2. out if no additional flags are required.

LFORT_FLAGS="-L/usr/local/lib"

  1. ------------------------------------------------------
  2. Other Programs
  3. ------------------------------------------------------
  1. The command to create a static library.

ARCHIVE=${ARCHIVE:="ar ruv"} # linux

  1. ARCHIVE=${ARCHIVE:="libtool -static -o"} # Mac OSX (this is set automatically)
  2. ARCHIVE=${ARCHIVE:="CC -xar -o"} # Solaris using SUNspro compilers
  1. The command to run 'ranlib' if it is needed.

RANLIB=${RANLIB:="ranlib"}

  1. The command to run the 'make' utility. The Cantera Makefiles are
  2. compatible with the GNU make utility, so if your make utility
  3. doesn't work, try GNU make.

MAKE=${MAKE:=make}

  1. The command to run when "installing". This defaults now to the
  2. install-sh bourne shell script that comes with the autoconf package.
  3. It can be overridden here.

INSTALL_BIN=${INSTALL_BIN:=config/install-sh}

  1. The directory location of the graphviz program, dot. dot is used
  2. for creating the documentation, and for making reaction path
  3. diagrams. if "dot" is in your path, you can leave this unspecified.
  4. NOTE: MATLAB comes with a stripped-down version of 'dot'. If 'dot'
  5. is on your path, make sure it is not the MATLAB version!

GRAPHVIZDIR=${GRAPHVIZDIR:="/usr/local/bin/dot"}

  1. File extensions

CXX_EXT=${CXX_EXT:=cpp} F77_EXT=${F77_EXT:=f} F90_EXT=${F90_EXT:=f90}

  1. Default extension for executable binaries. The default for unix systems
  2. is the empty field. For windows systesms and cygwin, you should put
  3. ".exe" .

EXE_EXT=${EXE_EXT:=}


CT_SHARED_LIB=${CT_SHARED_LIB:=clib}

  1. The font to use in reaction path diagrams. This must be a font name
  2. recognized by the 'dot' program. On linux systems, this should be
  3. lowercase 'helvetica'.

RPFONT=${RPFONT:="Helvetica"}

  1. Don't change this.

CANTERA_VERSION=${CANTERA_VERSION:="1.8.0"}

  1. -----------------------------------------------------------------------
  2. ------------------- don't change anything below!! ---------------------
  3. -----------------------------------------------------------------------

export CANTERA_VERSION export USER_SRC_DIR export DEBUG_MODE export ARCHIVE export RANLIB export BITCOMPILE export BLAS_LAPACK_LIBS export BLAS_LAPACK_DIR export BUILD_WITH_F2C export BUILD_F90_INTERFACE export PYTHON_PACKAGE export BUILD_MATLAB_TOOLBOX export MATLAB_CMD export CT_SHARED_LIB export CXX export CXX_EXT export CXXFLAGS export CC export ENABLE_THERMO export WITH_KINETICS export WITH_HETERO_KINETICS export WITH_REACTION_PATHS export ENABLE_TRANSPORT export ENABLE_CK export ENABLE_EQUIL export ENABLE_REACTORS export ENABLE_SOLVERS export ENABLE_RXNPATH export ENABLE_TPX export ENABLE_FLOW1D export EXE_EXT export F77 export F77_EXT export F90 export F90_EXT export FFLAGS export F90FLAGS export INSTALL_BIN export LCXX_FLAGS export LCXX_END_LIBS export LFORT_FLAGS export LAPACK_NAMES export LAPACK_FTN_STRING_LEN_AT_END export LAPACK_FTN_TRAILING_UNDERSCORE export LIB_DIR export FORT_MODULE_DIRECTORY export FORT_MODULE_PATH_COMMAND export OBJ_EXT export PYTHON_CMD export SET_PYTHON_SITE_PACKAGE_DIR export PYTHON_SITE_PACKAGE_TOPDIR export PIC export SHARED export SOEXT export MAKE export GRAPHVIZDIR export RPFONT export FORTRAN_LIB_DIR export CANTERA_INSTALL_DIR export USE_NUMERIC export USE_NUMPY export NUMARRAY_HOME export NUMPY_HOME export CANTERA_PYTHON_HOME export USE_SUNDIALS export SUNDIALS_HOME export SUNDIALS_VERSION

export WITH_LATTICE_SOLID export WITH_METAL export WITH_SEMICONDUCTOR export WITH_ADSORBATE export WITH_SPECTRA export WITH_STOICH_SUBSTANCE export WITH_PURE_FLUIDS export WITH_IDEAL_SOLUTIONS export WITH_ELECTROLYTES export WITH_PRIME export WITH_H298MODIFY_CAPABILITY

export BUILD_THREAD_SAFE export BOOST_INC_DIR export BOOST_LIB_DIR export BOOST_THREAD_LIB

export WITH_HTML_LOG_FILES

export PURIFY

chmod -f +x ./configure chmod -f +x config/config.guess chmod -f +x config/config.sub

  1. chmod -f +x config/install-sh
  1. Decide whether to add a prefix variable to the configure line

if (test "x$CANTERA_CONFIG_PREFIX" = "x") then

  CCPREFIX=""

else

  CCPREFIX="--prefix="$CANTERA_CONFIG_PREFIX

fi

  1. run the configure command

./configure $CCPREFIX $1 $2 $3 $4

</source>