39 lines
1.4 KiB
Python
39 lines
1.4 KiB
Python
from buildutils import *
|
|
|
|
Import('env', 'build', 'config_h')
|
|
localenv = env.Clone()
|
|
|
|
# (subdir, library name, (file extensions))
|
|
libs = [('tpx','tpx',('cpp')),
|
|
('math', 'ctmath', ('cpp','c','f'))]
|
|
|
|
|
|
if env['build_with_f2c']:
|
|
# Create arith.h using the arithchk program
|
|
arithenv = env.Clone()
|
|
arithenv.Append(LINKFLAGS='-lm', CPPFLAGS='-DNO_FPINIT') # TODO: make link flag more general
|
|
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(build))
|
|
|
|
# Possibly system-depenent headers
|
|
localenv.Command('f2c_libs/signal1.h', 'f2c_libs/signal1.h0', CopyNoPrefix(build))
|
|
localenv.Command('f2c_libs/sysdep1.h', 'f2c_libs/sysdep1.h0', CopyNoPrefix(build))
|
|
|
|
libs.append(('f2c_libs', 'f2c', 'c'))
|
|
|
|
if env['BUILD_BLAS_LAPACK']:
|
|
libs.append(('f2c_blas', 'ctblas', ('c')))
|
|
libs.append(('f2c_lapack', 'ctlapack', ('c')))
|
|
|
|
else:
|
|
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))
|