From efdfdf83cdcda5dd5620e0bd5d09cf917208fe6d Mon Sep 17 00:00:00 2001 From: Dave Goodwin Date: Wed, 14 Jul 2004 11:24:12 +0000 Subject: [PATCH] *** empty log message *** --- Cantera/cxx/demos/Makefile.in | 2 +- Cantera/cxx/src/Makefile.in | 3 -- Cantera/matlab/setup_matlab.py.in | 4 +-- Cantera/matlab/setup_winmatlab.py | 6 ++-- Cantera/matlab/setup_winmatlab.py.in | 15 ++++++++- Cantera/python/ctml_writer.py | 17 ++++++++-- Cantera/python/setup.py.in | 22 ++++++++---- Cantera/src/Makefile.in | 2 +- Cantera/src/converters/CKParser.cpp | 18 ++++++++-- config/configure | 50 ++++++++++++++++------------ config/configure.in | 37 +++++++++++--------- configure | 24 +++++++------ examples/cxx/Makefile.in | 2 +- tools/src/Makefile.in | 4 +-- 14 files changed, 133 insertions(+), 73 deletions(-) diff --git a/Cantera/cxx/demos/Makefile.in b/Cantera/cxx/demos/Makefile.in index c60d3c7a8..39cce3259 100644 --- a/Cantera/cxx/demos/Makefile.in +++ b/Cantera/cxx/demos/Makefile.in @@ -45,7 +45,7 @@ CANTERA_LIBS = CANTERA_INCDIR=@ctroot@/build/include # flags passed to the C++ compiler/linker for the linking step -LCXX_FLAGS = -L$(CANTERA_LIBDIR) @CXXFLAGS@ +LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIR@ @CXXFLAGS@ # how to compile C++ source files to object files .@CXX_EXT@.@OBJ_EXT@: diff --git a/Cantera/cxx/src/Makefile.in b/Cantera/cxx/src/Makefile.in index 2019f6b88..d5f4bf14d 100644 --- a/Cantera/cxx/src/Makefile.in +++ b/Cantera/cxx/src/Makefile.in @@ -26,9 +26,6 @@ CANTERA_INCDIR=../../src CXX_INCLUDES = -I$(CANTERA_INCDIR) -# flags passed to the C++ compiler/linker for the linking step -LCXX_FLAGS = -L$(CANTERA_LIBDIR) @CXXFLAGS@ - # how to compile C++ source files to object files .@CXX_EXT@.@OBJ_EXT@: $(CXX) -c $< $(CXX_INCLUDES) $(CXX_FLAGS) diff --git a/Cantera/matlab/setup_matlab.py.in b/Cantera/matlab/setup_matlab.py.in index 5f950e3bf..cafd37985 100644 --- a/Cantera/matlab/setup_matlab.py.in +++ b/Cantera/matlab/setup_matlab.py.in @@ -2,7 +2,7 @@ import sys bindir = '@ct_bindir@' -libdir = '@buildlib@' +libdir = '-L @buildlib@ @LOCAL_LIB_DIRS@' incdir = '@buildinc@' libs = '-lclib @LOCAL_LIBS@ @LIBS@ @FLIBS@' @@ -21,7 +21,7 @@ mex private/ctmethods.cpp private/ctfunctions.cpp ... private/wallmethods.cpp private/flowdevicemethods.cpp ... private/funcmethods.cpp ... private/onedimmethods.cpp private/surfmethods.cpp private/write.cpp ... -"""+'-I'+incdir+' -L'+libdir+' '+libs+'\n'+"""disp('done.'); +"""+'-I'+incdir+' '+libdir+' '+libs+'\n'+"""disp('done.'); """) fb.close() diff --git a/Cantera/matlab/setup_winmatlab.py b/Cantera/matlab/setup_winmatlab.py index 5735e95e0..5026808ec 100644 --- a/Cantera/matlab/setup_winmatlab.py +++ b/Cantera/matlab/setup_winmatlab.py @@ -1,9 +1,9 @@ import sys -bindir = '/home/goodwin/ct154/bin' -libdir = '/home/goodwin/dv/sf/cantera/build/lib/i686-pc-linux-gnu' -incdir = '/home/goodwin/dv/sf/cantera/build/include' +bindir = '/usr/local/bin' +libdir = '/Users/dgg/dv/sf/cantera/build/lib/powerpc-apple-darwin7.4.0' +incdir = '/Users/dgg/dv/sf/cantera/build/include' dflibdir = '' libs = ['clib', 'oneD', 'zeroD', 'transport', 'cantera', 'recipes', diff --git a/Cantera/matlab/setup_winmatlab.py.in b/Cantera/matlab/setup_winmatlab.py.in index 7b975ed82..baf4c0f3b 100644 --- a/Cantera/matlab/setup_winmatlab.py.in +++ b/Cantera/matlab/setup_winmatlab.py.in @@ -6,8 +6,14 @@ libdir = '@buildlib@' incdir = '@buildinc@' dflibdir = '@CVF_LIBDIR@' +bllibstr = "@BLAS_LAPACK_LIBS@" +bllibs = bllibstr.replace('-l',' ') +bllist = bllibs.split() + +bldir = "@BLAS_LAPACK_DIR@" + libs = ['clib', 'oneD', 'zeroD', 'transport', 'cantera', 'recipes', - 'cvode', 'ctlapack', 'ctmath', 'ctblas', 'tpx'] + 'cvode', 'ctmath', 'tpx'] f = open('setup.m','w') f.write('cd cantera\nbuild_cantera\nexit\n') @@ -32,6 +38,13 @@ fb.write(s) fb.write(' "'+dflibdir+'/dformd.lib" ...\n') fb.write(' "'+dflibdir+'/dfconsol.lib" ...\n') fb.write(' "'+dflibdir+'/dfport.lib" \n') + +if bllist: + s = '' + for lib in bllist: + s += ' '+bldir+'/'+lib+'.lib ...\n' + fb.write(s) + fb.close() fp = open('cantera/ctbin.m','w') diff --git a/Cantera/python/ctml_writer.py b/Cantera/python/ctml_writer.py index 024775539..fb8101daa 100644 --- a/Cantera/python/ctml_writer.py +++ b/Cantera/python/ctml_writer.py @@ -15,6 +15,8 @@ import string class CTI_Error: + """Exception raised if an error is encountered while + parsing the input file.""" def __init__(self, msg): print '\n\n***** Error parsing input file *****\n\n' print msg @@ -53,8 +55,10 @@ class XMLnode: called to create the root element. Method addChild calls this constructor to create the new child node.""" - # convert value to string self._name = name + + # convert 'value' to a string if it is not already, and + # strip leading whitespace if type(value) <> types.StringType: self._value = string.lstrip(`value`) else: @@ -69,7 +73,6 @@ class XMLnode: """The tag name of the node.""" return self._name - def nChildren(self): """Number of child elements.""" return len(self._children) @@ -77,7 +80,12 @@ class XMLnode: def addChild(self, name, value=""): """Add a child with tag 'name', and set its value if the value parameter is supplied.""" + + # create a new node for the child c = XMLnode(name = name, value = value) + + # add it to the list of children, and to the dictionary + # of children self._children.append(c) self._childmap[name] = c return c @@ -1508,7 +1516,10 @@ validate() # $Revision$ # $Date$ # $Log$ -# Revision 1.3 2004-06-09 01:02:31 dggoodwin +# Revision 1.4 2004-07-14 11:24:13 dggoodwin +# *** empty log message *** +# +# Revision 1.3 2004/06/09 01:02:31 dggoodwin # *** empty log message *** # # Revision 1.2 2004/06/04 06:05:31 dggoodwin diff --git a/Cantera/python/setup.py.in b/Cantera/python/setup.py.in index bcfd63bfb..334162c73 100644 --- a/Cantera/python/setup.py.in +++ b/Cantera/python/setup.py.in @@ -3,15 +3,24 @@ try: from distutils.core import setup, Extension except: print 'could not import distutils. Will try anyway...' - #sys.exit(0) libs = [] platform = sys.platform +bllibstr = "@BLAS_LAPACK_LIBS@" +bllibs = bllibstr.replace('-l',' ') +bllist = bllibs.split() + +bldirstr = "@LOCAL_LIB_DIRS@" +bldirs = bldirstr.replace('-L',' ') +dirlist = bldirs.split() +libdir = ['@buildlib@'] +for d in dirlist: + libdir.append(d) + if platform == "win32": libs = ["clib", "zeroD","oneD","transport", - "cantera","recipes","ctlapack", - "ctblas", "ctmath", "cvode", "tpx"] + "cantera","recipes"] + bllist + ["ctmath", "cvode", "tpx"] else: # The library 'g2c' is needed if the g77 Fortran compiler is @@ -20,8 +29,9 @@ else: # compiler is used, add the appropriate libraries here. libs = ["clib", "zeroD","oneD","transport", - "cantera","recipes","ctlapack", - "ctblas", "ctmath", "cvode", "tpx", "stdc++", "g2c", "m"] + "cantera","recipes"] + bllist + ["ctmath", "cvode", "tpx", + "stdc++", "g2c", "m"] + if @BUILD_PYTHON@ == 2: @@ -40,7 +50,7 @@ if @BUILD_PYTHON@ == 2: ["src/pycantera.cpp", "src/writelog.cpp"], include_dirs=["../../build/include", "src", "../clib/src"], - library_dirs = ["@buildlib@"], + library_dirs = libdir, libraries = libs) ], ) diff --git a/Cantera/src/Makefile.in b/Cantera/src/Makefile.in index 50fe913e8..d56f7fff0 100755 --- a/Cantera/src/Makefile.in +++ b/Cantera/src/Makefile.in @@ -55,7 +55,7 @@ EVERYTHING = $(KINETICS) $(HETEROKIN) $(ELECTROCHEM) $(EQUIL) $(CK) \ $(TRANSPORT) $(REACTOR) $(RPATH) $(SOLVERS) $(FLOW1D) -PCH = ct_defs.h.gch utilities.h.gch ThermoPhase.h.gch Kinetic.h.gch +PCH = ct_defs.h.gch utilities.h.gch ThermoPhase.h.gch Kinetics.h.gch all: config.h $(PCH) @KERNEL@ lib diff --git a/Cantera/src/converters/CKParser.cpp b/Cantera/src/converters/CKParser.cpp index aa247d1dc..e9b5ba0bd 100755 --- a/Cantera/src/converters/CKParser.cpp +++ b/Cantera/src/converters/CKParser.cpp @@ -6,7 +6,10 @@ // Copyright 2001 California Institute of Technology // // $Log$ -// Revision 1.8 2004-07-02 17:34:13 hkmoffa +// Revision 1.9 2004-07-14 11:24:13 dggoodwin +// *** empty log message *** +// +// Revision 1.8 2004/07/02 17:34:13 hkmoffa // Eliminated warnings due to signed and unsigned comparisons. // // Revision 1.7 2004/07/02 17:27:01 hkmoffa @@ -301,13 +304,19 @@ namespace ckr { comment = ""; string line; - //getline(f, line, dm); + line = ""; char ch; while (1 > 0) { f.get(ch); if (!f || f.eof()) break; - if (ch == '\n' || ch == char10) break; + + // convert tabs to spaces + if (ch == '\t') ch = ' '; + + // if an end-of-line character is seen, then break. + // Check for all common end-of-line characters. + if (ch == '\n' || ch == char10 || ch == char13) break; if (isprint(ch)) line += ch; } string::size_type icom = line.find(commentChar); @@ -986,6 +995,7 @@ next: else if ((mloc = sleft.find("+M"), mloc >= 0) || (mloc = sleft.find("+m"), mloc >= 0)) { + if (static_cast(mloc) == static_cast(sleft.size()) - 2) { rxn.isThreeBodyRxn = true; @@ -1060,8 +1070,10 @@ next: else if ((mloc = sright.find("+M"), mloc >= 0) || (mloc = sright.find("+m"), mloc >= 0)) { + if (static_cast(mloc) == static_cast(sright.size()) - 2) { + if (rxn.type == Falloff) throw CK_SyntaxError(*m_log, "mismatched +M or (+M)", m_line); diff --git a/config/configure b/config/configure index f9b127236..662e3b7c7 100755 --- a/config/configure +++ b/config/configure @@ -271,7 +271,7 @@ PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="Cantera.README" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CVF_LIBDIR local_inst local_python_inst python_prefix ctversion homedir ct_libdir ct_incdir ct_incroot ct_bindir ct_datadir ct_demodir ct_templdir ct_mandir ct_tutdir ct_docdir ct_dir CANTERA_LIBDIR CANTERA_INCDIR CT_TOOLS_BIN CANTERA_BINDIR CANTERA_EXAMPLES_DIR CANTERA_DATADIR build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os username ctroot buildinc buildlib buildbin MAKE ARCHIVE DO_RANLIB RANLIB SOEXT SHARED PIC LCXX_FLAGS LCXX_END_LIBS USERDIR INCL_USER_CODE KERNEL BUILD_CK LIB_DIR LAPACK_LIBRARY build_lapack BLAS_LIBRARY build_blas LOCAL_LIBS CANTERA_PARTICLES_DIR BUILD_PARTICLES CT_SHARED_LIB BUILD_F90 PYTHON_CMD WIN_PYTHON_CMD BUILD_PYTHON MATLAB_CMD BUILD_MATLAB BUILD_CLIB export_name INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC F77 FFLAGS ac_ct_F77 FLIBS precompile_headers CXX_DEPENDS OS_IS_DARWIN OS_IS_WIN OS_IS_CYGWIN SHARED_CTLIB mex_ext F77_EXT CXX_EXT OBJ_EXT EXE_EXT local_math_libs math_libs SO LDSHARED LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CVF_LIBDIR local_inst local_python_inst python_prefix ctversion homedir ct_libdir ct_incdir ct_incroot ct_bindir ct_datadir ct_demodir ct_templdir ct_mandir ct_tutdir ct_docdir ct_dir CANTERA_LIBDIR CANTERA_INCDIR CT_TOOLS_BIN CANTERA_BINDIR CANTERA_EXAMPLES_DIR CANTERA_DATADIR build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os username ctroot buildinc buildlib buildbin MAKE ARCHIVE DO_RANLIB RANLIB SOEXT SHARED PIC LCXX_FLAGS LCXX_END_LIBS USERDIR INCL_USER_CODE KERNEL BUILD_CK LIB_DIR build_lapack build_blas BLAS_LAPACK_LIBS BLAS_LAPACK_DIR LOCAL_LIB_DIRS LOCAL_LIBS CANTERA_PARTICLES_DIR BUILD_PARTICLES CT_SHARED_LIB BUILD_F90 PYTHON_CMD WIN_PYTHON_CMD BUILD_PYTHON MATLAB_CMD BUILD_MATLAB BUILD_CLIB export_name INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC F77 FFLAGS ac_ct_F77 FLIBS precompile_headers CXX_DEPENDS OS_IS_DARWIN OS_IS_WIN OS_IS_CYGWIN SHARED_CTLIB mex_ext F77_EXT CXX_EXT OBJ_EXT EXE_EXT local_math_libs math_libs SO LDSHARED LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -1578,7 +1578,6 @@ KERNEL='base' BUILD_CK= NEED_CKREADER= -NEED_BLAS= NEED_LAPACK= NEED_RECIPES= NEED_MATH= @@ -1593,14 +1592,12 @@ if test "$ENABLE_KINETICS" = "y"; then KERNEL=$KERNEL' 'kinetics; fi if test "$ENABLE_CK" = "y" then -#KERNEL=$KERNEL' 'ck BUILD_CK=1 NEED_CKREADER=1 fi if test "$ENABLE_TRANSPORT" = "y" then KERNEL=$KERNEL' 'trprops -NEED_BLAS=1 NEED_LAPACK=1 NEED_MATH=1 NEED_TRANSPORT=1 @@ -1608,7 +1605,6 @@ fi if test "$ENABLE_EQUIL" = "y" then KERNEL=$KERNEL' 'equil -NEED_BLAS=1 NEED_LAPACK=1 NEED_RECIPES=1 fi @@ -1627,7 +1623,6 @@ fi if test "$ENABLE_FLOW1D" = "y" then KERNEL=$KERNEL' 'flow1D -NEED_BLAS=1 NEED_LAPACK=1 NEED_MATH=1 NEED_ONED=1 @@ -1658,12 +1653,21 @@ fi # supplied libraries build_lapack=0 -if test -z "$LAPACK_LIBRARY"; then LAPACK_LIBRARY=-lctlapack; build_lapack=1; fi - - - build_blas=0 -if test -z "$BLAS_LIBRARY"; then BLAS_LIBRARY=-lctblas; build_blas=1; fi +if test -z "$BLAS_LAPACK_LIBS" +then BLAS_LAPACK_LIBS="-lctlapack -lctblas" +build_blas=1 +build_lapack=1 +fi + +# if test -z "$LAPACK_LIBRARY"; then LAPACK_LIBRARY=-lctlapack; build_lapack=1; fi +# AC_SUBST(LAPACK_LIBRARY) + + +# build_blas=0 +# if test -z "$BLAS_LIBRARY"; then BLAS_LIBRARY=-lctblas; build_blas=1; fi +# AC_SUBST(BLAS_LIBRARY) + @@ -1697,21 +1701,24 @@ then LOCAL_LIBS=$LOCAL_LIBS' '-lcvode fi if test -n "$NEED_LAPACK" -then LOCAL_LIBS=$LOCAL_LIBS' '$LAPACK_LIBRARY +then LOCAL_LIBS=$LOCAL_LIBS' '$BLAS_LAPACK_LIBS fi if test -n "$NEED_MATH" then LOCAL_LIBS=$LOCAL_LIBS' '-lctmath fi -if test -n "$NEED_BLAS" -then LOCAL_LIBS=$LOCAL_LIBS' '$BLAS_LIBRARY -fi - if test -n "$NEED_TPX" then LOCAL_LIBS=$LOCAL_LIBS' '-ltpx fi +LOCAL_LIB_DIRS= +if test -n "$BLAS_LAPACK_DIR" +then LOCAL_LIB_DIRS=$LOCAL_LIB_DIRS' -L'$BLAS_LAPACK_DIR +fi + + + #-------------------------------------------------- @@ -3355,7 +3362,7 @@ fi # Provide some information about the compiler. -echo "$as_me:3358:" \ +echo "$as_me:3365:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -3532,7 +3539,7 @@ _ACEOF # flags. ac_save_FFLAGS=$FFLAGS FFLAGS="$FFLAGS $ac_verb" -(eval echo $as_me:3535: \"$ac_link\") >&5 +(eval echo $as_me:3542: \"$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 @@ -3612,7 +3619,7 @@ _ACEOF # flags. ac_save_FFLAGS=$FFLAGS FFLAGS="$FFLAGS $ac_cv_prog_f77_v" -(eval echo $as_me:3615: \"$ac_link\") >&5 +(eval echo $as_me:3622: \"$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 @@ -4535,10 +4542,11 @@ s,@INCL_USER_CODE@,$INCL_USER_CODE,;t t s,@KERNEL@,$KERNEL,;t t s,@BUILD_CK@,$BUILD_CK,;t t s,@LIB_DIR@,$LIB_DIR,;t t -s,@LAPACK_LIBRARY@,$LAPACK_LIBRARY,;t t s,@build_lapack@,$build_lapack,;t t -s,@BLAS_LIBRARY@,$BLAS_LIBRARY,;t t s,@build_blas@,$build_blas,;t t +s,@BLAS_LAPACK_LIBS@,$BLAS_LAPACK_LIBS,;t t +s,@BLAS_LAPACK_DIR@,$BLAS_LAPACK_DIR,;t t +s,@LOCAL_LIB_DIRS@,$LOCAL_LIB_DIRS,;t t s,@LOCAL_LIBS@,$LOCAL_LIBS,;t t s,@CANTERA_PARTICLES_DIR@,$CANTERA_PARTICLES_DIR,;t t s,@BUILD_PARTICLES@,$BUILD_PARTICLES,;t t diff --git a/config/configure.in b/config/configure.in index 903a49154..99f5b737a 100755 --- a/config/configure.in +++ b/config/configure.in @@ -241,7 +241,6 @@ KERNEL='base' BUILD_CK= NEED_CKREADER= -NEED_BLAS= NEED_LAPACK= NEED_RECIPES= NEED_MATH= @@ -256,14 +255,12 @@ if test "$ENABLE_KINETICS" = "y"; then KERNEL=$KERNEL' 'kinetics; fi if test "$ENABLE_CK" = "y" then -#KERNEL=$KERNEL' 'ck BUILD_CK=1 NEED_CKREADER=1 fi if test "$ENABLE_TRANSPORT" = "y" then KERNEL=$KERNEL' 'trprops -NEED_BLAS=1 NEED_LAPACK=1 NEED_MATH=1 NEED_TRANSPORT=1 @@ -271,7 +268,6 @@ fi if test "$ENABLE_EQUIL" = "y" then KERNEL=$KERNEL' 'equil -NEED_BLAS=1 NEED_LAPACK=1 NEED_RECIPES=1 fi @@ -290,7 +286,6 @@ fi if test "$ENABLE_FLOW1D" = "y" then KERNEL=$KERNEL' 'flow1D -NEED_BLAS=1 NEED_LAPACK=1 NEED_MATH=1 NEED_ONED=1 @@ -318,15 +313,24 @@ AC_SUBST(LIB_DIR) # supplied libraries build_lapack=0 -if test -z "$LAPACK_LIBRARY"; then LAPACK_LIBRARY=-lctlapack; build_lapack=1; fi -AC_SUBST(LAPACK_LIBRARY) +build_blas=0 +if test -z "$BLAS_LAPACK_LIBS" +then BLAS_LAPACK_LIBS="-lctlapack -lctblas" +build_blas=1 +build_lapack=1 +fi + +# if test -z "$LAPACK_LIBRARY"; then LAPACK_LIBRARY=-lctlapack; build_lapack=1; fi +# AC_SUBST(LAPACK_LIBRARY) AC_SUBST(build_lapack) -build_blas=0 -if test -z "$BLAS_LIBRARY"; then BLAS_LIBRARY=-lctblas; build_blas=1; fi -AC_SUBST(BLAS_LIBRARY) +# build_blas=0 +# if test -z "$BLAS_LIBRARY"; then BLAS_LIBRARY=-lctblas; build_blas=1; fi +# AC_SUBST(BLAS_LIBRARY) AC_SUBST(build_blas) +AC_SUBST(BLAS_LAPACK_LIBS) +AC_SUBST(BLAS_LAPACK_DIR) LOCAL_LIBS= @@ -357,23 +361,26 @@ then LOCAL_LIBS=$LOCAL_LIBS' '-lcvode fi if test -n "$NEED_LAPACK" -then LOCAL_LIBS=$LOCAL_LIBS' '$LAPACK_LIBRARY +then LOCAL_LIBS=$LOCAL_LIBS' '$BLAS_LAPACK_LIBS fi if test -n "$NEED_MATH" then LOCAL_LIBS=$LOCAL_LIBS' '-lctmath fi -if test -n "$NEED_BLAS" -then LOCAL_LIBS=$LOCAL_LIBS' '$BLAS_LIBRARY -fi - if test -n "$NEED_TPX" then LOCAL_LIBS=$LOCAL_LIBS' '-ltpx fi +LOCAL_LIB_DIRS= +if test -n "$BLAS_LAPACK_DIR" +then LOCAL_LIB_DIRS=$LOCAL_LIB_DIRS' -L'$BLAS_LAPACK_DIR +fi + +AC_SUBST(LOCAL_LIB_DIRS) AC_SUBST(LOCAL_LIBS) + #-------------------------------------------------- # Particle Library interface #-------------------------------------------------- diff --git a/configure b/configure index fcfed3b75..cdd5deb51 100755 --- a/configure +++ b/configure @@ -176,14 +176,16 @@ ENABLE_TPX='y' #----------------------------------------------------------------- # # Cantera comes with Fortran versions of those parts of BLAS and -# LAPACK it requires. But if you have another version of BLAS and/or -# LAPACK you'd like to use, uncomment one or both of the following -# lines, and enter here the string that should be added to the link -# command to link to it. -# -# BLAS_LIBRARY=-lblas -# -# LAPACK_LIBRARY=-llapack +# LAPACK it requires. But performance *may* be better if you use a +# version of these libraries optimized for your machine hardware. If +# you want to use your own libraries, set BLAS_LAPACK_LIBS to the +# string that should be passed to the linker to link to these +# libraries, and set BLAS_LAPACK_DIR to the directory where these +# libraries are located. Otherwise, leave these lines commented out. + +# BLAS_LAPACK_LIBS='-llapack -lf77blas -lcblas -latlas' +# BLAS_LAPACK_DIR='/usr/lib/atlas' + # # The options below do not need to be set if you are using the default # libraries. @@ -216,7 +218,7 @@ CC=${CC:=gcc} CXXFLAGS=${CXXFLAGS:="-O2 -Wall"} # the C++ flags required for linking -#LCXX_FLAGS= +LCXX_FLAGS="-L /usr/lib/atlas" # Ending libraries to tack onto the linking of all C++ programs LCXX_END_LIBS=${LCXX_END_LIBS:="-lm"} @@ -304,7 +306,8 @@ export CANTERA_VERSION export USER_SRC_DIR export ARCHIVE export RANLIB -export BLAS_LIBRARY +export BLAS_LAPACK_LIBS +export BLAS_LAPACK_DIR export BUILD_F90 export BUILD_FORTRAN_90_INTERFACE export PYTHON_PACKAGE @@ -332,7 +335,6 @@ export F77_EXT export F90 export F90_EXT export FFLAGS -export LAPACK_LIBRARY export LAPACK_NAMES export LCXX_FLAGS export LCXX_END_LIBS diff --git a/examples/cxx/Makefile.in b/examples/cxx/Makefile.in index 0946fd80a..4491dd34c 100755 --- a/examples/cxx/Makefile.in +++ b/examples/cxx/Makefile.in @@ -59,7 +59,7 @@ CANTERA_LIBS = CANTERA_INC=-I@ctroot@/build/include/cantera # flags passed to the C++ compiler/linker for the linking step -LCXX_FLAGS = -L$(CANTERA_LIBDIR) @CXXFLAGS@ +LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIR@ @CXXFLAGS@ # how to compile C++ source files to object files .@CXX_EXT@.@OBJ_EXT@: diff --git a/tools/src/Makefile.in b/tools/src/Makefile.in index eb9196c1e..4a1d9247d 100755 --- a/tools/src/Makefile.in +++ b/tools/src/Makefile.in @@ -6,10 +6,10 @@ BINDIR = @buildbin@ build_ck = @BUILD_CK@ LCXX_FLAGS = -L$(LIBDIR) @CXXFLAGS@ -LOCAL_LIBS = -lcantera @math_libs@ @LAPACK_LIBRARY@ @BLAS_LIBRARY@ -lctcxx +LOCAL_LIBS = -lcantera -lctcxx +#LOCAL_LIBS = -lcantera @math_libs@ @BLAS_LAPACK_LIBS@ -lctcxx LCXX_END_LIBS = @LCXX_END_LIBS@ -#OBJS = ck2cti.o OBJS = ck2cti.o cti2ctml.o