From 5298d6989ce298038516a8c9639beda4f61adcc5 Mon Sep 17 00:00:00 2001 From: Nicholas Malaya Date: Fri, 3 Feb 2012 00:09:46 +0000 Subject: [PATCH] [cantera]: fixing a bug where two .cpp files attempted compile/linkage. --- Cantera/src/numerics/Makefile.am | 7 +- Cantera/src/thermo/Makefile.am | 9 +- configure.ac | 9 +- ext/Makefile.am | 2 +- ext/f2c_lapack/CMakeLists.txt | 14 -- ext/f2c_lapack/Makefile.am | 27 ++++ ext/f2c_lapack/Makefile.in | 143 ------------------ .../ChemEquil_gri_matrix/Makefile.am | 23 +++ .../ChemEquil_gri_matrix/Makefile.in | 139 ----------------- test_problems/Makefile.am | 2 +- 10 files changed, 66 insertions(+), 309 deletions(-) delete mode 100644 ext/f2c_lapack/CMakeLists.txt create mode 100644 ext/f2c_lapack/Makefile.am delete mode 100755 ext/f2c_lapack/Makefile.in create mode 100644 test_problems/ChemEquil_gri_matrix/Makefile.am delete mode 100644 test_problems/ChemEquil_gri_matrix/Makefile.in diff --git a/Cantera/src/numerics/Makefile.am b/Cantera/src/numerics/Makefile.am index 4b182c08a..2781ac22a 100644 --- a/Cantera/src/numerics/Makefile.am +++ b/Cantera/src/numerics/Makefile.am @@ -1,6 +1,5 @@ -h_sources = ArrayViewer.h DenseMatrix.h \ - funcs.h ctlapack.h Func1.h FuncEval.h \ - polyfit.h\ +h_sources = ArrayViewer.h DenseMatrix.h funcs.h ctlapack.h Func1.h \ + FuncEval.h polyfit.h \ BandMatrix.h Integrator.h DAE_Solver.h ResidEval.h sort.h \ SquareMatrix.h ResidJacEval.h NonlinearSolver.h CVodeInt.h @@ -9,7 +8,7 @@ cc_sources = DenseMatrix.cpp funcs.cpp Func1.cpp ODE_integrators.cpp \ SquareMatrix.cpp ResidJacEval.cpp NonlinearSolver.cpp \ CVodeInt.cpp -AM_CPPFLAGS = -I../base -I../../../ +AM_CPPFLAGS = -I../../../ -I$(top_builddir)/build/include/cantera AM_CXXFLAGS = $(AM_CPPFLAGS) lib_LTLIBRARIES = $(top_builddir)/build/lib/libctnumerics.la diff --git a/Cantera/src/thermo/Makefile.am b/Cantera/src/thermo/Makefile.am index 0e544a84d..5f37d2c58 100644 --- a/Cantera/src/thermo/Makefile.am +++ b/Cantera/src/thermo/Makefile.am @@ -17,10 +17,9 @@ h_sources = State.h Elements.h Constituents.h Phase.h mix_defs.h \ PDSS_IonsFromNeutral.h IonsFromNeutralVPSSTP.h \ GibbsExcessVPSSTP.h LatticePhase.h IdealMolalSoln.h \ PDSS.h HMWSoln.h WaterSSTP.h MetalSHEelectrons.h \ - VPSSMgr_Water_ConstVol.h VPSSMgr_Water_HKFT.h \ IdealSolidSolnPhase.h StoichSubstanceSSTP.h \ SingleSpeciesTP.h MineralEQ3.h PseudoBinaryVPSSTP.h \ - MargulesVPSSTP.cpp StoichSubstance.h + MargulesVPSSTP.h StoichSubstance.h cc_sources = State.cpp Elements.cpp Constituents.cpp Phase.cpp \ ThermoPhase.cpp IdealGasPhase.cpp ConstDensityThermo.cpp \ @@ -37,9 +36,9 @@ cc_sources = State.cpp Elements.cpp Constituents.cpp Phase.cpp \ PDSS_IonsFromNeutral.cpp IonsFromNeutralVPSSTP.cpp \ GibbsExcessVPSSTP.cpp LatticePhase.cpp IdealMolalSoln.cpp \ HMWSoln.cpp HMWSoln_input.cpp WaterSSTP.cpp \ - MetalSHEelectrons.cpp VPSSMgr_Water_ConstVol.cpp \ - VPSSMgr_Water_HKFT.cpp IdealSolidSolnPhase.cpp \ - StoichSubstanceSSTP.cpp SingleSpeciesTP.cpp MineralEQ3.cpp \ + MetalSHEelectrons.cpp \ + IdealSolidSolnPhase.cpp \ + SingleSpeciesTP.cpp MineralEQ3.cpp \ PseudoBinaryVPSSTP.cpp MargulesVPSSTP.cpp \ StoichSubstanceSSTP.cpp diff --git a/configure.ac b/configure.ac index 4d87b5ad5..4b6c6f62a 100644 --- a/configure.ac +++ b/configure.ac @@ -61,6 +61,7 @@ DX_INIT_DOXYGEN(cantera, doxygen/cantera.dox, docs) AC_OUTPUT(Makefile \ test_problems/Makefile \ + test_problems/ChemEquil_gri_matrix/Makefile \ test_problems/cathermo/Makefile \ test_problems/cathermo/DH_graph_1/Makefile \ test_problems/cathermo/DH_graph_acommon/Makefile \ @@ -91,8 +92,8 @@ AC_OUTPUT(Makefile \ ext/math/Makefile \ ext/blas/Makefile \ ext/cvode/Makefile \ - ext/lapack/Makefile \ - ext/f2c_libs/Makefile \ + ext/f2c_lapack/Makefile \ + ext/f2c_libs/Makefile \ Cantera/Makefile \ Cantera/user/Makefile \ Cantera/src/Makefile \ @@ -109,3 +110,7 @@ AC_OUTPUT(Makefile \ # FINAL SUMMARY AX_SUMMARIZE_CONFIG + +# ext/lapack/Makefile \ + + diff --git a/ext/Makefile.am b/ext/Makefile.am index 2027c66ca..dc70ad5a3 100644 --- a/ext/Makefile.am +++ b/ext/Makefile.am @@ -1,2 +1,2 @@ -SUBDIRS = tpx math cvode lapack blas f2c_libs +SUBDIRS = f2c_lapack tpx math cvode blas f2c_libs diff --git a/ext/f2c_lapack/CMakeLists.txt b/ext/f2c_lapack/CMakeLists.txt deleted file mode 100644 index 6b65c3df4..000000000 --- a/ext/f2c_lapack/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ - -SET (F2C_LAPACK_SRCS dgbtrf.c dgbtrs.c dgbtf2.c dgbsv.c - dgebd2.c dgebrd.c dgelq2.c dgelqf.c dgelss.c dgeqr2.c dgeqrf.c dgetf2.c - dgetrf.c dgetri.c dgetrs.c dlabad.c dlabrd.c dlacpy.c dlamch.c dlange.c - dlapy2.c dlarf.c dlarfb.c dlarfg.c dlarft.c dlartg.c dlas2.c dlascl.c dlaset.c - dlasq1.c dlasq2.c dlasq3.c dlasq4.c dlasq5.c dlasq6.c dlasr.c dlasrt.c - dlassq.c dlasv2.c dlaswp.c dorg2r.c dorgbr.c dorgl2.c dorglq.c dorgqr.c - dorm2r.c dormbr.c dorml2.c dormlq.c dormqr.c drscl.c dtrtri.c - dtrti2.c ieeeck.c ilaenv.c ) - -ADD_LIBRARY(ctlapack ${F2C_LAPACK_SRCS}) - - - diff --git a/ext/f2c_lapack/Makefile.am b/ext/f2c_lapack/Makefile.am new file mode 100644 index 000000000..aea174a0f --- /dev/null +++ b/ext/f2c_lapack/Makefile.am @@ -0,0 +1,27 @@ +cc_sources = dbdsqr.c dgbtrf.c dgbtf2.c dgbtrs.c dgbsv.c dgebd2.c dgebrd.c \ + dgelq2.c dgelqf.c dgelss.c dgeqr2.c dgeqrf.c dgetf2.c dgetrf.c \ + dgetri.c dgetrs.c dlabad.c dlabrd.c dlacpy.c dlamch.c dlange.c \ + dlapy2.c dlarf.c dlarfb.c dlarfg.c dlarft.c dlartg.c dlas2.c \ + dlascl.c dlaset.c dlasq1.c dlasq2.c dlasq3.c dlasq4.c dlasq5.c \ + dlasq6.c dlasr.c dlasrt.c dlassq.c dlasv2.c dlaswp.c dorg2r.c \ + dorgbr.c dorgl2.c dorglq.c dorgqr.c dorm2r.c dormbr.c dorml2.c \ + dormlq.c dormqr.c drscl.c dtrtri.c dtrti2.c ieeeck.c ilaenv.c + +h_sources = blaswrap.h + +AM_CPPFLAGS = -I../f2c_libs +AM_CXXFLAGS = $(AM_CPPFLAGS) +AM_FCFLAGS = $(AM_CPPFLAGS) + +lib_LTLIBRARIES = $(top_builddir)/build/lib/libctlapack.la +library_includedir = $(top_builddir)/build/include +library_include_HEADERS = $(h_sources) + +#----------------------- +# Cantera Converters C/C++ library +#----------------------- + +__top_builddir__build_lib_libctlapack_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) +__top_builddir__build_lib_libctlapack_la_SOURCES = $(cc_sources) $(h_sources) + +CLEANFILES = *.o diff --git a/ext/f2c_lapack/Makefile.in b/ext/f2c_lapack/Makefile.in deleted file mode 100755 index 732ad0f0d..000000000 --- a/ext/f2c_lapack/Makefile.in +++ /dev/null @@ -1,143 +0,0 @@ -#/bin/sh -# -# $Source: /cvsroot/cantera/cantera/ext/f2c_lapack/Makefile.in,v $ -# $Author: hkmoffa $ -# $Revision: 1.9 $ -# $Date: 2009/01/12 19:34:14 $ -# - -.SUFFIXES : -.SUFFIXES : .c .o .d - -do_ranlib = @DO_RANLIB@ - -PURIFY=@PURIFY@ - -# the directory where the Cantera libraries are located -CANTERA_LIBDIR=@buildlib@ - -# the C++ compiler -CXX = @CXX@ - -# the C compiler -CC = @CC@ - -# C++ compile flags -PIC_FLAG=@PIC@ -CXX_FLAGS = @CXXFLAGS@ $(PIC_FLAG) - -# C compile flags -CFLAGS = @CFLAGS@ $(PIC_FLAG) - -# Local include files -CXX_INCLUDES=-I../f2c_libs - -# How to compile the dependency file -.c.d: - @CXX_DEPENDS@ $(CFLAGS) $(CXX_INCLUDES) $*.c > $*.d - -.c.o: - $(PURIFY) @CC@ -c $< $(CFLAGS) $(CXX_INCLUDES) - -# ----------------------------------------------- - -LAPACKLIB = @buildlib@/libctlapack.a - -all: $(LAPACKLIB) - -OBJS = \ -dbdsqr.o \ -dgbtrf.o \ -dgbtf2.o \ -dgbtrs.o \ -dgbsv.o \ -dgebd2.o \ -dgebrd.o \ -dgelq2.o \ -dgelqf.o \ -dgelss.o \ -dgeqr2.o \ -dgeqrf.o \ -dgetf2.o \ -dgetrf.o \ -dgetri.o \ -dgetrs.o \ -dlabad.o \ -dlabrd.o \ -dlacpy.o \ -dlamch.o \ -dlange.o \ -dlapy2.o \ -dlarf.o \ -dlarfb.o \ -dlarfg.o \ -dlarft.o \ -dlartg.o \ -dlas2.o \ -dlascl.o \ -dlaset.o \ -dlasq1.o \ -dlasq2.o \ -dlasq3.o \ -dlasq4.o \ -dlasq5.o \ -dlasq6.o \ -dlasr.o \ -dlasrt.o \ -dlassq.o \ -dlasv2.o \ -dlaswp.o \ -dorg2r.o \ -dorgbr.o \ -dorgl2.o \ -dorglq.o \ -dorgqr.o \ -dorm2r.o \ -dormbr.o \ -dorml2.o \ -dormlq.o \ -dormqr.o \ -drscl.o \ -dtrtri.o \ -dtrti2.o \ -ieeeck.o \ -ilaenv.o - - -# list of source files -SRCS = $(OBJS:.o=.c) - -# List of dependency files to be created -DEPENDS=$(OBJS:.o=.d) - - -$(LAPACKLIB): $(OBJS) - @ARCHIVE@ $(LAPACKLIB) $(OBJS) > /dev/null -ifeq ($(do_ranlib),1) - @RANLIB@ $(LAPACKLIB) -endif -# ------------------------------------------------ -# Utility Targets - -clean: - $(RM) $(OBJS) $(LAPACKLIB) *.d .depends - - -# depends target -depends: - $(RM) *.d .depends - @MAKE@ .depends - -.depends: $(DEPENDS) - cat *.d > .depends - -$(OBJS): Makefile - -ifeq ($(wildcard .depends), .depends) -include .depends -endif - - - - - diff --git a/test_problems/ChemEquil_gri_matrix/Makefile.am b/test_problems/ChemEquil_gri_matrix/Makefile.am new file mode 100644 index 000000000..b1125ee3b --- /dev/null +++ b/test_problems/ChemEquil_gri_matrix/Makefile.am @@ -0,0 +1,23 @@ +cc_sources = gri_matrix.cpp + +INC = -I. -I$(top_builddir)/build/include/ -I$(top_builddir)/build/include/cantera -I$(top_builddir)/build/include/cantera/kernel +AM_CPPFLAGS = $(INC) +AM_CXXFLAGS = $(AM_CPPFLAGS) + +LINK = -luser -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo +LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode +LINK += -lctlapack -lctblas -lctf2c -lctcxx -lm -lctf2c -lstdc++ +AM_LDFLAGS = -L/workspace/src/cantera/pecos_autotools/build/lib/ +LIBS = $(LINK) + +bin_PROGRAMS = gri_matrix +library_includedir = $(INC) + +#----------------------- +# Cantera DH graph test +#----------------------- + +gri_matrix_SOURCES = $(cc_sources) + +TESTS_ENVIRONMENT = +TESTS = runtest diff --git a/test_problems/ChemEquil_gri_matrix/Makefile.in b/test_problems/ChemEquil_gri_matrix/Makefile.in deleted file mode 100644 index 2054185f3..000000000 --- a/test_problems/ChemEquil_gri_matrix/Makefile.in +++ /dev/null @@ -1,139 +0,0 @@ -#!/bin/sh - -############################################################################ -# -# Makefile to compile and link a C++ application to -# Cantera. -# -############################################################################# - -# addition to suffixes -.SUFFIXES : .d - -# the name of the executable program to be created -PROG_NAME = gri_matrix - -# the object files to be linked together. List those generated from Fortran -# and from C/C++ separately -OBJS = gri_matrix.o - -# additional flags to be passed to the linker. If your program -# requires other external libraries, put them here -LINK_OPTIONS = @EXTRA_LINK@ - -# This variable determines whether we are making this example in the -# build tree environment or in the install tree environment. -in_CanteraBuildTree = 1 - -############################################################################# - -# Check to see whether we are in the msvc++ environment -os_is_win = @OS_IS_WIN@ - -# Fortran libraries -ifeq (@build_with_f2c@, 0) -FORT_LIBS = @FLIBS@ -else -FORT_LIBS = -endif - -# the C++ compiler -CXX = @CXX@ - -# the directory where Cantera include files may be found. -ifeq ($(in_CanteraBuildTree),1) -CANTERA_INCROOTDIR=@ctroot@/build/include -else -CANTERA_INCROOTDIR=@ct_incroot@ -endif -CANTERA_INCLUDES=-I$(CANTERA_INCROOTDIR) -I$(CANTERA_INCROOTDIR)/cantera - -# LOCAL_DEFS = -DDEBUG_CHEMEQUIL -# LOCAL_DEFS = -DEBUG_BASISOPTIMIZE -# -# C++ compile flags -CXX_FLAGS = @CXXFLAGS@ $(CANTERA_INCLUDES) $(LOCAL_DEFS) @CXX_INCLUDES@ - -# Ending C++ linking libraries -LCXX_END_LIBS = @LCXX_END_LIBS@ - -# the directory where the Cantera libraries are located -ifeq ($(in_CanteraBuildTree),1) -CANTERA_LIBDIR=@buildlib@ -else -CANTERA_LIBDIR=@ct_libdir@ -endif - -# required Cantera libraries -# -> don't need this: -L$(CANTERA_LIBDIR) as -# @LOCAL_LIB_DIRS@ has this directory -# -CANTERA_LIBS = -L$(CANTERA_LIBDIR) @LOCAL_LIBS@ -lctcxx - -ifeq ($(in_CanteraBuildTree),1) -CANTERA_LIBS_DEP = @LOCAL_LIBS_DEP@ $(CANTERA_LIBDIR)/libctcxx.a -else -CANTERA_LIBS_DEP = @INSTALL_LIBS_DEP@ $(CANTERA_LIBDIR)/libctcxx.a -endif - -# -# Alternate form of dependencies: (uses a gnu make extensions) -ALT_LIBS_DEP := $(addprefix $(CANTER_LIBDIR), @RAW_LIBS_DEP@ libctcxx.a) - -# flags passed to the C++ compiler/linker for the linking step -LCXX_FLAGS = @CXXFLAGS@ @LOCAL_LIB_DIRS@ - -# How to compile C++ source files to object files -# -> don't need this: @CXX_INCLUDES@ -.cpp.o: - $(CXX) -c $< $(CXX_FLAGS) - -# How to compile the dependency file -.cpp.d: - @CXX_DEPENDS@ $(CXX_FLAGS) $*.cpp > $*.d - -# List of dependency files to be created -DEPENDS=$(OBJS:.o=.d) - -# Program Name -PROGRAM = $(PROG_NAME)$(EXE_EXT) - -all: $(PROGRAM) - -$(PROGRAM): $(OBJS) $(CANTERA_LIBS_DEP) - $(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(LINK_OPTIONS) \ - $(CANTERA_LIBS) @LIBS@ $(FORT_LIBS) \ - $(LCXX_END_LIBS) - -# Add an additional target for stability: -$(OBJS): $(CANTERA_LIBDIR)/libctbase.a $(CANTERA_LIBDIR)/libthermo.a - -# depends target -> forces recalculation of dependencies -depends: - $(RM) *.d .depends - @MAKE@ .depends - -.depends: $(DEPENDS) - cat *.d > .depends - -# Do the test -> For the windows vc++ environment, we have to skip checking on -# whether the program is uptodate, because we don't utilize make -# in that environment to build programs. -test: -ifeq ($(os_is_win), 1) -else - @ @MAKE@ -s $(PROGRAM) -endif - @ ./runtest - -clean: - $(RM) $(OBJS) $(PROGRAM) $(DEPENDS) .depends - ../../bin/rm_cvsignore - (if test -d SunWS_cache ; then \ - $(RM) -rf SunWS_cache ; \ - fi ) - -ifeq ($(wildcard .depends), .depends) -include .depends -endif - diff --git a/test_problems/Makefile.am b/test_problems/Makefile.am index 448b922a3..02df28646 100644 --- a/test_problems/Makefile.am +++ b/test_problems/Makefile.am @@ -5,7 +5,7 @@ ChemEquil_ionizedGas ChemEquil_red1 CpJump \ mixGasTransport multiGasTransport printUtilUnitTest -SUBDIRS = cathermo +SUBDIRS = cathermo ChemEquil_gri_matrix # # would be good to add: #