From ee0fe68e16c5d464d3b19f42365d5cf6114df283 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Thu, 23 Feb 2012 21:24:48 +0000 Subject: [PATCH] Fixes for building shared libraries on OS X. --- src/SConscript | 5 +++++ src/python/SConscript | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/SConscript b/src/SConscript index 23c9ed671..67906e206 100644 --- a/src/SConscript +++ b/src/SConscript @@ -56,6 +56,11 @@ inst = localenv.Install('$inst_libdir', lib) buildTargets.extend(lib) installTargets.extend(inst) +# OS X requires the shared libraries at link time +if localenv['OS'] == 'Darwin' and localenv['use_sundials'] == 'y': + localenv.Append(LIBS=['sundials_cvodes', 'sundials_nvecserial'], + LIBPATH=localenv['sundials_libdir']) + # Build the Cantera shared library lib = localenv.SharedLibrary('../lib/cantera_shared', libraryTargets, SPAWN=getSpawn(localenv)) diff --git a/src/python/SConscript b/src/python/SConscript index 08d826a85..230bb69c1 100644 --- a/src/python/SConscript +++ b/src/python/SConscript @@ -36,6 +36,12 @@ if localenv['python_package'] == 'full': if localenv['toolchain'] == 'mingw': pylinklibs.append('python%s' % gcv('VERSION')) + # OS X requires library dependencies to be specified at link time + if localenv['OS'] == 'Darwin': + pylinklibs.append('python%s' % gcv('VERSION')) + if localenv['use_sundials'] == 'y': + pylinklibs.extend(['sundials_cvodes', 'sundials_nvecserial']) + pymodule = localenv.SharedLibrary('#interfaces/python/Cantera/_cantera', ['pycantera.cpp'], LIBS=pylinklibs,