Fixed an error in linking Cantera when SUNDIALS is used.
This changes removes a nonstandard include cpp implementation that was the cause of the error. Now the CVode or sundials choice is implemented within the makefile.
This commit is contained in:
parent
5285487f8f
commit
ce4c00c749
2 changed files with 25 additions and 13 deletions
|
|
@ -22,6 +22,8 @@ else
|
|||
DEBUG_FLAG=
|
||||
endif
|
||||
|
||||
use_sundials=@use_sundials@
|
||||
|
||||
SUNDIALS_INC=@sundials_include@
|
||||
|
||||
PURIFY=@PURIFY@
|
||||
|
|
@ -34,20 +36,32 @@ NUMERICS_OBJ = DenseMatrix.o funcs.o Func1.o \
|
|||
ODE_integrators.o BandMatrix.o DAE_solvers.o \
|
||||
funcs.o sort.o
|
||||
|
||||
NUMERICS_H = ArrayViewer.h CVode.h CVodesIntegrator.h DenseMatrix.h \
|
||||
NUMERICS_H = 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
|
||||
|
||||
ifeq ($(use_sundials), 1)
|
||||
ODEPACKAGE_H = CVodesIntegrator.h
|
||||
ODEPACKAGE_OBJ = CVodesIntegrator.o
|
||||
else
|
||||
ODEPACKAGE_H = CVode.h
|
||||
ODEPACKAGE_OBJ = CVode.o
|
||||
endif
|
||||
|
||||
TOTAL_H = $(NUMERICS_H) $(ODEPACKAGE_H)
|
||||
TOTAL_OBJ = $(NUMERICS_OBJ) $(ODEPACKAGE_OBJ)
|
||||
|
||||
TTOTAL_H = $(NUMERICS_H) CVode.h CVodesIntegrator.h
|
||||
|
||||
CXX_INCLUDES = -I../base
|
||||
LIB = @buildlib@/libctnumerics.a
|
||||
|
||||
DEPENDS = $(NUMERICS_OBJ:.o=.d)
|
||||
DEPENDS = $(TOTAL_OBJ:.o=.d)
|
||||
|
||||
all: .depends $(LIB)
|
||||
@(@INSTALL@ -d $(INCDIR))
|
||||
@(for lh in $(NUMERICS_H) ; do \
|
||||
@(for lh in $(TOTAL_H) ; do \
|
||||
$(INSTALL_TSC) "$${lh}" $(INCDIR) ; \
|
||||
done)
|
||||
%.d: Makefile %.o
|
||||
|
|
@ -56,8 +70,8 @@ all: .depends $(LIB)
|
|||
.cpp.o:
|
||||
$(PURIFY) @CXX@ -c $< $(CXX_FLAGS) $(CXX_INCLUDES)
|
||||
|
||||
$(LIB): $(NUMERICS_OBJ) $(NUMERICS_H)
|
||||
@ARCHIVE@ $(LIB) $(NUMERICS_OBJ) > /dev/null
|
||||
$(LIB): $(TOTAL_OBJ) $(TOTAL_H)
|
||||
@ARCHIVE@ $(LIB) $(TOTAL_OBJ) > /dev/null
|
||||
ifeq ($(do_ranlib),1)
|
||||
@RANLIB@ $(LIB)
|
||||
endif
|
||||
|
|
@ -65,18 +79,20 @@ endif
|
|||
ODE_integrators.o:
|
||||
$(PURIFY) @CXX@ -c ODE_integrators.cpp $(CXX_INCLUDES) $(SUNDIALS_INC) \
|
||||
$(CXX_FLAGS)
|
||||
|
||||
ODE_integrators.d: ODE_integrators.cpp Makefile
|
||||
@CXX_DEPENDS@ $(CXX_FLAGS) ODE_integrators.cpp $(CXX_INCLUDES) $(SUNDIALS_INC) \
|
||||
> ODE_integrators.d
|
||||
|
||||
DAE_solvers.o: DAE_solvers.cpp
|
||||
$(PURIFY) @CXX@ -c DAE_solvers.cpp $(CXX_INCLUDES) $(SUNDIALS_INC) $(CXX_FLAGS)
|
||||
|
||||
DAE_solvers.d: DAE_solvers.cpp Makefile
|
||||
@CXX_DEPENDS@ $(CXX_FLAGS) DAE_solvers.cpp $(CXX_INCLUDES) $(SUNDIALS_INC) \
|
||||
> DAE_solvers.d
|
||||
|
||||
clean:
|
||||
@(for lh in dummy.h $(NUMERICS_H) ; do \
|
||||
@(for lh in dummy.h $(TTOTAL_H) ; do \
|
||||
th=$(INCDIR)/"$${lh}" ; \
|
||||
if test -f "$${th}" ; then \
|
||||
$(RM) "$${th}" ; \
|
||||
|
|
@ -87,7 +103,7 @@ clean:
|
|||
$(RM) $(LIB) ; \
|
||||
echo "$(RM) $(LIB)" ; \
|
||||
fi)
|
||||
$(RM) *.o *~ .depends *.d
|
||||
$(RM) *.o *~ .depends *.d *.a
|
||||
(if test -d SunWS_cache ; then \
|
||||
$(RM) -rf SunWS_cache ; \
|
||||
fi )
|
||||
|
|
|
|||
|
|
@ -1,15 +1,11 @@
|
|||
#include "ct_defs.h"
|
||||
#include "Integrator.h"
|
||||
|
||||
#define NO_SUNDIALS
|
||||
#ifdef NO_SUNDIALS
|
||||
#undef HAS_SUNDIALS
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SUNDIALS
|
||||
#include "CVodesIntegrator.cpp"
|
||||
#include "CVodesIntegrator.h"
|
||||
#else
|
||||
#include "CVode.cpp"
|
||||
#include "CVode.h"
|
||||
#endif
|
||||
|
||||
namespace Cantera {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue