diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..c25e3d765 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,27 @@ +PROJECT (Cantera) + +INCLUDE (config.cmake) + +#operating system +SET(os ${CMAKE_SYSTEM_NAME}) +if (os STREQUAL "Darwin") + SET(DARWIN 1) +endif (os STREQUAL "Darwin") + +if (PYTHON_CMD STREQUAL "default") + INCLUDE( FindPythonInterp ) + SET( PYTHON_EXE ${PYTHON_EXECUTABLE} ) +else (PYTHON_CMD STREQUAL "default") + SET( PYTHON_EXE ${PYTHON_CMD} ) +endif (PYTHON_CMD STREQUAL "default") + +# configuration +CONFIGURE_FILE ( + ${PROJECT_SOURCE_DIR}/config.h_cmake.in + ${PROJECT_BINARY_DIR}/config.h ) + +set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/build/lib/${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_SYSTEM_VERSION}) + +add_subdirectory(Cantera) + + diff --git a/Cantera/CMakeLists.txt b/Cantera/CMakeLists.txt new file mode 100644 index 000000000..febd4f0ab --- /dev/null +++ b/Cantera/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(src) diff --git a/Cantera/src/CMakeLists.txt b/Cantera/src/CMakeLists.txt new file mode 100644 index 000000000..1ad6a5575 --- /dev/null +++ b/Cantera/src/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(base) diff --git a/Cantera/src/base/CMakeLists.txt b/Cantera/src/base/CMakeLists.txt new file mode 100644 index 000000000..f581c9e3b --- /dev/null +++ b/Cantera/src/base/CMakeLists.txt @@ -0,0 +1,3 @@ +SET (CTBASE_SRCS misc.cpp ct2ctml.cpp ctml.cpp + plots.cpp stringUtils.cpp xml.cpp) +ADD_LIBRARY(ctbase ${CTBASE_SRCS}) diff --git a/config.cmake b/config.cmake new file mode 100755 index 000000000..e2469eaab --- /dev/null +++ b/config.cmake @@ -0,0 +1,78 @@ + + +# WORK IN PROGRESS +# This configuration file is not yet functional; use the "preconfig" +# script instead. + + +####################################################################### +# +# Cantera Configuration File +# +# Edit this file to control how Cantera is built. Parameters can be set +# here, or alternatively environment variables may be set before calling +# this script. +# +# The default configuration uses GNU compilers (gcc/g++/g77) and +# builds as much of Cantera and its language interfaces as it can +# (e.g. if MATLAB is installed on your system, the MATLAB toolbox +# will be built automatically, otherwise it will be skipped. On linux +# or Mac OS X, this default configuration should work, and most +# likely you don't need to edit this file at all - just run it. +# +# NOTE: if you DO make changes to this file, save it with another name +# so that it will not be overwritten if you update the source +# distribution. + +####################################################################### + +#---------------------------------------------------------------------- +# Language Interfaces +#---------------------------------------------------------------------- +# +# Cantera has several programming language interfaces. Select the ones +# you want to build. The default is to try to build all language +# interfaces. +# +# +#----------------- Python -------------------------------------------- +# +# In addition to being one of the supported language interfaces, +# Python is used internally by Cantera, both in the build process and +# at run time (to process .cti input files). Therefore, you generally +# need to have Python on your system; if you don't, first install it +# from http://www.python.org before proceeding with the installation +# of Cantera. +# +# If you plan to work in Python, or you want to use the graphical +# MixMaster application, then you need the full Cantera Python +# Package. If, on the other hand, you will only use Cantera from some +# other language (e.g. MATLAB or Fortran 90/95) and only need Python +# to process .cti files, then you only need a minimal subset of the +# package (actually, only one file). + +# Set PYTHON_PACKAGE to one of these four strings: +# full install everything needed to use Cantera from Python +# minimal install only enough to process .cti files +# none Don't install or run any Python scripts during the +# build process +# default try to do a full installation, but fall back to a minimal +# one in case of errors + +SET( PYTHON_PACKAGE "default") + +# Cantera needs to know where to find the Python interpreter. If +# PYTHON_CMD is set to "default", then cmake will look for the Python +# interpreter +SET( PYTHON_CMD "default") + +# The Cantera Python interface can be built with either the numarray +# or Numeric packages. Set this to "y" to use Numeric, or anything +# else to use numarray. Using numarray is preferred. +SET( USE_NUMERIC "default") + +# If numarray was installed using the --home option, set this to the +# home directory for numarray. +SET( NUMARRAY_HOME "$HOME/python_packages") + +SET( CANTERA_VERSION "1.7.1") \ No newline at end of file diff --git a/config.h.in b/config.h.in index 7d8383107..f1b9b5d26 100755 --- a/config.h.in +++ b/config.h.in @@ -116,7 +116,7 @@ typedef int ftnlen; // Fortran hidden string length type //--------------------- compile options ---------------------------- #undef USE_PCH -#define THREAD_SAFE_CANTERA +#undef THREAD_SAFE_CANTERA //--------------------- optional phase models ---------------------- // This define indicates the enabling of the inclusion of diff --git a/config.h_cmake.in b/config.h_cmake.in new file mode 100644 index 000000000..8e70e37bf --- /dev/null +++ b/config.h_cmake.in @@ -0,0 +1,147 @@ +// +// Input file for CMAKE to generate config.h +// + +// WORK IN PROGRESS! + + + +#ifndef CT_CONFIG_H +#define CT_CONFIG_H + + +//------------------------ Development flags ------------------// +// +// Compile in additional debug printing where available. +// Note, the printing may need to be turned on via a switch. +// This just compiles in the code. +#cmakedefine DEBUG_MODE + +//------------------------ Fortran settings -------------------// + + +// define types doublereal, integer, and ftnlen to match the +// corresponding Fortran data types on your system. The defaults +// are OK for most systems + +typedef double doublereal; // Fortran double precision +typedef int integer; // Fortran integer +typedef int ftnlen; // Fortran hidden string length type + + + +// Fortran compilers pass character strings in argument lists by +// adding a hidden argement with the length of the string. Some +// compilers add the hidden length argument immediately after the +// CHARACTER variable being passed, while others put all of the hidden +// length arguments at the end of the argument list. Define this if +// the lengths are at the end of the argument list. This is usually the +// case for most unix Fortran compilers, but is (by default) false for +// Visual Fortran under Windows. +#cmakedefine STRING_LEN_AT_END + + +// Define this if Fortran adds a trailing underscore to names in object files. +// For linux and most unix systems, this is the case. +#cmakedefine FTN_TRAILING_UNDERSCORE + + +#cmakedefine HAS_SUNDIALS +#cmakedefine SUNDIALS_VERSION_22 +#cmakedefine SUNDIALS_VERSION_23 + +//-------- LAPACK / BLAS --------- + +#define LAPACK_FTN_STRING_LEN_AT_END +#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. +#cmakedefine DARWIN +#cmakedefine HAS_SSTREAM + +// Cantera version +#define CANTERA_VERSION "@CANTERA_VERSION@" + +// Identify whether the operating system is cygwin's overlay of +// windows, with gcc being used as the compiler. +#cmakedefine CYGWIN + +// Identify whether the operating system is windows based, with +// microsoft vc++ being used as the compiler +#cmakedefine WINMSVC + +//--------- Fonts for reaction path diagrams ---------------------- +#define RXNPATH_FONT Helvetica + +//--------------------- Python ------------------------------------ +// This path to the python executable is created during +// Cantera's setup. It identifies the python executable +// used to run Python to process .cti files. Note that this is only +// used if environment variable PYTHON_CMD is not set. +#define PYTHON_EXE "@PYTHON_EXE@" + +// If this is defined, the Cantera Python interface will use the +// Numeric package; otherwise, it will use numarray. +#cmakedefine HAS_NUMERIC + +// If this is defined, then python will not be assumed to be +// present to support conversions +#cmakedefine HAS_NO_PYTHON + +//--------------------- Cantera ----------------------------------- +// This is the data pathway used to locate the top of the +// build directory. +#cmakedefine CANTERA_ROOT + +// This data pathway is used to locate a directory where datafiles +// are to be found. Note, the local directory is always searched +// as well. +#cmakedefine CANTERA_DATA + + +#cmakedefine WITH_HTML_LOGS + +// define STORE_MOLE_FRACTIONS if you want Cantera to internally +// represent the composition of a mixture as mole fractions. Usually +// the best choice. +#define STORE_MOLE_FRACTIONS + +// define STORE_MASS_FRACTIONS if you want Cantera to internally +// represent the composition of a mixture as mass fractions. Usually +// results in slightly worse performance, but may not in all cases. +//#define STORE_MASS_FRACTIONS +#cmakedefine STORE_MASS_FRACTIONS + +//--------------------- compile options ---------------------------- +#cmakedefine USE_PCH + +#cmakedefine THREAD_SAFE_CANTERA + +//--------------------- optional phase models ---------------------- +// This define indicates the enabling of the inclusion of +// accurate liquid/vapor equations +// of state for several fluids, including water, nitrogen, hydrogen, +// oxygen, methane, andd HFC-134a. +#cmakedefine INCL_PURE_FLUIDS +#cmakedefine WITH_PURE_FLUIDS + +#cmakedefine WITH_LATTICE_SOLID +#cmakedefine WITH_METAL +#cmakedefine WITH_STOICH_SUBSTANCE +// Enable expanded thermodynamic capabilities, adding +// ideal solid solutions +#cmakedefine WITH_IDEAL_SOLUTIONS +// Enable expanded electrochemistry capabilities, include thermo +// models for electrolyte solutions. +#cmakedefine WITH_ELECTROLYTES + +#cmakedefine WITH_PRIME + + +#endif