Skip to content

Commit

Permalink
Moving linker flags to CMakeLists
Browse files Browse the repository at this point in the history
  • Loading branch information
ramilbakhshyiev committed May 8, 2024
1 parent 3ccf2b9 commit 2d09566
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion .github/actions/build_cmake/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ runs:
-DCMAKE_BUILD_TYPE=Release \
-DBLA_VENDOR=Intel10_64_dyn \
-DCMAKE_CUDA_FLAGS="-gencode arch=compute_75,code=sm_75" \
-DCMAKE_SHARED_LINKER_FLAGS="-lc" -DCMAKE_EXE_LINKER_FLAGS="-lc" \
.
make -k -C build -j$(nproc)
- name: C++ tests
Expand Down
3 changes: 3 additions & 0 deletions faiss/gpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ endif()
# Export FAISS_GPU_HEADERS variable to parent scope.
set(FAISS_GPU_HEADERS ${FAISS_GPU_HEADERS} PARENT_SCOPE)

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lc")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lc")

target_link_libraries(faiss PRIVATE "$<LINK_LIBRARY:WHOLE_ARCHIVE,faiss_gpu>")
target_link_libraries(faiss_avx2 PRIVATE "$<LINK_LIBRARY:WHOLE_ARCHIVE,faiss_gpu>")
target_link_libraries(faiss_avx512 PRIVATE "$<LINK_LIBRARY:WHOLE_ARCHIVE,faiss_gpu>")
Expand Down

0 comments on commit 2d09566

Please sign in to comment.