summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoïc Pottier <48072795+lpottier@users.noreply.github.com>2023-01-17 04:43:35 -0800
committerGitHub <noreply@github.com>2023-01-17 13:43:35 +0100
commitff4cccbf6c89e28b20fd3e47475982d7dc701c4f (patch)
tree0c49af82ea0ddeaaf58e85b6fc19be4e6bdc4301
parent5074e72be8df8720cec9c1ff15a3a48027a94cdc (diff)
downloadspack-ff4cccbf6c89e28b20fd3e47475982d7dc701c4f.tar.gz
spack-ff4cccbf6c89e28b20fd3e47475982d7dc701c4f.tar.bz2
spack-ff4cccbf6c89e28b20fd3e47475982d7dc701c4f.tar.xz
spack-ff4cccbf6c89e28b20fd3e47475982d7dc701c4f.zip
faiss: fixed error when importing faiss python package (#34672)
This is only a work-around for the actual problem that Python is used to install libraries instead of CMake, so we end up with BUILD_RPATH not INSTALL_RPATHs. Signed-off-by: Loïc Pottier <pottier1@llnl.gov> Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
-rw-r--r--var/spack/repos/builtin/packages/faiss/package.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/faiss/package.py b/var/spack/repos/builtin/packages/faiss/package.py
index f26a1023dd..c16f490c0f 100644
--- a/var/spack/repos/builtin/packages/faiss/package.py
+++ b/var/spack/repos/builtin/packages/faiss/package.py
@@ -22,7 +22,7 @@ class Faiss(AutotoolsPackage, CMakePackage, CudaPackage):
homepage = "https://github.com/facebookresearch/faiss"
url = "https://github.com/facebookresearch/faiss/archive/v1.6.3.tar.gz"
- maintainers = ["bhatiaharsh", "rblake-llnl"]
+ maintainers = ["bhatiaharsh", "rblake-llnl", "lpottier"]
build_system(
conditional("cmake", when="@1.7:"), conditional("autotools", when="@:1.6"), default="cmake"
@@ -75,6 +75,12 @@ class Faiss(AutotoolsPackage, CMakePackage, CudaPackage):
def setup_run_environment(self, env):
if "+python" in self.spec:
env.prepend_path("PYTHONPATH", python_platlib)
+ if self.spec.satisfies("platform=darwin"):
+ env.append_path(
+ "DYLD_FALLBACK_LIBRARY_PATH", os.path.join(python_platlib, "faiss")
+ )
+ else:
+ env.append_path("LD_LIBRARY_PATH", os.path.join(python_platlib, "faiss"))
class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder):