Compiling hnswlib
Obtain the hnswlib open source code and hnswlib patch from GitHub and GitCode, apply the patch, and then compile hnswlib.
- Obtain the open source code. Assume that the installation path is /path/to.
cd /path/to git clone -b v0.8.0 https://github.com/nmslib/hnswlib.git
- Download the hnswlib patch file. Assume that the installation path is /path/to.
git clone -b v1.0.0 https://gitcode.com/boostkit/hnswlib.git k_hnswlib
- Apply the patch.
cd hnswlib patch -p1 < ../k_hnswlib/0001-boostsra-hnswlib.patch
- Install GCC 12.3.1 and GCC-C++ 12.3.1.
yum install gcc-toolset-12-gcc gcc-toolset-12-gcc-c++ export PATH=/opt/openEuler/gcc-toolset-12/root/usr/bin/:$PATH export LD_LIBRARY_PATH=/opt/openEuler/gcc-toolset-12/root/usr/lib64/:$LD_LIBRARY_PATH
- Install OpenMP, CMake, and Make.
yum install cmake libgomp make
- Install the HDF5 library.
yum install hdf5-devel
- Compile the hnswlib source code.
make hnswlib_neon_test make hnswlib_sve_test make hnswlib_fp16_neon_test make hnswlib_fp16_sve_test
Compilation option description:
- hnswlib_neon_test: FP32 operations using NEON vectorization
- hnswlib_sve_test: FP32 operations using SVE vectorization.
- hnswlib_fp16_neon_test: FP16 operations using NEON vectorization.
- hnswlib_fp16_sve_test: FP16 operations using SVE vectorization.
Parent topic: Installing and Configuring the Environment