Skip to content

Commit

Permalink
Use Ninja for builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Jan 5, 2023
1 parent 6e1e350 commit dcb536e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions recipe/build-lib.bat
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ if "%cuda_compiler_version%"=="None" (

:: Build faiss.dll depending on $CF_FAISS_BUILD (either "generic" or "avx2")
cmake %CMAKE_ARGS% ^
-GNinja ^
-DBUILD_SHARED_LIBS=ON ^
-DBUILD_TESTING=OFF ^
-DFAISS_OPT_LEVEL=%CF_FAISS_BUILD% ^
Expand Down
1 change: 1 addition & 0 deletions recipe/build-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ fi

# Build version depending on $CF_FAISS_BUILD (either "generic" or "avx2")
cmake ${CMAKE_ARGS} \
-GNinja \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTING=${BUILD_TESTING} \
-DFAISS_OPT_LEVEL=${CF_FAISS_BUILD} \
Expand Down
3 changes: 2 additions & 1 deletion recipe/build-pkg.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ if "%cuda_compiler_version%"=="None" (
)

:: Build vanilla version (no avx2), see build-lib.bat
cmake -B _build_python_generic ^
cmake -GNinja ^
-B _build_python_generic ^
-Dfaiss_ROOT=_libfaiss_generic_stage ^
-DFAISS_ENABLE_GPU=!FAISS_ENABLE_GPU! ^
-DCMAKE_BUILD_TYPE=Release ^
Expand Down
2 changes: 2 additions & 0 deletions recipe/build-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fi

# Build vanilla version (no avx2), see build-lib.sh
cmake ${CMAKE_ARGS} \
-GNinja \
-Dfaiss_ROOT=_libfaiss_generic_stage/ \
-DFAISS_ENABLE_GPU=${FAISS_ENABLE_GPU} \
-DCMAKE_BUILD_TYPE=Release \
Expand All @@ -22,6 +23,7 @@ cmake --build _build_python_generic --target swigfaiss
# Build version with avx2 support, see build-lib.sh
if [[ "${target_platform}" == *-64 ]]; then
cmake ${CMAKE_ARGS} \
-GNinja \
-Dfaiss_ROOT=_libfaiss_avx2_stage/ \
-DFAISS_OPT_LEVEL=avx2 \
-DFAISS_ENABLE_GPU=${FAISS_ENABLE_GPU} \
Expand Down
5 changes: 2 additions & 3 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ build:
requirements:
build:
- {{ compiler('cxx') }}
- make # [linux]

outputs:
# A meta-package to select CPU or GPU build for faiss.
Expand Down Expand Up @@ -142,7 +141,7 @@ outputs:
- {{ compiler('cxx') }}
- {{ compiler('cuda') }} # [cuda_compiler_version != "None"]
- cmake
- make # [linux]
- ninja
- libgomp # [linux]
- llvm-openmp # [osx]
host:
Expand Down Expand Up @@ -185,7 +184,7 @@ outputs:
- {{ compiler('cuda') }} # [cuda_compiler_version != "None"]
- swig
- cmake
- make # [linux]
- ninja
- libgomp # [linux]
- llvm-openmp # [osx]
host:
Expand Down

0 comments on commit dcb536e

Please sign in to comment.