isolated Chemkin file support to building ck2cti

This commit is contained in:
Dave Goodwin 2003-12-12 16:11:30 +00:00
parent 9163cfbbd6
commit e109142249
11 changed files with 143 additions and 54 deletions

View file

@ -104,13 +104,13 @@ DEPENDS = $(EVERYTHING:.o=.d)
# these depend on Makefile to insure that they get rebuilt whenever
# 'configure' has been run since they were last compiled
misc.o: misc.cpp Makefile
echo '#define CANTERA_ROOT "@prefix@/cantera"' > ctdir.h
@CXX@ -c misc.cpp $(CXX_FLAGS)
#misc.o: misc.cpp Makefile
# echo '#define CANTERA_ROOT "@prefix@/cantera"' > ctdir.h
# @CXX@ -c misc.cpp $(CXX_FLAGS)
ct2ctml.o: ct2ctml.cpp Makefile
echo '#define PYTHON_EXE "@PYTHON_CMD@"' > pypath.h
@CXX@ -c ct2ctml.cpp $(CXX_FLAGS)
#ct2ctml.o: ct2ctml.cpp Makefile
# echo '#define PYTHON_EXE "@PYTHON_CMD@"' > pypath.h
# @CXX@ -c ct2ctml.cpp $(CXX_FLAGS)
.f.o:
@F77@ -c $< $(F77_FLAGS)

View file

@ -44,6 +44,9 @@ typedef int ftnlen; // Fortran hidden string length type
#define LAPACK_NAMES_LOWERCASE
#define LAPACK_FTN_TRAILING_UNDERSCORE
//--------- operating system --------------------------------------
// The configure script defines this if the operatiing system is Mac
// OS X, This used to add some Mac-specific directories to the default
// data file search path.
@ -53,14 +56,17 @@ typedef int ftnlen; // Fortran hidden string length type
//--------- Fonts for reaction path diagrams ----------------------
#define RXNPATH_FONT "Helvetica"
//--------- Cantera --------------
//--------------------- Python ------------------------------------
// used to run Python to process .cti files
#define PYTHON_EXE "/usr/bin/python"
//--------- CKReader -------------
//--------------------- Cantera -----------------------------------
//--------- CtLib ----------------
// used to find data files
#define CANTERA_ROOT "/usr/local/cantera"

View file

@ -22,9 +22,9 @@
#include "SpeciesThermoFactory.h"
#include "FalloffFactory.h"
#ifndef WIN32
#include "ctdir.h"
#endif
//#ifndef WIN32
//#include "ctdir.h"
//#endif
#include <fstream>
using namespace std;

View file

@ -8,34 +8,60 @@ other systems have it too. If yours does not, you can get it at
www.python.org.
Build Instructions
==================
====================================================================
Build Instructions
====================================================================
To build and install Cantera in /usr/local:
To build Cantera and install it in /usr/local:
./configure
make
make install
To do 'make install', you may need to be super-user, or may need to
preface 'make install' by 'sudo' ('sudo make install').
To build and install Cantera in a different directory:
Cantera applications will be put in /usr/local/bin, libraries will be
installed in a version-specific subdirectory of
/usr/local/lib/cantera, unix man pages will be installed under
/usr/local/man, C++ header files will be installed in
/usr/local/include/cantera, and various demos and data files will be
installed in subdirectories of /usr/local/cantera.
To install Cantera in a different directory:
./configure --prefix=/installation/dir
make
make install
Here '/installation/dir' should be replaced with the absolute path to
the installation directory.
the installation directory. For example, to install in your home directory:
./configure --prefix=$HOME
make
make install
In this case, subdirectories bin, lib, include, cantera will be
created within your home directory if they don't exist already, and
cantera will be installed into these directories.
To do 'make install', you may need to be super-user. On a Mac running
OS X, type 'sudo make install'
Configuring the Environment
---------------------------
Execute script 'cantera/setup_cantera' to configure the environment for Cantera:
source /usr/local/cantera/setup_cantera
The build process will create an initialization script 'cantera.rc'. Type
source /usr/local/cantera/cantera.rc
to set the environment for Cantera. Alternatively, copy cantera.rc to your
home directory as .cantera, and add the line
source .cantera
to your login script.
The Python Interface
@ -67,6 +93,7 @@ PYTHON_CMD Python interpreter to use with Cantera
MATLAB_CMD Matlab command (default: 'matlab')
Additional customization can be done by editing the configure script.
Additional customization can be done by editing the configure script
before running it.

View file

@ -1,10 +1,33 @@
Copyright (c) 2001-2003, California Institute of Technology
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the California Institute of Technology nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the California Institute of Technology nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -44,6 +44,9 @@ typedef int ftnlen; // Fortran hidden string length type
#define LAPACK_NAMES_LOWERCASE
#define LAPACK_FTN_TRAILING_UNDERSCORE
//--------- operating system --------------------------------------
// The configure script defines this if the operatiing system is Mac
// OS X, This used to add some Mac-specific directories to the default
// data file search path.
@ -53,14 +56,17 @@ typedef int ftnlen; // Fortran hidden string length type
//--------- Fonts for reaction path diagrams ----------------------
#define RXNPATH_FONT "Helvetica"
//--------- Cantera --------------
//--------------------- Python ------------------------------------
// used to run Python to process .cti files
#define PYTHON_EXE "/usr/bin/python"
//--------- CKReader -------------
//--------------------- Cantera -----------------------------------
//--------- CtLib ----------------
// used to find data files
#define CANTERA_ROOT "/usr/local/cantera"

View file

@ -43,6 +43,9 @@ typedef int ftnlen; // Fortran hidden string length type
#define LAPACK_NAMES_LOWERCASE
#define LAPACK_FTN_TRAILING_UNDERSCORE
//--------- operating system --------------------------------------
// The configure script defines this if the operatiing system is Mac
// OS X, This used to add some Mac-specific directories to the default
// data file search path.
@ -52,14 +55,17 @@ typedef int ftnlen; // Fortran hidden string length type
//--------- Fonts for reaction path diagrams ----------------------
#undef RXNPATH_FONT
//--------- Cantera --------------
//--------------------- Python ------------------------------------
// used to run Python to process .cti files
#undef PYTHON_EXE
//--------- CKReader -------------
//--------------------- Cantera -----------------------------------
//--------- CtLib ----------------
// used to find data files
#undef CANTERA_ROOT

21
config/configure vendored
View file

@ -1303,7 +1303,7 @@ homedir=${HOME}
if test -z $local_inst; then
ct_libdir=${prefix}/lib/cantera-${ctversion}
ct_libdir=${prefix}/lib/cantera/${ctversion}
ct_incdir=${prefix}/include/cantera
ct_incroot=${prefix}/include
ct_bindir=${prefix}/bin
@ -1315,7 +1315,7 @@ ct_docdir=${prefix}/cantera/${ctversion}/doc
ct_dir=${prefix}/cantera/${ctversion}
ct_mandir=${prefix}/share/man
else
ct_libdir=${prefix}/lib/cantera-${ctversion}
ct_libdir=${prefix}/lib/cantera/${ctversion}
ct_incdir=${prefix}/include/cantera
ct_incroot=${prefix}/include
ct_bindir=${prefix}/bin
@ -1460,6 +1460,10 @@ cat >>confdefs.h <<_ACEOF
#define RXNPATH_FONT "$RPFONT"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define CANTERA_ROOT "$prefix/cantera"
_ACEOF
if test -z "$MAKE"; then MAKE='make'; fi
@ -1512,7 +1516,8 @@ if test "$ENABLE_THERMO" = "y"; then KERNEL=$KERNEL' 'thermo; fi
if test "$ENABLE_KINETICS" = "y"; then KERNEL=$KERNEL' 'kinetics; fi
if test "$ENABLE_CK" = "y"
then KERNEL=$KERNEL' 'ck
then
#KERNEL=$KERNEL' 'ck
BUILD_CK=1
NEED_CKREADER=1
fi
@ -1710,6 +1715,10 @@ else
exit 1
fi
cat >>confdefs.h <<_ACEOF
#define PYTHON_EXE "$PYTHON_CMD"
_ACEOF
#
# Matlab Interface
@ -3094,7 +3103,7 @@ fi
# Provide some information about the compiler.
echo "$as_me:3097:" \
echo "$as_me:3106:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@ -3271,7 +3280,7 @@ _ACEOF
# flags.
ac_save_FFLAGS=$FFLAGS
FFLAGS="$FFLAGS $ac_verb"
(eval echo $as_me:3274: \"$ac_link\") >&5
(eval echo $as_me:3283: \"$ac_link\") >&5
ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
echo "$ac_f77_v_output" >&5
FFLAGS=$ac_save_FFLAGS
@ -3351,7 +3360,7 @@ _ACEOF
# flags.
ac_save_FFLAGS=$FFLAGS
FFLAGS="$FFLAGS $ac_cv_prog_f77_v"
(eval echo $as_me:3354: \"$ac_link\") >&5
(eval echo $as_me:3363: \"$ac_link\") >&5
ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
echo "$ac_f77_v_output" >&5
FFLAGS=$ac_save_FFLAGS

View file

@ -59,7 +59,7 @@ homedir=${HOME}
AC_SUBST(homedir)
if test -z $local_inst; then
ct_libdir=${prefix}/lib/cantera-${ctversion}
ct_libdir=${prefix}/lib/cantera/${ctversion}
ct_incdir=${prefix}/include/cantera
ct_incroot=${prefix}/include
ct_bindir=${prefix}/bin
@ -71,7 +71,7 @@ ct_docdir=${prefix}/cantera/${ctversion}/doc
ct_dir=${prefix}/cantera/${ctversion}
ct_mandir=${prefix}/share/man
else
ct_libdir=${prefix}/lib/cantera-${ctversion}
ct_libdir=${prefix}/lib/cantera/${ctversion}
ct_incdir=${prefix}/include/cantera
ct_incroot=${prefix}/include
ct_bindir=${prefix}/bin
@ -129,6 +129,7 @@ AC_DEFINE(DARWIN)
fi
AC_DEFINE_UNQUOTED(RXNPATH_FONT,"$RPFONT")
AC_DEFINE_UNQUOTED(CANTERA_ROOT,"$prefix/cantera")
if test -z "$MAKE"; then MAKE='make'; fi
AC_SUBST(MAKE)
@ -181,7 +182,8 @@ if test "$ENABLE_THERMO" = "y"; then KERNEL=$KERNEL' 'thermo; fi
if test "$ENABLE_KINETICS" = "y"; then KERNEL=$KERNEL' 'kinetics; fi
if test "$ENABLE_CK" = "y"
then KERNEL=$KERNEL' 'ck
then
#KERNEL=$KERNEL' 'ck
BUILD_CK=1
NEED_CKREADER=1
fi
@ -335,6 +337,7 @@ else
exit 1
fi
AC_SUBST(BUILD_PYTHON)
AC_DEFINE_UNQUOTED(PYTHON_EXE,"$PYTHON_CMD")
#
# Matlab Interface

4
configure vendored
View file

@ -94,7 +94,7 @@ USER_SRC_DIR="Cantera/user"
ENABLE_THERMO='y'
# enable importing Chemkin input files
ENABLE_CK='y'
ENABLE_CK='n'
# homogeneous and heterogeneous kinetics
ENABLE_KINETICS='y'
@ -192,7 +192,7 @@ F77=${F77:=g77}
F90=${F90:=f90}
# Fortran compiler flags
FFLAGS=${FFLAGS:='-O2 -Wall'}
FFLAGS=${FFLAGS:='-O2'}
# the additional Fortran flags required for linking, if any
#LFORT_FLAGS="-lF77 -lFI77"

View file

@ -9,7 +9,7 @@ LCXX_FLAGS = -L$(LIBDIR) @CXXFLAGS@
LOCAL_LIBS = -lcantera @math_libs@ @LAPACK_LIBRARY@ @BLAS_LIBRARY@ -lctcxx
LCXX_END_LIBS = @LCXX_END_LIBS@
OBJS = ck2cti.o
#OBJS = ck2cti.o
DEPENDS = $(OBJS:.o=.d)
@ -17,18 +17,27 @@ CONVLIB_DEP = @buildlib@/libconverters.a
CANTERALIB_DEP = @buildlib@/libcantera.a \
@buildlib@/libctcxx.a
exes = $(BINDIR)/cti2ctml
ifeq ($(build_ck),1)
exes = $(BINDIR)/cti2ctml $(BINDIR)/ck2cti
endif
.cpp.o:
@CXX@ -c $< @DEFS@ $(INCDIR) @CXXFLAGS@ $(CXX_FLAGS)
all: $(BINDIR)/cti2ctml $(BINDIR)/ck2cti
all: $(exes)
$(BINDIR)/ck2cti: ck2cti.o $(CONVLIB_DEP) $(CANTERALIB_DEP)
@CXX@ -o $(BINDIR)/ck2cti ck2cti.o $(LCXX_FLAGS) -lconverters $(LOCAL_LIBS) \
$(LCXX_END_LIBS)
$(BINDIR)/cti2ctml: cti2ctml.o $(CONVLIB_DEP) $(CANTERALIB_DEP)
@CXX@ -o $(BINDIR)/cti2ctml cti2ctml.o $(LCXX_FLAGS) -lconverters $(LOCAL_LIBS) \
$(BINDIR)/cti2ctml: cti2ctml.o $(CANTERALIB_DEP)
@CXX@ -o $(BINDIR)/cti2ctml cti2ctml.o $(LCXX_FLAGS) $(LOCAL_LIBS) \
$(LCXX_END_LIBS)
$(CONVLIB_DEP):
cd ../../Cantera/src/converters; make
clean:
$(RM) *.o *.*~