diff options
author | Someone <else@someonex.net> | 2024-06-17 16:05:40 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-17 16:05:40 +0000 |
commit | b9a5c0fc8af06936d0aeb9da6baac2430d7b043a (patch) | |
tree | 53b22e3de6a2974c900fea9fdf0a30576007897f /pkgs/development/libraries/science | |
parent | 6971061a3c05293541d84c4b67643cf32051df3c (diff) | |
parent | d2b892c753ec8ef2bb7d491f0453a6ef517961f1 (diff) |
Merge pull request #320419 from paparodeo/faiss-stuff
faiss: refactor buildPhase and installPhase
Diffstat (limited to 'pkgs/development/libraries/science')
-rw-r--r-- | pkgs/development/libraries/science/math/faiss/default.nix | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/pkgs/development/libraries/science/math/faiss/default.nix b/pkgs/development/libraries/science/math/faiss/default.nix index aedb240caadd7..59494fadfd900 100644 --- a/pkgs/development/libraries/science/math/faiss/default.nix +++ b/pkgs/development/libraries/science/math/faiss/default.nix @@ -97,20 +97,21 @@ stdenv.mkDerivation { "-DCUDAToolkit_INCLUDE_DIR=${cudaJoined}/include" ]; + buildFlags = [ + "faiss" + "demo_ivfpq_indexing" + ] ++ lib.optionals pythonSupport [ + "swigfaiss" + ]; # pip wheel->pip install commands copied over from opencv4 - buildPhase = '' - make -j faiss - make demo_ivfpq_indexing - '' + lib.optionalString pythonSupport '' - make -j swigfaiss + postBuild = lib.optionalString pythonSupport '' (cd faiss/python && python -m pip wheel --verbose --no-index --no-deps --no-clean --no-build-isolation --wheel-dir dist .) ''; - installPhase = '' - make install + postInstall = '' mkdir -p $demos/bin cp ./demos/demo_ivfpq_indexing $demos/bin/ '' + lib.optionalString pythonSupport '' @@ -118,7 +119,7 @@ stdenv.mkDerivation { (cd faiss/python && python -m pip install dist/*.whl --no-index --no-warn-script-location --prefix="$out" --no-cache) ''; - fixupPhase = lib.optionalString (pythonSupport && cudaSupport) '' + postFixup = lib.optionalString (pythonSupport && cudaSupport) '' addOpenGLRunpath $out/${pythonPackages.python.sitePackages}/faiss/*.so addOpenGLRunpath $demos/bin/* ''; |