cmake命令
cmake \
-DBOOST_ROOT=/home/xxx/Program/boost_1_76_0/build_install \
-DCPU_ONLY=ON \
PYTHON3_EXECUTABLE = /home/xxx/miniconda3/envs/torch17_py/bin/python \
PYTHON_INCLUDE_DIR = /home/xxx/miniconda3/envs/torch17_py/include \
PYTHON_LIBRARY = /home/xxx/miniconda3/envs/torch17_py/lib/libpython3.8.so \
PYTHON3_NUMPY_INCLUDE_DIRS = /home/xxx/miniconda3/envs/torch17_py/lib/python3.8/site-packages/numpy/core/include \
..
出现问题如下:
-- Could NOT find Boost (missing: python-py38) (found suitable version "1.76.0", minimum required is "1.46")
CMake Warning at /usr/local/share/cmake-3.15/Modules/FindBoost.cmake:1144 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/usr/local/share/cmake-3.15/Modules/FindBoost.cmake:1266 (_Boost_COMPONENT_DEPENDENCIES)
/usr/local/share/cmake-3.15/Modules/FindBoost.cmake:1904 (_Boost_MISSING_DEPENDENCIES)
cmake/Dependencies.cmake:156 (find_package)
CMakeLists.txt:51 (include)
查看~/Program/boost_1_76_0/build_install/lib
中是否存在libboost_python38.a
及libboost_python38.so
解决办法
ln -s libboost_python38.so libboost_python-py38.so
ln -s libboost_python38.a libboost_python-py38.a