Added example SConstruct files to install with F77/F90 sample programs
This commit is contained in:
parent
50d799aa1a
commit
c3398e7a3e
5 changed files with 58 additions and 11 deletions
21
SConstruct
21
SConstruct
|
|
@ -1017,13 +1017,6 @@ if env['f90_interface'] == 'y':
|
|||
VariantDir('build/src/fortran/', 'src/fortran', duplicate=1)
|
||||
SConscript('build/src/fortran/SConscript')
|
||||
|
||||
if env['addInstallTargets']:
|
||||
# install F90 / F77 samples
|
||||
inst = env.RecursiveInstall(pjoin('$inst_sampledir', 'f77'), 'samples/f77')
|
||||
installTargets.extend(inst)
|
||||
inst = env.RecursiveInstall(pjoin('$inst_sampledir', 'f90'), 'samples/f90')
|
||||
installTargets.extend(inst)
|
||||
|
||||
VariantDir('build/src', 'src', duplicate=0)
|
||||
SConscript('build/src/SConscript')
|
||||
|
||||
|
|
@ -1044,14 +1037,24 @@ if env['build_docs']:
|
|||
|
||||
if 'samples' in COMMAND_LINE_TARGETS or 'install' in COMMAND_LINE_TARGETS:
|
||||
SConscript('samples/cxx/SConscript')
|
||||
if env['f90_interface'] == 'y':
|
||||
SConscript('samples/f77/SConscript')
|
||||
|
||||
# Install C++ samples
|
||||
inst = env.RecursiveInstall(pjoin('$inst_sampledir', 'cxx'),
|
||||
'samples/cxx')
|
||||
installTargets.extend(inst)
|
||||
|
||||
if env['f90_interface'] == 'y':
|
||||
SConscript('samples/f77/SConscript')
|
||||
SConscript('samples/f90/SConscript')
|
||||
|
||||
if env['addInstallTargets'] and env['f90_interface'] == 'y':
|
||||
# install F90 / F77 samples
|
||||
inst = env.RecursiveInstall(pjoin('$inst_sampledir', 'f77'), 'samples/f77')
|
||||
installTargets.extend(inst)
|
||||
inst = env.RecursiveInstall(pjoin('$inst_sampledir', 'f90'), 'samples/f90')
|
||||
installTargets.extend(inst)
|
||||
|
||||
|
||||
### Meta-targets ###
|
||||
build_samples = Alias('samples', sampleTargets)
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,5 @@ for subdir, name, extensions in samples:
|
|||
localenv['tmpl_cantera_libdirs'] = repr([x for x in libdirs if x])
|
||||
localenv['tmpl_progname'] = name
|
||||
localenv['tmpl_sourcename'] = name + '.cpp'
|
||||
localenv['testvariable'] = incdirs
|
||||
|
||||
sconstruct = localenv.SubstFile(pjoin(subdir, 'SConstruct'), 'SConstruct.in')
|
||||
|
|
|
|||
|
|
@ -14,6 +14,19 @@ for program_name, fortran_sources in samples:
|
|||
fortran_sources + ftn_demo,
|
||||
CPPPATH=['#build/src/fortran', '#include'],
|
||||
LIBS=env['cantera_libs']+['cantera_fortran']+['stdc++'],
|
||||
LIBPATH=['#build/lib'],
|
||||
LIBPATH=[env['sundials_libdir'], '#build/lib'],
|
||||
LINK='$F77')
|
||||
sampleTargets.extend(prog)
|
||||
|
||||
# Generate SConstruct file to be installed
|
||||
incdirs = (localenv['ct_incroot'], localenv['sundials_include'],
|
||||
localenv['boost_inc_dir'])
|
||||
libs = (['cantera_fortran', 'cantera'] + localenv['sundials_libs'] +
|
||||
localenv['boost_libs'] + localenv['blas_lapack_libs'] + ['stdc++'])
|
||||
libdirs = (localenv['ct_libdir'], localenv['sundials_libdir'],
|
||||
localenv['blas_lapack_dir'], localenv['boost_lib_dir'])
|
||||
localenv['tmpl_cantera_incdirs'] = repr([x for x in incdirs if x])
|
||||
localenv['tmpl_cantera_libs'] = repr([x for x in libs if x])
|
||||
localenv['tmpl_cantera_libdirs'] = repr([x for x in libdirs if x])
|
||||
|
||||
sconstruct = localenv.SubstFile('SConstruct', 'SConstruct.in')
|
||||
|
|
|
|||
22
samples/f77/SConstruct.in
Normal file
22
samples/f77/SConstruct.in
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
env = Environment()
|
||||
|
||||
env['F77'] = '@F77@'
|
||||
env['CC'] = '@CC@'
|
||||
env.Append(FFLAGS='-g',
|
||||
CCFLAGS='-g',
|
||||
CPPPATH=@tmpl_cantera_incdirs@,
|
||||
LIBS=@tmpl_cantera_libs@,
|
||||
LIBPATH=@tmpl_cantera_libdirs@)
|
||||
|
||||
ctlib = env.Object('demo_ftnlib.cpp')
|
||||
|
||||
demo_obj = env.Object('demo.f')
|
||||
isentropic_obj = env.Object('isentropic.f')
|
||||
|
||||
demo = env.Program('demo', [ctlib, demo_obj],
|
||||
LINK='$F77')
|
||||
isentropic = env.Program('isentropic', [ctlib, isentropic_obj],
|
||||
LINK='$F77')
|
||||
|
||||
Default(demo)
|
||||
Default(isentropic)
|
||||
10
samples/f90/SConstruct.in
Normal file
10
samples/f90/SConstruct.in
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
env = Environment()
|
||||
|
||||
env['F90'] = '@F90@'
|
||||
env.Append(FFLAGS='-g',
|
||||
F90PATH=@tmpl_cantera_incdirs@,
|
||||
LIBS=@tmpl_cantera_libs@,
|
||||
LIBPATH=@tmpl_cantera_libdirs@)
|
||||
|
||||
program = env.Program('@tmpl_progname@', '@tmpl_sourcename@')
|
||||
Default(program)
|
||||
Loading…
Add table
Reference in a new issue