python3Packages.pythran: 0.9.12 -> 0.11.0, clean up a bit
Unbreaks latest scipy. Refreshed patch, removed line noise, removed/updated some old test stuff.
This commit is contained in:
parent
4f8a04f180
commit
2610551643
|
@ -1,64 +1,79 @@
|
||||||
From 208fe98f10c580a5a2fb6a8cfdd56de109073925 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Frederik Rietdijk <fridh@fridh.nl>
|
|
||||||
Date: Sat, 17 Jul 2021 18:36:27 +0200
|
|
||||||
Subject: [PATCH] hardcode path to libgomp
|
|
||||||
|
|
||||||
---
|
|
||||||
omp/__init__.py | 40 ++++------------------------------------
|
|
||||||
1 file changed, 4 insertions(+), 36 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/omp/__init__.py b/omp/__init__.py
|
diff --git a/omp/__init__.py b/omp/__init__.py
|
||||||
index bddae3063..9ba3678d8 100644
|
index 3801d1c8c..a93a74d6f 100644
|
||||||
--- a/omp/__init__.py
|
--- a/omp/__init__.py
|
||||||
+++ b/omp/__init__.py
|
+++ b/omp/__init__.py
|
||||||
@@ -69,43 +69,11 @@ class OpenMP(object):
|
@@ -48,72 +48,8 @@ class OpenMP(object):
|
||||||
|
return ['omp', 'gomp', 'iomp5']
|
||||||
|
|
||||||
def init_not_msvc(self):
|
def init_not_msvc(self):
|
||||||
""" Find OpenMP library and try to load if using ctype interface. """
|
- """ Find OpenMP library and try to load if using ctype interface. """
|
||||||
- # find_library() does not search automatically LD_LIBRARY_PATH
|
- # find_library() does not automatically search LD_LIBRARY_PATH
|
||||||
- paths = os.environ.get('LD_LIBRARY_PATH', '').split(':')
|
- # until Python 3.6+, so we explicitly add it.
|
||||||
+ libgomp_path = "@gomp@"
|
- # LD_LIBRARY_PATH is used on Linux, while macOS uses DYLD_LIBRARY_PATH
|
||||||
|
- # and DYLD_FALLBACK_LIBRARY_PATH.
|
||||||
- for libomp_name in self.get_libomp_names():
|
- env_vars = []
|
||||||
- if cxx is None or sys.platform == 'win32':
|
- if sys.platform == 'darwin':
|
||||||
- # Note: Clang supports -print-file-name, but not yet for
|
- env_vars = ['DYLD_LIBRARY_PATH', 'DYLD_FALLBACK_LIBRARY_PATH']
|
||||||
- # clang-cl as of v12.0.0 (April '21)
|
|
||||||
- continue
|
|
||||||
-
|
|
||||||
- cmd = [cxx, '-print-file-name=' + libomp_name]
|
|
||||||
- # the subprocess can fail in various ways in that case just give up
|
|
||||||
- try:
|
|
||||||
- path = os.path.dirname(check_output(cmd).decode().strip())
|
|
||||||
- if path:
|
|
||||||
- paths.append(path)
|
|
||||||
- except (OSError, CalledProcessError):
|
|
||||||
- pass
|
|
||||||
-
|
|
||||||
- # Try to load find libgomp shared library using loader search dirs
|
|
||||||
- libgomp_path = find_library("gomp")
|
|
||||||
-
|
|
||||||
- # Try to use custom paths if lookup failed
|
|
||||||
- for path in paths:
|
|
||||||
- if libgomp_path:
|
|
||||||
- break
|
|
||||||
- path = path.strip()
|
|
||||||
- if os.path.isdir(path):
|
|
||||||
- libgomp_path = find_library(os.path.join(str(path), "libgomp"))
|
|
||||||
-
|
|
||||||
- if not libgomp_path:
|
|
||||||
- raise ImportError("I can't find a shared library for libgomp,"
|
|
||||||
- " you may need to install it or adjust the "
|
|
||||||
- "LD_LIBRARY_PATH environment variable.")
|
|
||||||
- else:
|
- else:
|
||||||
- # Load the library (shouldn't fail with an absolute path right?)
|
- env_vars = ['LD_LIBRARY_PATH']
|
||||||
- self.libomp = ctypes.CDLL(libgomp_path)
|
-
|
||||||
- self.version = 45
|
- paths = []
|
||||||
+ # Load the library (shouldn't fail with an absolute path right?)
|
- for env_var in env_vars:
|
||||||
+ self.libomp = ctypes.CDLL(libgomp_path)
|
- env_paths = os.environ.get(env_var, '')
|
||||||
|
- if env_paths:
|
||||||
|
- paths.extend(env_paths.split(os.pathsep))
|
||||||
|
-
|
||||||
|
-
|
||||||
|
- libomp_names = self.get_libomp_names()
|
||||||
|
-
|
||||||
|
- if cxx is not None:
|
||||||
|
- for libomp_name in libomp_names:
|
||||||
|
- cmd = [cxx,
|
||||||
|
- '-print-file-name=lib{}{}'.format(
|
||||||
|
- libomp_name,
|
||||||
|
- get_shared_lib_extension())]
|
||||||
|
- # The subprocess can fail in various ways, including because it
|
||||||
|
- # doesn't support '-print-file-name'. In that case just give up.
|
||||||
|
- try:
|
||||||
|
- output = check_output(cmd,
|
||||||
|
- stderr=DEVNULL)
|
||||||
|
- path = os.path.dirname(output.decode().strip())
|
||||||
|
- if path:
|
||||||
|
- paths.append(path)
|
||||||
|
- except (OSError, CalledProcessError):
|
||||||
|
- pass
|
||||||
|
-
|
||||||
|
-
|
||||||
|
- for libomp_name in libomp_names:
|
||||||
|
- # Try to load find libomp shared library using loader search dirs
|
||||||
|
- libomp_path = find_library(libomp_name)
|
||||||
|
-
|
||||||
|
- # Try to use custom paths if lookup failed
|
||||||
|
- if not libomp_path:
|
||||||
|
- for path in paths:
|
||||||
|
- candidate_path = os.path.join(
|
||||||
|
- path,
|
||||||
|
- 'lib{}{}'.format(libomp_name,
|
||||||
|
- get_shared_lib_extension()))
|
||||||
|
- if os.path.isfile(candidate_path):
|
||||||
|
- libomp_path = candidate_path
|
||||||
|
- break
|
||||||
|
-
|
||||||
|
- # Load the library
|
||||||
|
- if libomp_path:
|
||||||
|
- try:
|
||||||
|
- self.libomp = ctypes.CDLL(libomp_path)
|
||||||
|
- except OSError:
|
||||||
|
- raise ImportError("found openMP library '{}' but couldn't load it. "
|
||||||
|
- "This may happen if you are cross-compiling.".format(libomp_path))
|
||||||
|
- self.version = 45
|
||||||
|
- return
|
||||||
|
-
|
||||||
|
- raise ImportError("I can't find a shared library for libomp, you may need to install it "
|
||||||
|
- "or adjust the {} environment variable.".format(env_vars[0]))
|
||||||
|
-
|
||||||
|
+ self.libomp = ctypes.CDLL("@gomp@")
|
||||||
+ self.version = 45
|
+ self.version = 45
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
"""
|
"""
|
||||||
--
|
|
||||||
2.32.0
|
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, openmp
|
, openmp
|
||||||
, pytest-runner
|
|
||||||
, ply
|
, ply
|
||||||
, networkx
|
, networkx
|
||||||
, decorator
|
, decorator
|
||||||
|
@ -11,8 +10,6 @@
|
||||||
, six
|
, six
|
||||||
, numpy
|
, numpy
|
||||||
, beniget
|
, beniget
|
||||||
, pytestCheckHook
|
|
||||||
, scipy
|
|
||||||
, isPy3k
|
, isPy3k
|
||||||
, substituteAll
|
, substituteAll
|
||||||
}:
|
}:
|
||||||
|
@ -22,13 +19,13 @@ let
|
||||||
|
|
||||||
in buildPythonPackage rec {
|
in buildPythonPackage rec {
|
||||||
pname = "pythran";
|
pname = "pythran";
|
||||||
version = "0.9.12";
|
version = "0.11.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "serge-sans-paille";
|
owner = "serge-sans-paille";
|
||||||
repo = "pythran";
|
repo = "pythran";
|
||||||
rev = version;
|
rev = version;
|
||||||
sha256 = "sha256-lQbVq4K/Q8RzlFhE+l3HPCmUGmauXawcKe31kfbUHsI=";
|
sha256 = "sha256-F9gUZOTSuiqvfGoN4yQqwUg9mnCeBntw5eHO7ZnjpzI=";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
|
@ -39,10 +36,6 @@ in buildPythonPackage rec {
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
pytest-runner
|
|
||||||
];
|
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
ply
|
ply
|
||||||
networkx
|
networkx
|
||||||
|
@ -62,14 +55,7 @@ in buildPythonPackage rec {
|
||||||
"pythran.spec"
|
"pythran.spec"
|
||||||
];
|
];
|
||||||
|
|
||||||
checkInputs = [
|
# Test suite is huge and has a circular dependency on scipy.
|
||||||
pytestCheckHook
|
|
||||||
numpy
|
|
||||||
scipy
|
|
||||||
];
|
|
||||||
|
|
||||||
# Test suite is huge.
|
|
||||||
# Also, in the future scipy will rely on it resulting in a circular test dependency
|
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
disabled = !isPy3k;
|
disabled = !isPy3k;
|
||||||
|
@ -79,5 +65,4 @@ in buildPythonPackage rec {
|
||||||
homepage = "https://github.com/serge-sans-paille/pythran";
|
homepage = "https://github.com/serge-sans-paille/pythran";
|
||||||
license = lib.licenses.bsd3;
|
license = lib.licenses.bsd3;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue