From 7ea0e143c5e923b80b0c3fa3db321cc93adf02fd Mon Sep 17 00:00:00 2001 From: Milton Woods Date: Mon, 29 May 2017 02:17:16 +1000 Subject: python: RPATH on Cray (#4209) * python: ensure that distutils sets valid compiler options for RPATH on cray * python: add cray-rpath patches for python@2.3:3.0.1 and python@3.1: * python: in patch(..., when="@a:b platform=c"), limit b must be specified * python: assume that python@4 will break the cray patches --- .../repos/builtin/packages/python/cray-rpath-2.3.patch | 12 ++++++++++++ .../repos/builtin/packages/python/cray-rpath-3.1.patch | 15 +++++++++++++++ var/spack/repos/builtin/packages/python/package.py | 4 ++++ 3 files changed, 31 insertions(+) create mode 100644 var/spack/repos/builtin/packages/python/cray-rpath-2.3.patch create mode 100644 var/spack/repos/builtin/packages/python/cray-rpath-3.1.patch (limited to 'var') diff --git a/var/spack/repos/builtin/packages/python/cray-rpath-2.3.patch b/var/spack/repos/builtin/packages/python/cray-rpath-2.3.patch new file mode 100644 index 0000000000..54a85cc64a --- /dev/null +++ b/var/spack/repos/builtin/packages/python/cray-rpath-2.3.patch @@ -0,0 +1,12 @@ +--- a/Lib/distutils/unixccompiler.py 2003-06-02 05:27:40.000000000 +1000 ++++ b/Lib/distutils/unixccompiler.py 2017-05-13 13:52:45.554213616 +1000 +@@ -208,7 +208,8 @@ + elif compiler[:3] == "gcc" or compiler[:3] == "g++": + return "-Wl,-R" + dir + else: +- return "-R" + dir ++ # Patched by spack to use gcc syntax by default: ++ return "-Wl,-R" + dir + + def library_option(self, lib): + return "-l" + lib diff --git a/var/spack/repos/builtin/packages/python/cray-rpath-3.1.patch b/var/spack/repos/builtin/packages/python/cray-rpath-3.1.patch new file mode 100644 index 0000000000..f203bbbaa5 --- /dev/null +++ b/var/spack/repos/builtin/packages/python/cray-rpath-3.1.patch @@ -0,0 +1,15 @@ +--- a/Lib/distutils/unixccompiler.py 2009-05-09 21:55:12.000000000 +1000 ++++ b/Lib/distutils/unixccompiler.py 2017-05-13 14:30:18.077518999 +1000 +@@ -299,10 +299,8 @@ + else: + return "-Wl,-R" + dir + else: +- # No idea how --enable-new-dtags would be passed on to +- # ld if this system was using GNU ld. Don't know if a +- # system like this even exists. +- return "-R" + dir ++ # Patched by spack to use gcc syntax by default: ++ return "-Wl,-R" + dir + + def library_option(self, lib): + return "-l" + lib diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index c5f0f23d6d..e7dede8ecc 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -92,6 +92,10 @@ class Python(AutotoolsPackage): # Patch does not work for Python 3.1 patch('ncurses.patch', when='@:2.8,3.2:') + # Ensure that distutils chooses correct compiler option for RPATH on cray: + patch('cray-rpath-2.3.patch', when="@2.3:3.0.1 platform=cray") + patch('cray-rpath-3.1.patch', when="@3.1:3.99 platform=cray") + _DISTUTIL_VARS_TO_SAVE = ['LDSHARED'] _DISTUTIL_CACHE_FILENAME = 'sysconfig.json' _distutil_vars = None -- cgit v1.2.3-70-g09d2