summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony LaTorre <devnull@localhost>2013-11-11 16:52:35 -0600
committertlatorre <tlatorre@uchicago.edu>2021-05-09 08:42:39 -0700
commit5071b9bbcf43c025ef2e34e4043fc2fa4775f82d (patch)
tree3765eceec9ee0a0ce6c14c7e89354f7f0fe8ea2c
parent8d6178e1519980b12fb94c5637454ad048170d04 (diff)
downloadchroma-5071b9bbcf43c025ef2e34e4043fc2fa4775f82d.tar.gz
chroma-5071b9bbcf43c025ef2e34e4043fc2fa4775f82d.tar.bz2
chroma-5071b9bbcf43c025ef2e34e4043fc2fa4775f82d.zip
use local boost when building g4chroma.so
-rw-r--r--setup.py17
1 files 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'],