问题描述
CMake Error at CMakeLists.txt:9 (FIND_PACKAGE):
By not providing "FindTorch.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Torch", but
CMake did not find one.
Could not find a package configuration file provided by "Torch" with any of
the following names:
TorchConfig.cmake
torch-config.cmake
Add the installation prefix of "Torch" to CMAKE_PREFIX_PATH or set
"Torch_DIR" to a directory containing one of the above files. If "Torch"
provides a separate development package or SDK, be sure it has been
installed.
解决方案
export Torch_DIR as env variable before cmake
export Torch_DIR=/home/my/pyenv/py3.7-torch1.0/lib/python3.7/site-packages/torch/share/cmake/Torch // find your path
cmake blablabla
make