Files
cantera/ext/SConscript
Ray Speth 60a00546dc Added include directory for f2c code
Most f2c code needs the "f2c.h" file, which is only in the
ext/f2c_libs directory, but this error doesn't usually show up
because it is also in /usr/include on most Unix systems.
2011-12-14 19:34:04 +00:00

53 lines
1.9 KiB
Python

from buildutils import *
Import('env', 'buildDir', 'buildTargets', 'installTargets')
localenv = env.Clone()
# (subdir, library name, (file extensions))
libs = [('tpx','tpx',['cpp'])]
if env['build_with_f2c']:
libs.append(('f2c_math', 'ctmath', ['cpp','c']))
localenv.Append(CPPPATH=Dir('#ext/f2c_libs'))
if not localenv['HAS_TIMES_H']:
localenv.Append(CPPDEFINES=['USE_CLOCK'])
if not localenv['HAS_UNISTD_H']:
localenv.Append(CPPDEFINES=['MSDOS'])
# Create arith.h using the arithchk program
if not os.path.exists('arith.h'):
arithenv = env.Clone()
# TODO: make link flag more general
arithenv.Append(LINKFLAGS='-lm', CPPFLAGS='-DNO_FPINIT')
arithenv.Program('f2c_libs/arithchk/arithchk', source='f2c_libs/arithchk/arithchk.c')
arithenv.Command('arith.h', 'f2c_libs/arithchk/arithchk', '$SOURCE > $TARGET')
arithenv.Command('f2c_libs/arith.h', 'arith.h', CopyNoPrefix(buildDir))
# Possibly system-depenent headers
localenv.Command('f2c_libs/signal1.h', 'f2c_libs/signal1.h0', CopyNoPrefix(buildDir))
localenv.Command('f2c_libs/sysdep1.h', 'f2c_libs/sysdep1.h0', CopyNoPrefix(buildDir))
libs.append(('f2c_libs', 'ctf2c', 'c'))
if env['BUILD_BLAS_LAPACK']:
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')))
if env['use_sundials'] == 'n':
libs.append(('cvode', 'cvode', 'c'))
for subdir, libname, extensions in libs:
lib = localenv.Library(pjoin('../lib', libname),
source=mglob(localenv, subdir, *extensions))
inst = localenv.Install('$ct_libdir', lib)
buildTargets.extend(lib)
installTargets.extend(inst)