summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMayeul d'Avezac <m.davezac@ucl.ac.uk>2016-10-25 16:10:52 +0100
committerTodd Gamblin <tgamblin@llnl.gov>2016-10-25 08:10:52 -0700
commit1928d8325948f00e88f6e01261fe607454beb530 (patch)
tree0310c6331a4bc72f0fa264b87fdaf304e74ce4fd
parentb27e78cd78dae11f7fa7cc2ba3849cfcff2e1880 (diff)
downloadspack-1928d8325948f00e88f6e01261fe607454beb530.tar.gz
spack-1928d8325948f00e88f6e01261fe607454beb530.tar.bz2
spack-1928d8325948f00e88f6e01261fe607454beb530.tar.xz
spack-1928d8325948f00e88f6e01261fe607454beb530.zip
Tells boost explictly about python libraries and headers (#2106)
* Tells boost explictly about libraries and headers Ideally, bjam would determine the libraries and headers from the executable. But it doesn't. This rigs a best guess for python libraries and headers. * Move glob import to top of file * variable name change: alllibs --> all_libs * Use dso suffix rather than hard-coded string * Use only MAJOR.MINOR when setting up python in bjam
-rw-r--r--var/spack/repos/builtin/packages/boost/package.py25
1 files changed, 22 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py
index 90fe28fc2c..309184101b 100644
--- a/var/spack/repos/builtin/packages/boost/package.py
+++ b/var/spack/repos/builtin/packages/boost/package.py
@@ -25,6 +25,7 @@
from spack import *
import sys
import os
+from glob import glob
class Boost(Package):
@@ -155,6 +156,26 @@ class Boost(Package):
# fallback to gcc if no toolset found
return 'gcc'
+ def bjam_python_line(self, spec):
+ from os.path import dirname, splitext
+ pydir = 'python%s.%s*' % spec['python'].version.version[:2]
+ incs = join_path(spec['python'].prefix.include, pydir, "pyconfig.h")
+ incs = glob(incs)
+ incs = " ".join([dirname(u) for u in incs])
+
+ pylib = 'libpython%s.%s*' % spec['python'].version.version[:2]
+ all_libs = join_path(spec['python'].prefix.lib, pylib)
+ libs = [u for u in all_libs if splitext(u)[1] == dso_suffix]
+ if len(libs) == 0:
+ libs = [u for u in all_libs if splitext(u)[1] == '.a']
+
+ libs = " ".join(libs)
+ return 'using python : %s : %s : %s : %s ;\n' % (
+ spec['python'].version.up_to(2),
+ join_path(spec['python'].prefix.bin, 'python'),
+ incs, libs
+ )
+
def determine_bootstrap_options(self, spec, withLibs, options):
boostToolsetId = self.determine_toolset(spec)
options.append('--with-toolset=%s' % boostToolsetId)
@@ -180,9 +201,7 @@ class Boost(Package):
f.write('using mpi : %s ;\n' %
join_path(spec['mpi'].prefix.bin, 'mpicxx'))
if '+python' in spec:
- f.write('using python : %s : %s ;\n' %
- (spec['python'].version.up_to(2),
- join_path(spec['python'].prefix.bin, 'python')))
+ f.write(self.bjam_python_line(spec))
def determine_b2_options(self, spec, options):
if '+debug' in spec: