Fixed compilation of the Fortran 90 module
This commit is contained in:
parent
b8ac7f9ccb
commit
f65da5d277
2 changed files with 12 additions and 19 deletions
|
|
@ -887,13 +887,14 @@ Export('env', 'buildDir', 'buildTargets', 'libraryTargets',
|
|||
VariantDir('build/ext', 'ext', duplicate=0)
|
||||
SConscript('build/ext/SConscript')
|
||||
|
||||
# Fortran needs to come before src so that libraryTargets is fully populated
|
||||
if env['f90_interface'] == 'y':
|
||||
VariantDir('build/src/fortran/', 'src/fortran', duplicate=1)
|
||||
SConscript('build/src/fortran/SConscript')
|
||||
|
||||
VariantDir('build/src', 'src', duplicate=0)
|
||||
SConscript('build/src/SConscript')
|
||||
|
||||
if env['f90_interface'] == 'y':
|
||||
VariantDir('build/fortran/', 'src/fortran', duplicate=1)
|
||||
SConscript('build/src/fortran/SConscript')
|
||||
|
||||
if env['python_package'] in ('full','minimal'):
|
||||
SConscript('src/python/SConscript')
|
||||
|
||||
|
|
|
|||
|
|
@ -1,31 +1,23 @@
|
|||
from buildutils import *
|
||||
|
||||
Import('env', 'buildTargets', 'installTargets', 'demoTargets')
|
||||
Import('env', 'buildTargets', 'installTargets', 'demoTargets', 'libraryTargets')
|
||||
|
||||
localenv = env.Clone()
|
||||
localenv.Append(CPPPATH=['#include', '#src'])
|
||||
|
||||
f90_src = mglob(localenv, 'src', 'f90', 'cpp')
|
||||
f90_src = mglob(localenv, '.', 'f90', 'cpp')
|
||||
|
||||
artifacts = localenv.Object(f90_src)
|
||||
mods = [o for o in artifacts if o.path.endswith('.mod')]
|
||||
objs = [o for o in artifacts if not o.path.endswith('.mod')]
|
||||
objects = [o for o in artifacts if not o.path.endswith('.mod')]
|
||||
|
||||
lib = localenv.Library(target=pjoin('..','..','lib','fct'),
|
||||
source=objs)
|
||||
lib = localenv.Library(target=pjoin('..','..','lib','cantera_fortran'),
|
||||
source=objects)
|
||||
buildTargets.extend(lib)
|
||||
inst = localenv.Install('$inst_libdir', lib)
|
||||
installTargets.extend(inst)
|
||||
|
||||
installTargets.extend(localenv.Install('$inst_incdir', mods))
|
||||
|
||||
# Copy the mod files to the include directory
|
||||
for mod in mods:
|
||||
copy = localenv.Command(target=pjoin('..','..','include','cantera', mod.name),
|
||||
source=mod,
|
||||
action=Copy('$TARGET', '$SOURCE'))
|
||||
localenv.AddPostAction(lib, copy)
|
||||
buildTargets.extend(copy)
|
||||
|
||||
# (subdir, program name, [source extensions])
|
||||
demos = [('f77demos', 'ctlib', ['^ctlib.f']),
|
||||
('f77demos', 'isentropic', ['^isentropic.f'])]
|
||||
|
|
@ -34,7 +26,7 @@ ftn_demo = localenv.Object(pjoin('f77demos','demo_ftnlib.cpp'))
|
|||
for subdir, name, extensions in demos:
|
||||
prog = localenv.Program(pjoin(subdir, name),
|
||||
mglob(localenv, subdir, *extensions) + ftn_demo,
|
||||
LIBS=env['cantera_libs']+['fct']+['stdc++'],
|
||||
LIBS=env['cantera_libs']+['cantera_fortran']+['stdc++'],
|
||||
LINK='$F77')
|
||||
demoTargets.extend(prog)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue