summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Davydov <davydden@gmail.com>2016-11-16 15:29:08 +0100
committerTodd Gamblin <tgamblin@llnl.gov>2016-11-16 07:29:08 -0700
commita5fb33b0e4d67408fdb4a685925b62db823d98d2 (patch)
treee4b2630e3e2313f3d8d20ca2ec5b99d5e1c44748
parent2611cbed4042927e6afba07dd6d3a354cee4898e (diff)
downloadspack-a5fb33b0e4d67408fdb4a685925b62db823d98d2.tar.gz
spack-a5fb33b0e4d67408fdb4a685925b62db823d98d2.tar.bz2
spack-a5fb33b0e4d67408fdb4a685925b62db823d98d2.tar.xz
spack-a5fb33b0e4d67408fdb4a685925b62db823d98d2.zip
python: symlink lib64/python2.7/lib-dynload/ to lib/python2.7/lib-dynload/ (#2295)
-rw-r--r--var/spack/repos/builtin/packages/python/package.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py
index 370e14b2ae..bf34b83c99 100644
--- a/var/spack/repos/builtin/packages/python/package.py
+++ b/var/spack/repos/builtin/packages/python/package.py
@@ -134,6 +134,25 @@ class Python(Package):
self.filter_compilers(spec, prefix)
+ # TODO:
+ # On OpenSuse 13, python uses <prefix>/lib64/python2.7/lib-dynload/*.so
+ # instead of <prefix>/lib/python2.7/lib-dynload/*.so. Oddly enough the
+ # result is that Python can not find modules like cPickle. A workaround
+ # for now is to symlink to `lib`:
+ src = os.path.join(prefix,
+ 'lib64',
+ 'python{0}'.format(self.version.up_to(2)),
+ 'lib-dynload')
+ dst = os.path.join(prefix,
+ 'lib',
+ 'python{0}'.format(self.version.up_to(2)),
+ 'lib-dynload')
+ if os.path.isdir(src) and not os.path.isdir(dst):
+ mkdirp(dst)
+ for f in os.listdir(src):
+ os.symlink(os.path.join(src, f),
+ os.path.join(dst, f))
+
# TODO: Once better testing support is integrated, add the following tests
# https://wiki.python.org/moin/TkInter
#