From 92abf1f919dcc25437034c24645bcc9ec498c4ae Mon Sep 17 00:00:00 2001 From: Nicholas Malaya Date: Wed, 4 Jan 2012 00:42:46 +0000 Subject: [PATCH] [cantera]: changing relative directory of all generated libraries to build directory, in keeping with cantera 1.8 standard. Next: make working 'make check'! --- Cantera/src/base/Makefile.am | 6 +- Cantera/src/converters/Makefile.am | 6 +- Cantera/src/equil/Makefile.am | 6 +- Cantera/src/kinetics/Makefile.am | 6 +- Cantera/src/numerics/Makefile.am | 6 +- Cantera/src/oneD/Makefile.am | 6 +- Cantera/src/spectra/Makefile.am | 6 +- Cantera/src/thermo/Makefile.am | 6 +- Cantera/src/transport/Makefile.am | 6 +- Cantera/src/zeroD/Makefile.am | 6 +- configure.ac | 1 + examples/Makefile.am | 2 + examples/cxx/Makefile.am | 18 ++++ examples/cxx/Makefile.in | 131 ----------------------------- examples/cxx/equil_example1.cpp | 2 +- test_problems/Makefile.am | 1 + test_problems/cxx_ex/Makefile.in | 16 ---- 17 files changed, 53 insertions(+), 178 deletions(-) create mode 100644 examples/cxx/Makefile.am delete mode 100755 examples/cxx/Makefile.in delete mode 100644 test_problems/cxx_ex/Makefile.in diff --git a/Cantera/src/base/Makefile.am b/Cantera/src/base/Makefile.am index 024e153cf..809df5d3a 100644 --- a/Cantera/src/base/Makefile.am +++ b/Cantera/src/base/Makefile.am @@ -12,12 +12,12 @@ cc_sources = ct2ctml.cpp ctml.cpp misc.cpp plots.cpp \ INCLUDES = AM_CXXFLAGS = $(INCLUDES) -lib_LTLIBRARIES = libctbase.la +lib_LTLIBRARIES = $(top_builddir)/build/lib/libctbase.la library_includedir = $(includedir) #----------------------- # Cantera Converters C/C++ library #----------------------- -libctbase_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) -libctbase_la_SOURCES = $(cc_sources) $(h_sources) \ No newline at end of file +__top_builddir__build_lib_libctbase_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) +__top_builddir__build_lib_libctbase_la_SOURCES = $(cc_sources) $(h_sources) diff --git a/Cantera/src/converters/Makefile.am b/Cantera/src/converters/Makefile.am index 67370eb59..951b8cc90 100644 --- a/Cantera/src/converters/Makefile.am +++ b/Cantera/src/converters/Makefile.am @@ -9,12 +9,12 @@ cc_sources = atomicWeightDB.cpp ck2ctml.cpp CKReader.cpp filter.cpp \ INCLUDES = -I../base -I../../../ AM_CXXFLAGS = $(INCLUDES) -lib_LTLIBRARIES = libconverters.la +lib_LTLIBRARIES = $(top_builddir)/build/lib/libconverters.la library_includedir = $(includedir) #----------------------- # Cantera Converters C/C++ library #----------------------- -libconverters_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) -libconverters_la_SOURCES = $(cc_sources) $(h_sources) \ No newline at end of file +__top_builddir__build_lib_libconverters_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) +__top_builddir__build_lib_libconverters_la_SOURCES = $(cc_sources) $(h_sources) \ No newline at end of file diff --git a/Cantera/src/equil/Makefile.am b/Cantera/src/equil/Makefile.am index 80af02903..c0be25f05 100644 --- a/Cantera/src/equil/Makefile.am +++ b/Cantera/src/equil/Makefile.am @@ -8,12 +8,12 @@ INCLUDES = -I../base -I../thermo -I../numerics -I../../../ INCLUDES += -I../../../ext/f2c_libs/ AM_CXXFLAGS = $(INCLUDES) -lib_LTLIBRARIES = libequil.la +lib_LTLIBRARIES = $(top_builddir)/build/lib/libequil.la library_includedir = $(includedir) #----------------------- # Cantera Converters C/C++ library #----------------------- -libequil_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) -libequil_la_SOURCES = $(cc_sources) $(h_sources) \ No newline at end of file +__top_builddir__build_lib_libequil_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) +__top_builddir__build_lib_libequil_la_SOURCES = $(cc_sources) $(h_sources) \ No newline at end of file diff --git a/Cantera/src/kinetics/Makefile.am b/Cantera/src/kinetics/Makefile.am index 9c4e7d4ea..429481b93 100644 --- a/Cantera/src/kinetics/Makefile.am +++ b/Cantera/src/kinetics/Makefile.am @@ -12,12 +12,12 @@ cc_sources = importKinetics.cpp GRI_30_Kinetics.cpp KineticsFactory.cpp \ INCLUDES = -I../base -I../thermo -I../../../ AM_CXXFLAGS = $(INCLUDES) -lib_LTLIBRARIES = libkinetics.la +lib_LTLIBRARIES = $(top_builddir)/build/lib/libkinetics.la library_includedir = $(includedir) #----------------------- # Cantera Kinetics C/C++ library #----------------------- -libkinetics_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) -libkinetics_la_SOURCES = $(cc_sources) $(h_sources) \ No newline at end of file +__top_builddir__build_lib_libkinetics_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) +__top_builddir__build_lib_libkinetics_la_SOURCES = $(cc_sources) $(h_sources) \ No newline at end of file diff --git a/Cantera/src/numerics/Makefile.am b/Cantera/src/numerics/Makefile.am index 988057674..7a061bc5f 100644 --- a/Cantera/src/numerics/Makefile.am +++ b/Cantera/src/numerics/Makefile.am @@ -11,12 +11,12 @@ cc_sources = DenseMatrix.cpp funcs.cpp Func1.cpp ODE_integrators.cpp \ INCLUDES = -I../base -I../../../ AM_CXXFLAGS = $(INCLUDES) -lib_LTLIBRARIES = libctnumerics.la +lib_LTLIBRARIES = $(top_builddir)/build/lib/libctnumerics.la library_includedir = $(includedir) #----------------------- # Cantera numerics C/C++ library #----------------------- -libctnumerics_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) -libctnumerics_la_SOURCES = $(cc_sources) $(h_sources) \ No newline at end of file +__top_builddir__build_lib_libctnumerics_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) +__top_builddir__build_lib_libctnumerics_la_SOURCES = $(cc_sources) $(h_sources) \ No newline at end of file diff --git a/Cantera/src/oneD/Makefile.am b/Cantera/src/oneD/Makefile.am index 22b229924..08a044274 100644 --- a/Cantera/src/oneD/Makefile.am +++ b/Cantera/src/oneD/Makefile.am @@ -8,12 +8,12 @@ h_sources = Inlet1D.h MultiJac.h Sim1D.h StFlow.h \ INCLUDES = -I../base -I../thermo -I../kinetics -I../transport -I../numerics -I../../../ AM_CXXFLAGS = $(INCLUDES) -fPIC -lib_LTLIBRARIES = liboneD.la +lib_LTLIBRARIES = $(top_builddir)/build/lib/liboneD.la library_includedir = $(includedir) #----------------------- # Cantera OneD C/C++ library #----------------------- -liboneD_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) -liboneD_la_SOURCES = $(cc_sources) $(h_sources) \ No newline at end of file +__top_builddir__build_lib_liboneD_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) +__top_builddir__build_lib_liboneD_la_SOURCES = $(cc_sources) $(h_sources) \ No newline at end of file diff --git a/Cantera/src/spectra/Makefile.am b/Cantera/src/spectra/Makefile.am index 07fcc75e7..e2e9eab5a 100644 --- a/Cantera/src/spectra/Makefile.am +++ b/Cantera/src/spectra/Makefile.am @@ -6,12 +6,12 @@ cc_sources = LineBroadener.cpp rotor.cpp spectralUtilities.cpp INCLUDES = -I../base -I../../../ AM_CXXFLAGS = $(INCLUDES) -lib_LTLIBRARIES = libctspectra.la +lib_LTLIBRARIES = $(top_builddir)/build/lib/libctspectra.la library_includedir = $(includedir) #----------------------- # Cantera Spectra C/C++ library #----------------------- -libctspectra_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) -libctspectra_la_SOURCES = $(cc_sources) $(h_sources) \ No newline at end of file +__top_builddir__build_lib_libctspectra_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) +__top_builddir__build_lib_libctspectra_la_SOURCES = $(cc_sources) $(h_sources) \ No newline at end of file diff --git a/Cantera/src/thermo/Makefile.am b/Cantera/src/thermo/Makefile.am index 0dc9f4129..8916c0645 100644 --- a/Cantera/src/thermo/Makefile.am +++ b/Cantera/src/thermo/Makefile.am @@ -27,12 +27,12 @@ cc_sources = State.cpp Elements.cpp Constituents.cpp Phase.cpp \ INCLUDES = -I../base -I../../../ AM_CXXFLAGS = $(INCLUDES) -lib_LTLIBRARIES = libthermo.la +lib_LTLIBRARIES = $(top_builddir)/build/lib/libthermo.la library_includedir = $(includedir) #----------------------- # Cantera thermo C/C++ library #----------------------- -libthermo_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) -libthermo_la_SOURCES = $(cc_sources) $(h_sources) +__top_builddir__build_lib_libthermo_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) +__top_builddir__build_lib_libthermo_la_SOURCES = $(cc_sources) $(h_sources) diff --git a/Cantera/src/transport/Makefile.am b/Cantera/src/transport/Makefile.am index 35d344709..a5c490b65 100644 --- a/Cantera/src/transport/Makefile.am +++ b/Cantera/src/transport/Makefile.am @@ -13,12 +13,12 @@ cc_sources = AqueousTransport.cpp LiquidTransport.cpp MMCollisionInt.cpp \ INCLUDES = -I../base -I../thermo -I../numerics -I../../../ AM_CXXFLAGS = $(INCLUDES) -lib_LTLIBRARIES = libtransport.la +lib_LTLIBRARIES = $(top_builddir)/build/lib/libtransport.la library_includedir = $(includedir) #----------------------- # Cantera Transport C/C++ library #----------------------- -libtransport_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) -libtransport_la_SOURCES = $(cc_sources) $(h_sources) \ No newline at end of file +__top_builddir__build_lib_libtransport_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) +__top_builddir__build_lib_libtransport_la_SOURCES = $(cc_sources) $(h_sources) \ No newline at end of file diff --git a/Cantera/src/zeroD/Makefile.am b/Cantera/src/zeroD/Makefile.am index 7e3335f88..fb78cdc67 100644 --- a/Cantera/src/zeroD/Makefile.am +++ b/Cantera/src/zeroD/Makefile.am @@ -9,12 +9,12 @@ cc_sources = Reactor.cpp ReactorBase.cpp FlowDevice.cpp Wall.cpp \ INCLUDES = -I../base -I../thermo -I../kinetics -I../numerics -I../../../ AM_CXXFLAGS = $(INCLUDES) -lib_LTLIBRARIES = libzeroD.la +lib_LTLIBRARIES = $(top_builddir)/build/lib/libzeroD.la library_includedir = $(includedir) #----------------------- # Cantera OneD C/C++ library #----------------------- -libzeroD_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) -libzeroD_la_SOURCES = $(cc_sources) $(h_sources) \ No newline at end of file +__top_builddir__build_lib_libzeroD_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) +__top_builddir__build_lib_libzeroD_la_SOURCES = $(cc_sources) $(h_sources) \ No newline at end of file diff --git a/configure.ac b/configure.ac index f13b359aa..36cfe35f8 100644 --- a/configure.ac +++ b/configure.ac @@ -55,6 +55,7 @@ DX_INIT_DOXYGEN(cantera, doxygen/cantera.dox, docs) # Generate Output Files AC_OUTPUT(Makefile examples/Makefile \ + examples/cxx/Makefile \ test_problems/Makefile \ doxygen/Makefile \ Cantera/Makefile \ diff --git a/examples/Makefile.am b/examples/Makefile.am index a7919df96..9b5df6b24 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -1,3 +1,5 @@ +SUBDIRS = cxx + EXTRA_DIST = dist-hook: diff --git a/examples/cxx/Makefile.am b/examples/cxx/Makefile.am new file mode 100644 index 000000000..7b1a57d20 --- /dev/null +++ b/examples/cxx/Makefile.am @@ -0,0 +1,18 @@ +h_sources = example_utils.h + +cc_sources = equil_example1.cpp examples.cpp flame1.cpp kinetics_example1.cpp \ + kinetics_example2.cpp kinetics_example3.cpp rxnpath_example1.cpp \ + transport_example1.cpp transport_example2.cpp + +INCLUDES = -I../base -I../../Cantera/cxx/include +AM_CXXFLAGS = $(INCLUDES) + +bin_PROGRAMS = cxx_examples +library_includedir = $(includedir) + +#----------------------- +# Cantera cxx examples +#----------------------- + +cxx_examples_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) +cxx_examples_SOURCES = $(cc_sources) $(h_sources) diff --git a/examples/cxx/Makefile.in b/examples/cxx/Makefile.in deleted file mode 100755 index 008d0c035..000000000 --- a/examples/cxx/Makefile.in +++ /dev/null @@ -1,131 +0,0 @@ -#!/bin/sh - -############################################################################ -# -# Makefile to compile and link a C++ application to -# Cantera. -# -############################################################################# - -# the name of the executable program to be created -PROG_NAME = cxx_examples - -# the object files to be linked together. List those generated from Fortran -# and from C/C++ separately -OBJS = examples.o kinetics_example1.o kinetics_example2.o \ - kinetics_example3.o equil_example1.o \ - transport_example1.o transport_example2.o \ - rxnpath_example1.o - -# additional flags to be passed to the linker. If your program -# requires other external libraries, put them here -LINK_OPTIONS = @EXTRA_LINK@ - - -############################################################################# - -# the Fortran compiler -FORT = @F90@ - -PURIFY=@PURIFY@ - -# Fortran compile flags -FORT_FLAGS = @FFLAGS@ - -# Fortran libraries -ifeq (@build_with_f2c@, 0) -FORT_LIBS = @FLIBS@ -else -FORT_LIBS = -endif - -# the C++ compiler -CXX = @CXX@ - -# C++ compile flags -CXX_FLAGS = @CXXFLAGS@ @CXX_INCLUDES@ - -# external libraries -EXT_LIBS = @LOCAL_LIBS@ -lctcxx - -# Ending C++ linking libraries -LCXX_END_LIBS = @LCXX_END_LIBS@ - - -#------ you probably don't have to change anything below this line ----- - - -# the directory where the Cantera libraries are located -CANTERA_LIBDIR=@buildlib@ - -# required Cantera libraries -CANTERA_LIBS = @LOCAL_LIBS@ -lctcxx - -CANTERA_LIB_DEPS = $(CANTERA_LIBDIR)/libkinetics.a \ - $(CANTERA_LIBDIR)/libtransport.a \ - $(CANTERA_LIBDIR)/libthermo.a \ - $(CANTERA_LIBDIR)/libctnumerics.a \ - $(CANTERA_LIBDIR)/libctbase.a \ - $(CANTERA_LIBDIR)/libctmath.a \ - $(CANTERA_LIBDIR)/libtpx.a \ - $(CANTERA_LIBDIR)/libconverters.a - -ifeq (@build_lapack@, 1) -CANTERA_LAPACK_DEPS = $(CANTERA_LIBDIR)/libctblas.a \ - $(CANTERA_LIBDIR)/libctlapack.a -endif - -ifeq (@use_sundials@, 0) -CANTERA_CVODE_DEPS = $(CANTERA_LIBDIR)/libcvode.a -endif - -LIB_DEPS = $(CANTERA_LIB_DEPS) $(CANTERA_LAPACK_DEPS) $(CANTERA_CVODE_DEPS) - -# the directory where Cantera include files may be found. -CANTERA_INC=-I@ctroot@/build/include - -# flags passed to the C++ compiler/linker for the linking step -LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@ - -# how to compile C++ source files to object files -.@CXX_EXT@.@OBJ_EXT@: - $(PURIFY) $(CXX) -c $< $(CANTERA_INC) $(CXX_FLAGS) - -# how to compile Fortran source files to object files -.@F77_EXT@.@OBJ_EXT@: - $(PURIFY) $(FORT) -c $< $(FORT_FLAGS) - -PROGRAM = ./$(PROG_NAME)$(EXE_EXT) - -all: .depends $(PROGRAM) - -DEPENDS=$(OBJS:.o=.d) - -%.d: - @CXX_DEPENDS@ $(CANTERA_INC) $(CXX_FLAGS) $*.cpp > $*.d - -$(PROGRAM): $(OBJS) $(LIB_DEPS) - $(PURIFY) $(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(CANTERA_LIBS) \ - $(LINK_OPTIONS) $(EXT_LIBS) @LIBS@ \ - $(LCXX_END_LIBS) - - -clean: - $(RM) $(OBJS) $(PROGRAM) $(DEPENDS) .depends *~ - (if test -d SunWS_cache ; then \ - $(RM) -rf SunWS_cache ; \ - fi ) - -depends: - $(MAKE) .depends - -.depends: $(DEPENDS) - cat *.d > .depends - -TAGS: - etags *.h *.cpp - -ifeq ($(wildcard .depends), .depends) -include .depends -endif - diff --git a/examples/cxx/equil_example1.cpp b/examples/cxx/equil_example1.cpp index 1d812033d..270cc3678 100755 --- a/examples/cxx/equil_example1.cpp +++ b/examples/cxx/equil_example1.cpp @@ -16,7 +16,7 @@ #pragma warning(disable:4503) #endif -#include +#include #include #include "example_utils.h" #include diff --git a/test_problems/Makefile.am b/test_problems/Makefile.am index 0bce1584a..412577506 100644 --- a/test_problems/Makefile.am +++ b/test_problems/Makefile.am @@ -5,6 +5,7 @@ ChemEquil_ionizedGas ChemEquil_red1 CpJump \ mixGasTransport multiGasTransport printUtilUnitTest +SUBDIRS = cxx_ex # # would be good to add: # diff --git a/test_problems/cxx_ex/Makefile.in b/test_problems/cxx_ex/Makefile.in deleted file mode 100644 index 3461c63ce..000000000 --- a/test_problems/cxx_ex/Makefile.in +++ /dev/null @@ -1,16 +0,0 @@ -# -# $Revision: 1.7 $ -# $Author: hkmoffa $ -# $Date: 2006/04/30 18:06:56 $ -# -# -all: - (cd ../../examples/cxx ; @MAKE@ ) -test: - ./runtest - -clean: - (cd ../../examples/cxx ; @MAKE@ clean ) - -depends: -