diff options
author | Adam J. Stewart <ajstewart426@gmail.com> | 2021-08-22 02:02:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-22 09:02:21 +0200 |
commit | a68701c63652d1ed5cc5106916fd78afdd4ddd28 (patch) | |
tree | eb4f813dfb3d11bacdab7cd1b71066ad7614c6a6 | |
parent | 1212847eeea7ce2b65bf0b439b8c3375e2d722f3 (diff) | |
download | spack-a68701c63652d1ed5cc5106916fd78afdd4ddd28.tar.gz spack-a68701c63652d1ed5cc5106916fd78afdd4ddd28.tar.bz2 spack-a68701c63652d1ed5cc5106916fd78afdd4ddd28.tar.xz spack-a68701c63652d1ed5cc5106916fd78afdd4ddd28.zip |
py-pythran: add OpenMP dependency (#25137)
-rw-r--r-- | var/spack/repos/builtin/packages/py-pythran/package.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/py-pythran/package.py b/var/spack/repos/builtin/packages/py-pythran/package.py index 121eee704c..9042ec0326 100644 --- a/var/spack/repos/builtin/packages/py-pythran/package.py +++ b/var/spack/repos/builtin/packages/py-pythran/package.py @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import sys + from spack import * @@ -42,3 +44,33 @@ class PyPythran(PythonPackage): depends_on('py-beniget@0.2.1:0.2.999', when='@0.9.6', type=('build', 'run')) depends_on('py-beniget@0.2.0:', when='@0.9.4:0.9.5', type=('build', 'run')) depends_on('py-beniget', when='@:0.9.3', type=('build', 'run')) + depends_on('llvm-openmp', when='%apple-clang', type=('build', 'run')) + + patch('https://patch-diff.githubusercontent.com/raw/serge-sans-paille/pythran/pull/1856.patch', + sha256='18f5e8985d636ad9c73b2f96b601aae299e0c315aa4c0dbee7b2599a63177218', + when='@0.9.10:0.9.12') + + def patch(self): + # Compiler is used at run-time to determine name of OpenMP library to search for + cfg_file = join_path('pythran', 'pythran-{0}.cfg'.format(sys.platform)) + filter_file('CXX=', 'CXX=' + self.compiler.cxx, cfg_file) + + def setup_build_environment(self, env): + # Needed for `spack install --test=root py-pythran` + if self.spec.satisfies('%apple-clang'): + env.prepend_path( + 'DYLD_FALLBACK_LIBRARY_PATH', + self.spec['llvm-openmp'].libs.directories[0] + ) + + def setup_run_environment(self, env): + # Needed for `spack test run py-pythran` + self.setup_build_environment(env) + + def setup_dependent_build_environment(self, env, dependent_spec): + # Needed for `spack install py-scipy` + self.setup_build_environment(env) + + def setup_dependent_run_environment(self, env, dependent_spec): + # Probably needed for something? + self.setup_build_environment(env) |