From 8920ac9a7d77e2f5db80595e59c33ddd553d75dc Mon Sep 17 00:00:00 2001 From: Yong Wang Date: Mon, 6 Feb 2023 19:24:02 +0800 Subject: [PATCH 1/2] Fix inconsistency between the building doc and CMakeLists.txt --- cpp/CMakeLists.txt | 4 ++-- docs/source/build.md | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index a7eb759d89..900f9e32c4 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -57,7 +57,7 @@ option(DISABLE_DEPRECATION_WARNINGS "Disable deprecaction warnings " ON) option(DISABLE_OPENMP "Disable OpenMP" OFF) option(RAFT_NVTX "Enable nvtx markers" OFF) -option(RAFT_COMPILE_LIBRARIES "Enable building raft shared library instantiations" ${BUILD_TESTS}) +option(RAFT_COMPILE_LIBRARIES "Enable building raft shared library instantiations" OFF) option( RAFT_COMPILE_NN_LIBRARY "Enable building raft nearest neighbors shared library instantiations" ${RAFT_COMPILE_LIBRARIES} @@ -66,7 +66,7 @@ option(RAFT_COMPILE_DIST_LIBRARY "Enable building raft distant shared library in ${RAFT_COMPILE_LIBRARIES} ) option(RAFT_ENABLE_NN_DEPENDENCIES "Search for raft::nn dependencies like faiss" - ${RAFT_COMPILE_LIBRARIES} + ${RAFT_COMPILE_NN_LIBRARY} ) option(RAFT_ENABLE_thrust_DEPENDENCY "Enable Thrust dependency" ON) diff --git a/docs/source/build.md b/docs/source/build.md index 4052e49cf8..145d12e1b7 100644 --- a/docs/source/build.md +++ b/docs/source/build.md @@ -162,16 +162,15 @@ RAFT's cmake has the following configurable flags available:. | Flag | Possible Values | Default Value | Behavior | | --- | --- | --- | --- | | BUILD_TESTS | ON, OFF | ON | Compile Googletests | -| BUILD_BENCH | ON, OFF | ON | Compile benchmarks | +| BUILD_BENCH | ON, OFF | OFF | Compile benchmarks | | raft_FIND_COMPONENTS | nn distance | | Configures the optional components as a space-separated list | | RAFT_COMPILE_LIBRARIES | ON, OFF | OFF | Compiles all `libraft` shared libraries (these are required for Googletests) | | RAFT_COMPILE_NN_LIBRARY | ON, OFF | OFF | Compiles the `libraft-nn` shared library | | RAFT_COMPILE_DIST_LIBRARY | ON, OFF | OFF | Compiles the `libraft-distance` shared library | | RAFT_ENABLE_NN_DEPENDENCIES | ON, OFF | OFF | Searches for dependencies of nearest neighbors API, such as FAISS, and compiles them if not found. Needed for `raft::spatial::knn` | | RAFT_USE_FAISS_STATIC | ON, OFF | OFF | Statically link FAISS into `libraft-nn` | -| RAFT_STATIC_LINK_LIBRARIES | ON, OFF | ON | Build static link libraries instead of shared libraries | | DETECT_CONDA_ENV | ON, OFF | ON | Enable detection of conda environment for dependencies | -| NVTX | ON, OFF | OFF | Enable NVTX Markers | +| RAFT_NVTX | ON, OFF | OFF | Enable NVTX Markers | | CUDA_ENABLE_KERNELINFO | ON, OFF | OFF | Enables `kernelinfo` in nvcc. This is useful for `compute-sanitizer` | | CUDA_ENABLE_LINEINFO | ON, OFF | OFF | Enable the -lineinfo option for nvcc | | CUDA_STATIC_RUNTIME | ON, OFF | OFF | Statically link the CUDA runtime | @@ -388,4 +387,4 @@ Once built and installed, RAFT can be safely uninstalled using `build.sh` by spe Leaving off the installed components will uninstall everything that's been installed: ```bash ./build.sh --uninstall -``` \ No newline at end of file +``` From 8b68942821ec7893b2f2f03662ed8e89c47abd31 Mon Sep 17 00:00:00 2001 From: Yong Wang Date: Sat, 11 Feb 2023 21:36:03 +0800 Subject: [PATCH 2/2] refine the default of RAFT_COMPILE_LIBRARIES --- cpp/CMakeLists.txt | 6 +++++- docs/source/build.md | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 900f9e32c4..e2787149a9 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -57,7 +57,11 @@ option(DISABLE_DEPRECATION_WARNINGS "Disable deprecaction warnings " ON) option(DISABLE_OPENMP "Disable OpenMP" OFF) option(RAFT_NVTX "Enable nvtx markers" OFF) -option(RAFT_COMPILE_LIBRARIES "Enable building raft shared library instantiations" OFF) +set(RAFT_COMPILE_LIBRARIES_DEFAULT OFF) +if(BUILD_TESTS OR BUILD_BENCH) + set(RAFT_COMPILE_LIBRARIES_DEFAULT ON) +endif() +option(RAFT_COMPILE_LIBRARIES "Enable building raft shared library instantiations" ${RAFT_COMPILE_LIBRARIES_DEFAULT}) option( RAFT_COMPILE_NN_LIBRARY "Enable building raft nearest neighbors shared library instantiations" ${RAFT_COMPILE_LIBRARIES} diff --git a/docs/source/build.md b/docs/source/build.md index 145d12e1b7..048a254a06 100644 --- a/docs/source/build.md +++ b/docs/source/build.md @@ -164,7 +164,7 @@ RAFT's cmake has the following configurable flags available:. | BUILD_TESTS | ON, OFF | ON | Compile Googletests | | BUILD_BENCH | ON, OFF | OFF | Compile benchmarks | | raft_FIND_COMPONENTS | nn distance | | Configures the optional components as a space-separated list | -| RAFT_COMPILE_LIBRARIES | ON, OFF | OFF | Compiles all `libraft` shared libraries (these are required for Googletests) | +| RAFT_COMPILE_LIBRARIES | ON, OFF | ON if either BUILD_TESTS or BUILD_BENCH is ON; otherwise OFF | Compiles all `libraft` shared libraries (these are required for Googletests) | | RAFT_COMPILE_NN_LIBRARY | ON, OFF | OFF | Compiles the `libraft-nn` shared library | | RAFT_COMPILE_DIST_LIBRARY | ON, OFF | OFF | Compiles the `libraft-distance` shared library | | RAFT_ENABLE_NN_DEPENDENCIES | ON, OFF | OFF | Searches for dependencies of nearest neighbors API, such as FAISS, and compiles them if not found. Needed for `raft::spatial::knn` |