DBraun / PyTorchTOP

GPU PyTorch TOP in TouchDesigner with CUDA-enabled OpenCV
Other
77 stars 5 forks source link

CMake Error: The source directory "foo:/libtorch" does not appear to contain CMakeLists.txt. #12

Closed jBachalo closed 3 years ago

jBachalo commented 3 years ago

Hi David After some digging and cross referencing I managed to get OpenCV compiled. One issue was using 64bit version of Python.

Now however I am stuck on compiling libtorch. There doesn't seem to be a CMakeLists.txt file in the download. Get the same error whether running CMake from cmd or using binary "CMake Error: The source directory "D:/libtorch" does not appear to contain CMakeLists.txt."

There is of course a CMakeLists.txt file inside the downloaded PyTorchTOP repo but how is this referenced from the libtorch repo which is totally separate?

On the cmd line (inside PyTorchTOP/build)

D:\PyTorchTOP\build>cmake -DCMAKE_PREFIX_PATH= D:/libtorch
CMake Error: The source directory "D:/libtorch" does not appear to contain CMakeLists.txt.

Does this have to be manually created or am I missing something in your instructions? Thanks!

DBraun commented 3 years ago

Fortunately we don’t need to use CMake to compile Libtorch itself into DLLs. It comes precompiled in the lib folder. TensorFlow by the way isn’t nearly as convenient.

This part of the instructions https://github.com/DBraun/PyTorchTOP#building-the-pytorchtop-project happens in the root of this PyTorchTOP repo. You might be accidentally putting a build folder inside the libtorch folder. The build folder should be sibling to this repo’s src and models folders. Also don’t forget the double period in the example cmake build command. It indicates that the CMakeLists.txt file is in the parent directory.

jBachalo commented 3 years ago

Hi David. Thanks for the quick reply. Yes was missing the 2 periods at the end of the cmd!! Progress. One more error to resolve and think I am there.

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.

DBraun commented 3 years ago

Based on your previous message it may be due to putting a space after -DCMAKE_PREFIX_PATH=

jBachalo commented 3 years ago

Thanks! Yep. Will close issue.