From 2959b2735e3e452911ef4bb79c12e87c39c0608f Mon Sep 17 00:00:00 2001 From: Dave Goodwin Date: Tue, 3 Aug 2004 11:16:20 +0000 Subject: [PATCH] cleanup --- Cantera/cxx/src/writelog.cpp | 5 +++++ Cantera/matlab/cantera/ck2cti.m | 8 +++++++- Cantera/matlab/cantera/private/write.cpp | 4 ++++ Cantera/python/src/writelog.cpp | 4 ++++ Cantera/src/global.h | 2 ++ Makefile.in | 5 +++++ config/configure | 10 ++++++++-- config/configure.in | 2 +- configure | 10 ++++++++++ 9 files changed, 46 insertions(+), 4 deletions(-) diff --git a/Cantera/cxx/src/writelog.cpp b/Cantera/cxx/src/writelog.cpp index 5484bd5bf..276fc1b5e 100644 --- a/Cantera/cxx/src/writelog.cpp +++ b/Cantera/cxx/src/writelog.cpp @@ -48,4 +48,9 @@ namespace Cantera { cerr << msg << endl; exit(-1); } + + int userInterface() { + return 0; + } + } diff --git a/Cantera/matlab/cantera/ck2cti.m b/Cantera/matlab/cantera/ck2cti.m index f424b4e6e..57598bfce 100644 --- a/Cantera/matlab/cantera/ck2cti.m +++ b/Cantera/matlab/cantera/ck2cti.m @@ -37,7 +37,13 @@ end iok = system([prog,' -i ',infile,' -t ',thermo,' -tr ',transport, ... ' -id ',idtag,' > ',outfile]); if iok - error(['Error occurred while running ck2cti. Check file ck2cti.log' ... + ierr2 = system([prog,' > log']) + if ierr2 + error(['Program ck2cti is not found at ',prog,['. Edit file' ... + [' ctbin.m to point to the Cantera bin directory.']]]) + else + error(['Error occurred while running ck2cti. Check file ck2cti.log' ... ' for error messages.']); + end end f = outfile; diff --git a/Cantera/matlab/cantera/private/write.cpp b/Cantera/matlab/cantera/private/write.cpp index 15bcb6da1..e56dd72da 100644 --- a/Cantera/matlab/cantera/private/write.cpp +++ b/Cantera/matlab/cantera/private/write.cpp @@ -27,5 +27,9 @@ namespace Cantera { std::string err = "error("+msg+");"; mexEvalString(err.c_str()); } + + int userInterface() { + return 1; + } } diff --git a/Cantera/python/src/writelog.cpp b/Cantera/python/src/writelog.cpp index cda6194a7..2246330af 100644 --- a/Cantera/python/src/writelog.cpp +++ b/Cantera/python/src/writelog.cpp @@ -26,4 +26,8 @@ namespace Cantera { string err = "raise \""+msg+"\""; PyRun_SimpleString((char *)err.c_str()); } + + int userInterface() { + return 2; + } } diff --git a/Cantera/src/global.h b/Cantera/src/global.h index 8ce76a82a..3cbca5889 100755 --- a/Cantera/src/global.h +++ b/Cantera/src/global.h @@ -95,6 +95,8 @@ namespace Cantera { /// version calls Matlab function error(). void error(const string& msg); + /// returns 1 for MATLAB, 2 for Python, and 0 for C++ or Fortran. + int userInterface(); /** * Return the conversion factor to convert unit string 'unit' to diff --git a/Makefile.in b/Makefile.in index 639459d4b..61420129e 100755 --- a/Makefile.in +++ b/Makefile.in @@ -12,6 +12,7 @@ ct = $(export_dir)/cantera-$(version) build_ck = @BUILD_CK@ build_clib = @BUILD_CLIB@ build_python = @BUILD_PYTHON@ +build_f90 = @BUILD_F90@ build_matlab = @BUILD_MATLAB@ build_particles = @BUILD_PARTICLES@ os_is_win = @OS_IS_WIN@ @@ -65,7 +66,11 @@ ifeq ($(do_ranlib),1) endif fortran: +ifeq ($(build_f90),1) cd Cantera/fortran/src; @MAKE@ +else + @echo skipping building the Fortran 90/95 interface +endif cxxlib: cd Cantera/cxx/src; @MAKE@ diff --git a/config/configure b/config/configure index ca1406270..cbc28779e 100755 --- a/config/configure +++ b/config/configure @@ -1775,7 +1775,7 @@ fi BUILD_F90=0 -if test "$BUILD_F90_INTERFACE" != "n"; then +if test "x$BUILD_F90_INTERFACE" = "xy"; then BUILD_F90=1 fi @@ -3915,7 +3915,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - ac_config_files="$ac_config_files ../Cantera/Makefile ../Cantera/src/Makefile ../Cantera/src/zeroD/Makefile ../Cantera/src/oneD/Makefile ../Cantera/src/converters/Makefile ../Cantera/src/transport/Makefile ../Cantera/clib/src/Makefile ../Cantera/fortran/src/Makefile ../Cantera/fortran/f77demos/f77demos.mak ../Cantera/fortran/f77demos/isentropic.dsp ../Cantera/matlab/Makefile ../Cantera/matlab/setup_matlab.py ../Cantera/matlab/setup_winmatlab.py ../Cantera/python/Makefile ../Cantera/python/setup.py ../Cantera/cxx/Makefile ../Cantera/cxx/src/Makefile ../Cantera/cxx/demos/Makefile ../Cantera/user/Makefile ../Cantera/python/src/Makefile ../ext/lapack/Makefile ../ext/blas/Makefile ../ext/cvode/Makefile ../ext/math/Makefile ../ext/tpx/Makefile ../ext/Makefile ../ext/recipes/Makefile ../examples/Makefile ../examples/cxx/Makefile ../Makefile ../tools/Makefile ../tools/src/Makefile ../tools/src/sample.mak ../tools/src/finish_install.py ../tools/src/package4mac ../tools/templates/f77/demo.mak ../tools/templates/cxx/demo.mak ../tools/testtools/Makefile ../data/inputs/Makefile ../test_problems/Makefile ../test_problems/cxx_ex/Makefile ../test_problems/silane_equil/Makefile ../test_problems/surfkin/Makefile ../test_problems/diamondSurf/Makefile" + ac_config_files="$ac_config_files ../Cantera/Makefile ../Cantera/src/Makefile ../Cantera/src/zeroD/Makefile ../Cantera/src/oneD/Makefile ../Cantera/src/converters/Makefile ../Cantera/src/transport/Makefile ../Cantera/clib/src/Makefile ../Cantera/fortran/src/Makefile ../Cantera/fortran/f77demos/f77demos.mak ../Cantera/fortran/f77demos/isentropic.dsp ../Cantera/matlab/Makefile ../Cantera/matlab/setup_matlab.py ../Cantera/matlab/setup_winmatlab.py ../Cantera/python/Makefile ../Cantera/python/setup.py ../Cantera/cxx/Makefile ../Cantera/cxx/src/Makefile ../Cantera/cxx/demos/Makefile ../Cantera/user/Makefile ../Cantera/python/src/Makefile ../ext/lapack/Makefile ../ext/blas/Makefile ../ext/cvode/Makefile ../ext/math/Makefile ../ext/tpx/Makefile ../ext/Makefile ../ext/recipes/Makefile ../examples/Makefile ../examples/cxx/Makefile ../Makefile ../tools/Makefile ../tools/src/Makefile ../tools/src/sample.mak ../tools/src/finish_install.py ../tools/src/package4mac ../tools/templates/f77/demo.mak ../tools/templates/cxx/demo.mak ../tools/testtools/Makefile ../data/inputs/Makefile ../test_problems/Makefile ../test_problems/cxx_ex/Makefile ../test_problems/silane_equil/Makefile ../test_problems/surfkin/Makefile ../test_problems/diamondSurf/Makefile ../test_problems/ck2cti_test/runtest ../test_problems/ck2cti_test/Makefile" test "x$prefix" = xNONE && prefix=$ac_default_prefix @@ -4431,6 +4431,8 @@ do "../test_problems/silane_equil/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../test_problems/silane_equil/Makefile" ;; "../test_problems/surfkin/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../test_problems/surfkin/Makefile" ;; "../test_problems/diamondSurf/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../test_problems/diamondSurf/Makefile" ;; + "../test_problems/ck2cti_test/runtest" ) CONFIG_FILES="$CONFIG_FILES ../test_problems/ck2cti_test/runtest" ;; + "../test_problems/ck2cti_test/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../test_problems/ck2cti_test/Makefile" ;; "../config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ../config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} @@ -5085,6 +5087,10 @@ fi if test "x${OS_IS_WIN}" = "x1"; then cp -f ../config.h ../Cantera/src fi +if test -f "../test_problems/ck2cti_test/runtest"; then + chmod +x ../test_problems/ck2cti_test/runtest +fi + echo if test "x${OS_IS_WIN}" = "x0"; then echo "Now type '${MAKE}' to build Cantera" diff --git a/config/configure.in b/config/configure.in index d8b5cc630..6c13d5d46 100755 --- a/config/configure.in +++ b/config/configure.in @@ -435,7 +435,7 @@ AC_SUBST(BUILD_PARTICLES) AC_SUBST(CT_SHARED_LIB) BUILD_F90=0 -if test "$BUILD_F90_INTERFACE" != "n"; then +if test "x$BUILD_F90_INTERFACE" = "xy"; then BUILD_F90=1 fi AC_SUBST(BUILD_F90) diff --git a/configure b/configure index 6172bb282..a6dac9516 100755 --- a/configure +++ b/configure @@ -109,6 +109,16 @@ PYTHON_SITE_PACKAGE_TOPDIR=${PYTHON_SITE_PACKAGE_TOPDIR:="/usr/local"} BUILD_MATLAB_TOOLBOX=${BUILD_MATLAB_TOOLBOX:="y"} + +#----------- Fortran 90/95 -------------------------------------------------- + +# Set this to "y" if you want to build the Fortran 90/95 interface. +# A Fortran 90/95 compiler is required. +# UNDER DEVELOPMENT - UNSTABLE!! + +BUILD_F90_INTERFACE=${BUILD_F90_INTERFACE:="n"} + + #---------------------------------------------------------------------- # Customizations / Extensions #