baidu/puck

IDE or Cmake with many erros? pls refine the readme

huangzhendong opened this issue · 9 comments

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

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

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

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

Error
CMAKE_LIBRARY_OUTPUT_DIRECTORY not defined

Solution
#4

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 .

image

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

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

git config --global http.proxy {proxyserver}
git config --global https.proxy {proxyserver}

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.