Skip to content

Commit f8c1d53

Browse files
author
mengdilin
committed
refactor cmake command
1 parent 7744d00 commit f8c1d53

1 file changed

Lines changed: 18 additions & 12 deletions

File tree

.github/actions/build_cmake/action.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,25 @@ runs:
6363
shell: bash
6464
run: |
6565
eval "$(conda shell.bash hook)"
66+
67+
args=(
68+
-DBUILD_TESTING=ON
69+
-DBUILD_SHARED_LIBS=ON
70+
-DFAISS_ENABLE_GPU=${{ inputs.gpu }}
71+
-DFAISS_ENABLE_RAFT=${{ inputs.raft }}
72+
-DFAISS_OPT_LEVEL=${{ inputs.opt_level }}
73+
-DFAISS_ENABLE_C_API=ON
74+
-DPYTHON_EXECUTABLE=$CONDA/bin/python
75+
-DCMAKE_BUILD_TYPE=Release
76+
)
77+
if [ "${{ runner.arch }}" = "X64" ]; then
78+
args+=(
79+
-DBLA_VENDOR=Intel10_64_dyn
80+
-DCMAKE_CUDA_FLAGS=\"-gencode arch=compute_75,code=sm_75\"
81+
)
82+
fi
6683
conda activate
67-
cmake -B build \
68-
-DBUILD_TESTING=ON \
69-
-DBUILD_SHARED_LIBS=ON \
70-
-DFAISS_ENABLE_GPU=${{ inputs.gpu }} \
71-
-DFAISS_ENABLE_RAFT=${{ inputs.raft }} \
72-
-DFAISS_OPT_LEVEL=${{ inputs.opt_level }} \
73-
-DFAISS_ENABLE_C_API=ON \
74-
-DPYTHON_EXECUTABLE=$CONDA/bin/python \
75-
-DCMAKE_BUILD_TYPE=Release \
76-
-DBLA_VENDOR=Intel10_64_dyn \
77-
-DCMAKE_CUDA_FLAGS="-gencode arch=compute_75,code=sm_75" \
78-
.
84+
cmake -B build "${args[@]}" .
7985
make -k -C build -j$(nproc)
8086
- name: C++ tests
8187
shell: bash

0 commit comments

Comments
 (0)