baidu / puck

Puck is a high-performance ANN search engine
Apache License 2.0
329 stars 37 forks source link

IDE or Cmake with many erros? pls refine the readme #5

Closed huangzhendong closed 11 months ago

huangzhendong commented 1 year ago

Error

-- Found Python3: /usr/bin/python3.8 (found suitable version "3.8.10", minimum required is "3.6") found components: Interpreter Development Development.Module Development.Embed
-- Found Python: 3.8.10
-- site-packages: /usr/lib/python3/dist-packages
CMake Error at /usr/local/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find SWIG (missing: SWIG_EXECUTABLE SWIG_DIR)
Call Stack (most recent call first):
  /usr/local/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/share/cmake-3.27/Modules/FindSWIG.cmake:153 (find_package_handle_standard_args)
  pyapi_wrapper/CMakeLists.txt:3 (find_package)

-- Configuring incomplete, errors occurred!

Solution sudo apt-get install swig

huangzhendong commented 1 year ago

Error Could NOT find Python3 (missing: Python3_INCLUDE_DIRS Development Development.Module Development.Embed) (found suitable version "3.8.10", minimum required is "3.6")

Solution sudo apt-get install python3-dev

huangzhendong commented 1 year ago

IDE python Error, e.g. Clion Cant Not recognize -DPYTHON_INCLUDE_DIR=$(python3 -c "import sysconfig; print(sysconfig.get_path('include'))") config

Solution replace python code with the actually path, e.g. -DPYTHON_INCLUDE_DIR=/opt/miniconda3/envs/puck_3.8.10/include/python3.8

huangzhendong commented 1 year ago

IDE MKL_LIBRARIES Error, e.g. Clion Cant Not found MKL_LIBRARIES

Solution add config parameter to cmake, e.g. -DMKLROOT=/opt/intel/oneapi/mkl/latest -DMKL_LIBRARIES=/opt/intel/oneapi/mkl/latest/lib/*.so

huangzhendong commented 1 year ago

Error CMAKE_LIBRARY_OUTPUT_DIRECTORY not defined

Solution https://github.com/baidu/puck/issues/4

huangzhendong commented 1 year ago

clion remote SUC config, e.g.

-DCMAKE_BUILD_TYPE=Debug -DMKLROOT=/opt/intel/oneapi/mkl/latest -DMKL_LIBRARIES=/opt/intel/oneapi/mkl/latest/lib/intel64/*.so -DUSE_PYTHON=ON -DPYTHON_INCLUDE_DIR=/opt/miniconda3/envs/puck_3.8.10/include/python3.8  -DPYTHON_LIBRARY=/opt/miniconda3/envs/puck_3.8.10/lib/* -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/data/luke/code/puck/build/pyapi_wrapper -DBLA_VENDOR=Intel10_64lp_seq -DBLA_STATIC=ON -B build .

CLI SUC config, e.g.

cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_INCLUDE_DIR=$(python3 -c "import sysconfig; print(sysconfig.get_path('include'))")  \
    -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/data/luke/code/puck/build/pyapi_wrapper \
    -DPYTHON_LIBRARY=$(python3 -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))") \
    -DMKLROOT=${MKLROOT} \
    -DUSE_PYTHON=ON \
    -DBLA_VENDOR=Intel10_64lp_seq \
    -DBLA_STATIC=ON  \
    -B build .
huangzhendong commented 1 year ago

image

MKL env should add to .bashrc or /etc/profile

huangzhendong commented 1 year ago

If you under proxy, pls config git with proxy, e.g.

git config --global http.proxy {proxyserver}
git config --global https.proxy {proxyserver}
nk2014yj commented 12 months ago

The version of python & cmake could be find in readme. For new environment, please refer to dockerfile https://github.com/baidu/puck/blob/main/ann-benchmarks/install/Dockerfile.puck_inmem

python: Version higher than 3.6.0. cmake: Version higher than 3.21.

huangzhendong commented 11 months ago

您好,您的邮件我已经收到!