Skip to content

Commit 2138ca5

Browse files
committed
Address code review comments
1 parent d67977a commit 2138ca5

File tree

2 files changed

+21
-25
lines changed

2 files changed

+21
-25
lines changed

.install/rocky_linux_9.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ export DEBIAN_FRONTEND=noninteractive
55
$MODE dnf update -y
66
$MODE dnf install -y gcc-toolset-13-gcc gcc-toolset-13-gcc-c++ make wget git valgrind
77

8-
# Install patch tool for SVS
9-
$MODE dnf install -y patch
10-
118
cp /opt/rh/gcc-toolset-13/enable /etc/profile.d/gcc-toolset-13.sh
129

1310
source install_cmake.sh $MODE

cmake/svs.cmake

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ if(POLICY CMP0135)
44
cmake_policy(SET CMP0135 NEW)
55
endif()
66

7-
# option(SVS_EXPERIMENTAL_LEANVEC "Enable experimental LeanVec in SVS" YES)
8-
# if(SVS_EXPERIMENTAL_LEANVEC)
9-
# add_definitions(-DSVS_EXPERIMENTAL_LEANVEC)
10-
# endif()
11-
127
# Valgrind does not support AVX512 and Valgrind in running in Debug
138
# so disable it if we are in Debug mode
149
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
@@ -34,30 +29,34 @@ endif()
3429

3530
include(CMakeDependentOption)
3631

37-
# USE_SVS option forsibly OFF if CPU or compiler is not supported
32+
# USE_SVS option forcibly OFF if CPU or compiler is not supported
3833
# elsewhere let user disable SVS
3934
cmake_dependent_option(USE_SVS "Build with SVS library support" ON "SVS_SUPPORTED" OFF)
4035
if(USE_SVS)
41-
message(STATUS "SVS support enabled")
4236
else()
43-
message(STATUS "SVS support disabled")
4437
endif()
4538

46-
# try to find MKL
47-
set(MKL_HINTS ${MKLROOT} $ENV{MKL_DIR} $ENV{MKL_ROOT} $ENV{MKLROOT})
48-
if(LINUX)
49-
list(APPEND MKL_HINTS "/opt/intel/oneapi/mkl/latest")
50-
endif()
51-
if(WIN32)
52-
list(APPEND MKL_HINTS "C:/Program Files (x86)/Intel/oneAPI/mkl/latest")
53-
endif()
54-
find_package(MKL HINTS ${MKL_HINTS})
55-
if(NOT MKL_FOUND)
56-
message(WARNING "MKL not found - disabling SVS shared library")
39+
if(USE_SVS)
40+
message(STATUS "SVS support enabled")
41+
# try to find MKL
42+
set(MKL_HINTS ${MKLROOT} $ENV{MKL_DIR} $ENV{MKL_ROOT} $ENV{MKLROOT})
43+
if(LINUX)
44+
list(APPEND MKL_HINTS "/opt/intel/oneapi/mkl/latest")
45+
endif()
46+
if(WIN32)
47+
list(APPEND MKL_HINTS "C:/Program Files (x86)/Intel/oneAPI/mkl/latest")
48+
endif()
49+
find_package(MKL HINTS ${MKL_HINTS})
50+
if(NOT MKL_FOUND)
51+
message(WARNING "MKL not found - disabling SVS shared library")
52+
endif()
53+
else()
54+
message(STATUS "SVS support disabled")
55+
set(MKL_FOUND FALSE)
5756
endif()
5857

5958
# Configure SVS build
60-
cmake_dependent_option(SVS_SHARED_LIB "Use SVS pre-compiled shared library" ON "SVS_SUPPORTED AND MKL_FOUND" OFF)
59+
cmake_dependent_option(SVS_SHARED_LIB "Use SVS pre-compiled shared library" ON "USE_SVS AND MKL_FOUND" OFF)
6160
set(SVS_URL "https://github.com/intel/ScalableVectorSearch/releases/download/v0.0.7/svs-shared-library-0.0.7-avx2.tar.gz" CACHE STRING "SVS URL")
6261

6362
if(USE_SVS)
@@ -76,8 +75,8 @@ if(USE_SVS)
7675
set(SVS_LVQ_HEADER "svs/extensions/vamana/lvq.h")
7776
set(SVS_TARGET_NAME "svs::svs_shared_library")
7877
else()
79-
# this file is included from python_bindings/CMakeLists.txt
80-
# SVS sources path to be relative to this file
78+
# this file is included from both CMakeLists.txt and python_bindings/CMakeLists.txt
79+
# so, set SVS sources path relative to this file
8180
get_filename_component(root ${CMAKE_CURRENT_LIST_DIR}/.. ABSOLUTE)
8281
add_subdirectory(
8382
${root}/deps/ScalableVectorSearch

0 commit comments

Comments
 (0)