From 020a18fa07d55ae60e1adedb9a87b887e6414451 Mon Sep 17 00:00:00 2001 From: Nicholas Malaya Date: Wed, 18 Jan 2012 20:15:05 +0000 Subject: [PATCH] [cantera]: fixing cxx library build --- Cantera/Makefile.am | 2 +- Cantera/cxx/Makefile.am | 1 + Cantera/cxx/Makefile.in | 57 ---------------------------- Cantera/cxx/src/Makefile.am | 16 ++++++++ Cantera/cxx/src/Makefile.in | 65 -------------------------------- Cantera/src/kinetics/Makefile.am | 2 +- configure.ac | 4 +- examples/cxx/Makefile.am | 3 +- 8 files changed, 23 insertions(+), 127 deletions(-) create mode 100644 Cantera/cxx/Makefile.am delete mode 100644 Cantera/cxx/Makefile.in create mode 100644 Cantera/cxx/src/Makefile.am delete mode 100644 Cantera/cxx/src/Makefile.in diff --git a/Cantera/Makefile.am b/Cantera/Makefile.am index c9ac09f25..16d372985 100644 --- a/Cantera/Makefile.am +++ b/Cantera/Makefile.am @@ -1,4 +1,4 @@ # $Id: $ # will need to add python and matlab -SUBDIRS = src user +SUBDIRS = src user cxx diff --git a/Cantera/cxx/Makefile.am b/Cantera/cxx/Makefile.am new file mode 100644 index 000000000..f963effea --- /dev/null +++ b/Cantera/cxx/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = src \ No newline at end of file diff --git a/Cantera/cxx/Makefile.in b/Cantera/cxx/Makefile.in deleted file mode 100644 index b142632e9..000000000 --- a/Cantera/cxx/Makefile.in +++ /dev/null @@ -1,57 +0,0 @@ -#/bin/sh -############################################################### -# $Author: hkmoffa $ -# $Date: 2009/04/04 03:27:43 $ -# $Revision: 1.14 $ -# -# Copyright 2001 California Institute of Technology -# See file License.txt for licensing information -# -############################################################### - -build_f90=@BUILD_F90@ -build_python=@BUILD_PYTHON@ - -INCDIR = ../../build/include/cantera -INSTALL_TSC = ../../../bin/install_tsc - -CXX_H = Cantera.h equilibrium.h IncompressibleSolid.h \ - kinetics.h onedim.h surface.h GRI30.h integrators.h \ - Metal.h PureFluid.h transport.h Edge.h \ - IdealGasMix.h Interface.h numerics.h \ - reactionpaths.h zerodim.h importPhase.h thermo.h \ - radiation.h spectra.h electrolyteThermo.h Cantera.mak Cantera_bt.mak - -all: - @(cd include ; \ - for lh in $(CXX_H) ; do \ - $(INSTALL_TSC) "$${lh}" "../"$(INCDIR) ; \ - done) - cd src; @MAKE@ -# cd demos; @MAKE@ - -clean: - @(for lh in $(CXX_H) ; do \ - th=$(INCDIR)/"$${lh}" ; \ - if test -f "$${th}" ; then \ - $(RM) "$${th}" ; \ - echo "$(RM) $${th}" ; \ - fi \ - done) - cd src; $(RM) .depends ; @MAKE@ clean - cd demos; $(RM) .depends ; @MAKE@ clean - -depends: - cd src; @MAKE@ depends -# cd demos; @MAKE@ depends - -install: - cd src; @MAKE@ install - cd demos; @MAKE@ install - -demos: - cd demos; @MAKE@ - - -# end of file - diff --git a/Cantera/cxx/src/Makefile.am b/Cantera/cxx/src/Makefile.am new file mode 100644 index 000000000..51980d049 --- /dev/null +++ b/Cantera/cxx/src/Makefile.am @@ -0,0 +1,16 @@ +cc_sources = cxxutils.cpp importPhase.cpp +AM_CPPFLAGS = -I../../src/thermo -I../../src/base +AM_CXXFLAGS = $(AM_CPPFLAGS) + +lib_LTLIBRARIES = $(top_builddir)/build/lib/libctcxx.la +library_includedir = $(top_builddir)/build/include +library_include_HEADERS = $(h_sources) + +#----------------------- +# Cantera Converters C/C++ library +#----------------------- + +__top_builddir__build_lib_libctcxx_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) +__top_builddir__build_lib_libctcxx_la_SOURCES = $(cc_sources) $(h_sources) + +CLEANFILES = *.o diff --git a/Cantera/cxx/src/Makefile.in b/Cantera/cxx/src/Makefile.in deleted file mode 100644 index 01e78a4ac..000000000 --- a/Cantera/cxx/src/Makefile.in +++ /dev/null @@ -1,65 +0,0 @@ -#/bin/sh -############################################################### -# $Author$ -# $Date$ -# $Revision$ -# -# Copyright 2001 California Institute of Technology -# -############################################################### - - -.SUFFIXES : -.SUFFIXES : .cpp .d .o .h - -PIC_FLAG=@PIC@ -CXX_FLAGS = @CXXFLAGS@ $(CXX_OPT) $(PIC_FLAG) - -OBJS = importPhase.o - -DEPENDS = $(OBJS:.o=.d) - -PURIFY=@PURIFY@ - -PIC_FLAG=@PIC@ -CXX_FLAGS = @CXXFLAGS@ $(CXX_OPT) $(PIC_FLAG) - - -# the directory where Cantera include files may be found. -CXX_INCLUDES = -I../../src/base -I../../src/thermo @CXX_INCLUDES@ - -# how to compile C++ source files to object files -.cpp.o: - $(PURIFY) @CXX@ -c $< $(CXX_INCLUDES) $(CXX_FLAGS) - -%.d: Makefile %.o - @CXX_DEPENDS@ $(CXX_FLAGS) $(CXX_INCLUDES) $*.cpp > $*.d - -LIB_NAME=libctcxx -CXXLIB=@buildlib@/$(LIB_NAME).a - -all: .depends $(CXXLIB) - -$(CXXLIB): $(OBJS) - @ARCHIVE@ $(CXXLIB) $(OBJS) - -clean: - $(RM) $(OBJS) *.d $(CXXLIB) - (if test -d SunWS_cache ; then \ - $(RM) -rf SunWS_cache ; \ - fi ) - -install: - @INSTALL@ $(CXXLIB) @prefix@/lib/cantera - -depends: - @MAKE@ .depends - -.depends: $(DEPENDS) - cat $(DEPENDS) > .depends - -$(OBJS): Makefile - -ifeq ($(wildcard .depends), .depends) -include .depends -endif diff --git a/Cantera/src/kinetics/Makefile.am b/Cantera/src/kinetics/Makefile.am index bd7e72bd3..b090eacb3 100644 --- a/Cantera/src/kinetics/Makefile.am +++ b/Cantera/src/kinetics/Makefile.am @@ -9,7 +9,7 @@ cc_sources = importKinetics.cpp GRI_30_Kinetics.cpp KineticsFactory.cpp \ GasKinetics.cpp AqueousKinetics.cpp FalloffFactory.cpp ReactionStoichMgr.cpp Kinetics.cpp solveSP.cpp -AM_CPPFLAGS = -I../base -I../thermo -I../../../ +AM_CPPFLAGS = -I../base -I../thermo -I../../../ AM_CXXFLAGS = $(AM_CPPFLAGS) lib_LTLIBRARIES = $(top_builddir)/build/lib/libkinetics.la diff --git a/configure.ac b/configure.ac index f27a29759..6a1510d9d 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ AC_PREREQ(2.61) AC_INIT([cantera], [1.8.0], [nick@ices.utexas.edu]) AC_CONFIG_HEADER(config.h) AC_CONFIG_AUX_DIR([build-aux]) -AX_ENABLE_BUILDDIR +#AX_ENABLE_BUILDDIR AM_INIT_AUTOMAKE(-Wall -Werror) # snarf and provide versioning numbers @@ -69,6 +69,8 @@ AC_OUTPUT(Makefile examples/Makefile \ Cantera/Makefile \ Cantera/user/Makefile \ Cantera/src/Makefile \ + Cantera/cxx/Makefile \ + Cantera/cxx/src/Makefile \ Cantera/src/base/Makefile \ Cantera/src/converters/Makefile \ Cantera/src/kinetics/Makefile \ diff --git a/examples/cxx/Makefile.am b/examples/cxx/Makefile.am index 840c967e7..7645bc55e 100644 --- a/examples/cxx/Makefile.am +++ b/examples/cxx/Makefile.am @@ -8,8 +8,7 @@ cc_sources = examples.cpp kinetics_example1.cpp kinetics_example2.cpp \ LINK = -lkinetics -ltransport -lthermo -lctnumerics LINK += -lctbase -ltpx -lctmath -lconverters LINK += -luser -lcvode -lstdc++ -lctlapack -LINK += -lctblas -# -lctf2c -lctcxx -luser -lstdc++ +LINK += -lctblas -lctf2c -lctcxx LIBS = -L$(top_builddir)/build/lib/ $(LINK)