Fixed compilation issues when compiling without Sundials
ctnumerics and the included CVODE had been broken
This commit is contained in:
parent
60a00546dc
commit
ef617af524
3 changed files with 32 additions and 20 deletions
|
|
@ -2,28 +2,37 @@ from buildutils import *
|
|||
|
||||
Import('env','buildTargets','installTargets')
|
||||
|
||||
def empty(env):
|
||||
pass
|
||||
def defaultSetup(env, subdir, extensions):
|
||||
return mglob(env, subdir, *extensions)
|
||||
|
||||
def equilSetup(env):
|
||||
def equilSetup(env, subdir, extensions):
|
||||
env.Append(CPPPATH=['#ext/f2c_libs'])
|
||||
return defaultSetup(env, subdir, extensions)
|
||||
|
||||
def numericsSetup(env, subdir, extensions):
|
||||
if env['use_sundials'] == 'y':
|
||||
remove = 'CVodeInt.cpp'
|
||||
else:
|
||||
remove = 'CVodesIntegrator.cpp'
|
||||
return [s for s in mglob(env, subdir, *extensions)
|
||||
if s.name != remove]
|
||||
|
||||
# (subdir, library name, (file extensions), (extra setup(env)))
|
||||
libs = [('base', 'ctbase', ['cpp'], empty),
|
||||
('thermo', 'thermo', ['cpp'], empty),
|
||||
libs = [('base', 'ctbase', ['cpp'], defaultSetup),
|
||||
('thermo', 'thermo', ['cpp'], defaultSetup),
|
||||
('equil', 'equil', ['cpp','c'], equilSetup),
|
||||
('converters', 'converters', ['cpp'], empty),
|
||||
('numerics', 'ctnumerics', ['cpp'], empty),
|
||||
('kinetics', 'kinetics', ['cpp'], empty),
|
||||
('transport', 'transport', ['cpp'], empty),
|
||||
('spectra', 'ctspectra', ['cpp'], empty),
|
||||
('oneD', 'oneD', ['cpp'], empty),
|
||||
('zeroD', 'zeroD', ['cpp'], empty),
|
||||
('converters', 'converters', ['cpp'], defaultSetup),
|
||||
('numerics', 'ctnumerics', ['cpp'], numericsSetup),
|
||||
('kinetics', 'kinetics', ['cpp'], defaultSetup),
|
||||
('transport', 'transport', ['cpp'], defaultSetup),
|
||||
('spectra', 'ctspectra', ['cpp'], defaultSetup),
|
||||
('oneD', 'oneD', ['cpp'], defaultSetup),
|
||||
('zeroD', 'zeroD', ['cpp'], defaultSetup),
|
||||
]
|
||||
|
||||
for subdir, libname, extensions, setup in libs:
|
||||
localenv = env.Clone()
|
||||
setup(localenv)
|
||||
source = setup(localenv, subdir, extensions)
|
||||
for header in mglob(localenv, subdir, 'h'):
|
||||
h = localenv.Command('../include/cantera/kernel/%s' % header.name, header,
|
||||
Copy('$TARGET', '$SOURCE'))
|
||||
|
|
@ -32,7 +41,7 @@ for subdir, libname, extensions, setup in libs:
|
|||
installTargets.extend(inst)
|
||||
|
||||
lib = localenv.Library(pjoin('../lib', libname),
|
||||
source=mglob(localenv, subdir, *extensions))
|
||||
source=source)
|
||||
inst = localenv.Install('$ct_libdir', lib)
|
||||
buildTargets.extend(lib)
|
||||
installTargets.extend(inst)
|
||||
|
|
|
|||
|
|
@ -616,8 +616,10 @@ linkLibs = ['clib','oneD','zeroD','equil','kinetics','transport',
|
|||
'thermo','ctnumerics','ctmath','tpx',
|
||||
'ctspectra','converters','ctbase']
|
||||
|
||||
if env['use_sundials']:
|
||||
if env['use_sundials'] == 'y':
|
||||
linkLibs.extend(('sundials_cvodes','sundials_nvecserial'))
|
||||
else:
|
||||
linkLibs.append('cvode')
|
||||
|
||||
linkLibs.extend(env['blas_lapack_libs'])
|
||||
|
||||
|
|
|
|||
|
|
@ -31,18 +31,19 @@ if env['build_with_f2c']:
|
|||
libs.append(('f2c_libs', 'ctf2c', 'c'))
|
||||
|
||||
if env['BUILD_BLAS_LAPACK']:
|
||||
libs.append(('f2c_blas', 'ctblas', ('c')))
|
||||
libs.append(('f2c_lapack', 'ctlapack', ('c')))
|
||||
libs.append(('f2c_blas', 'ctblas', ['c']))
|
||||
libs.append(('f2c_lapack', 'ctlapack', ['c']))
|
||||
|
||||
else:
|
||||
libs.append(('math', 'ctmath', ['cpp','c','f']))
|
||||
|
||||
if env['BUILD_BLAS_LAPACK']:
|
||||
libs.append(('blas', 'ctblas', ('f')))
|
||||
libs.append(('lapack', 'ctlapack', ('f')))
|
||||
libs.append(('blas', 'ctblas', ['f']))
|
||||
libs.append(('lapack', 'ctlapack', ['f']))
|
||||
|
||||
if env['use_sundials'] == 'n':
|
||||
libs.append(('cvode', 'cvode', 'c'))
|
||||
libs.append(('cvode/source', 'cvode', ['c']))
|
||||
localenv.Append(CPPPATH=Dir('#ext/cvode/include'))
|
||||
|
||||
for subdir, libname, extensions in libs:
|
||||
lib = localenv.Library(pjoin('../lib', libname),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue