Skip to content

Commit

Permalink
[SCons] Fix compilation of f77 sample with clang+gfortran
Browse files Browse the repository at this point in the history
Compiling demo_ftnlib.cpp as a shared object (with -fPIC) fixes an
error about being unable to relocate some pthread-related symbol.
  • Loading branch information
speth committed Feb 4, 2021
1 parent a45afed commit 25f996d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions samples/f77/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ localenv['mak_stdlib'] = ['-l' + lib for lib in env['cxx_stdlib']]
samples = [('ctlib', ['ctlib.f']),
('isentropic', ['isentropic.f'])]

ftn_demo = localenv.Object('demo_ftnlib.cpp',
CPPPATH=['#include', localenv['boost_inc_dir'],
ftn_demo = localenv.SharedObject('demo_ftnlib.cpp',
CPPPATH=['#include', localenv['boost_inc_dir'],
localenv['extra_inc_dirs']])
for program_name, fortran_sources in samples:
buildSample(localenv.Program, program_name,
Expand Down
2 changes: 1 addition & 1 deletion samples/f77/SConstruct.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env.Append(FFLAGS='-g',
LINKFLAGS=@tmpl_cantera_linkflags@,
FRAMEWORKS=@tmpl_cantera_frameworks@)

ctlib = env.Object('demo_ftnlib.cpp')
ctlib = env.SharedObject('demo_ftnlib.cpp')

demo = env.Program('demo', [ctlib, 'demo.f'],
LINK='@FORTRAN_LINK@')
Expand Down

0 comments on commit 25f996d

Please sign in to comment.