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>
This commit is contained in:
parent
5074e72be8
commit
ff4cccbf6c
@ -22,7 +22,7 @@ class Faiss(AutotoolsPackage, CMakePackage, CudaPackage):
|
|||||||
homepage = "https://github.com/facebookresearch/faiss"
|
homepage = "https://github.com/facebookresearch/faiss"
|
||||||
url = "https://github.com/facebookresearch/faiss/archive/v1.6.3.tar.gz"
|
url = "https://github.com/facebookresearch/faiss/archive/v1.6.3.tar.gz"
|
||||||
|
|
||||||
maintainers = ["bhatiaharsh", "rblake-llnl"]
|
maintainers = ["bhatiaharsh", "rblake-llnl", "lpottier"]
|
||||||
|
|
||||||
build_system(
|
build_system(
|
||||||
conditional("cmake", when="@1.7:"), conditional("autotools", when="@:1.6"), default="cmake"
|
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):
|
def setup_run_environment(self, env):
|
||||||
if "+python" in self.spec:
|
if "+python" in self.spec:
|
||||||
env.prepend_path("PYTHONPATH", python_platlib)
|
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):
|
class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder):
|
||||||
|
Loading…
Reference in New Issue
Block a user