From 5071b9bbcf43c025ef2e34e4043fc2fa4775f82d Mon Sep 17 00:00:00 2001 From: Anthony LaTorre Date: Mon, 11 Nov 2013 16:52:35 -0600 Subject: use local boost when building g4chroma.so --- setup.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 9c911da..9afd66b 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,17 @@ from setuptools import setup, find_packages, Extension import subprocess import os +libraries = ['boost_python'] +extra_objects = [] + +if 'VIRTUAL_ENV' in os.environ: + boost_lib = os.path.join(os.environ['VIRTUAL_ENV'],'lib','libboost_python.so') + print boost_lib + if os.path.exists(boost_lib): + # use local copy of boost + extra_objects.append(boost_lib) + libraries.remove('boost_python') + def check_output(*popenargs, **kwargs): if 'stdout' in kwargs: raise ValueError('stdout argument not allowed, it will be overridden.') @@ -60,14 +71,16 @@ setup( include_dirs=include_dirs, extra_compile_args=geant4_cflags, extra_link_args=geant4_libs+clhep_libs, - libraries=['boost_python'], + extra_objects=extra_objects, + libraries=libraries, ), Extension('chroma.generator.mute', ['src/mute.cc'], include_dirs=include_dirs, extra_compile_args=geant4_cflags, extra_link_args=geant4_libs+clhep_libs, - libraries=['boost_python']), + extra_objects=extra_objects, + libraries=libraries), ], setup_requires = ['pyublas'], -- cgit