Skip to content

Commit

Permalink
Merge cmake command in the cmake build action (#3702)
Browse files Browse the repository at this point in the history
Summary:

Simplify the cmake command in the cmake build action

Differential Revision: D60427830
  • Loading branch information
ramilbakhshyiev authored and facebook-github-bot committed Jul 30, 2024
1 parent dceeefb commit d285ae0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 30 deletions.
42 changes: 13 additions & 29 deletions .github/actions/build_cmake/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,36 +64,20 @@ runs:
shell: bash
run: |
eval "$(conda shell.bash hook)"
echo "${{ runner.arch == 'ARM64' && 'a' || 'b' }}"
conda activate
if [ "${{ runner.arch }}" = "X64" ]; then
cmake -B build \
-DBUILD_TESTING=ON \
-DBUILD_SHARED_LIBS=ON \
-DFAISS_ENABLE_GPU=${{ inputs.gpu }} \
-DFAISS_ENABLE_RAFT=${{ inputs.raft }} \
-DFAISS_OPT_LEVEL=${{ inputs.opt_level }} \
-DFAISS_ENABLE_C_API=ON \
-DPYTHON_EXECUTABLE=$CONDA/bin/python \
-DCMAKE_BUILD_TYPE=Release \
-DBLA_VENDOR=Intel10_64_dyn \
-DCMAKE_CUDA_FLAGS="-gencode arch=compute_75,code=sm_75" \
.
elif [ "${{ runner.arch }}" = "ARM64" ]; then
cmake -B build \
-DBUILD_TESTING=ON \
-DBUILD_SHARED_LIBS=ON \
-DFAISS_ENABLE_GPU=${{ inputs.gpu }} \
-DFAISS_ENABLE_RAFT=${{ inputs.raft }} \
-DFAISS_OPT_LEVEL=${{ inputs.opt_level }} \
-DFAISS_ENABLE_C_API=ON \
-DPYTHON_EXECUTABLE=$CONDA/bin/python \
-DCMAKE_BUILD_TYPE=Release \
.
else
echo "Encountered unexpected platform ${{ runner.arch }}"
exit 1
fi
cmake -B build \
-DBUILD_TESTING=ON \
-DBUILD_SHARED_LIBS=ON \
-DFAISS_ENABLE_GPU=${{ inputs.gpu }} \
-DFAISS_ENABLE_RAFT=${{ inputs.raft }} \
-DFAISS_OPT_LEVEL=${{ inputs.opt_level }} \
-DFAISS_ENABLE_C_API=ON \
-DPYTHON_EXECUTABLE=$CONDA/bin/python \
-DCMAKE_BUILD_TYPE=Release \
-DBLA_VENDOR=${{ runner.arch == 'ARM64' && '' || 'Intel10_64_dyn' }} \
-DCMAKE_CUDA_FLAGS=${{ runner.arch == 'ARM64' && '' || '"-gencode arch=compute_75,code=sm_75"' }} \
.
make -k -C build -j$(nproc)
- name: C++ tests
shell: bash
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ jobs:
raft: ON
linux-arm64-SVE-cmake:
name: Linux arm64 SVE (cmake)
needs: linux-x86_64-cmake
runs-on: faiss-aws-r8g.large
continue-on-error: true # non-blocking mode for now
steps:
Expand Down

0 comments on commit d285ae0

Please sign in to comment.