NNPOps
NNPOps copied to clipboard
Error building with CUDA
If I try to enable building CUDA, CMake fails with this error:
CMake Error at CMakeLists.txt:8 (enable_language):
Language 'CUDA' is currently being enabled. Recursive call not allowed.
I tried removing the call to enable_language(CUDA)
, but then it fails with the errors,
CMake Error: Cannot determine link language for target "TestCudaANISymmetryFunctions".
CMake Error: CMake can not determine linker language for target: TestCudaANISymmetryFunctions
CMake Error: Cannot determine link language for target "TestCudaCFConv".
CMake Error: CMake can not determine linker language for target: TestCudaCFConv
Do you get this following the instructions (https://github.com/openmm/NNPOps#build--install)?
I have never seen such error. My wild guess is that cmake
is interfering with another build configuration.
Do you get this following the instructions (https://github.com/openmm/NNPOps#build--install)?
It's basically the same. I can't follow those instructions exactly because I'm building in an existing environment I used to build OpenMM, etc. I'll keep investigating.
I tried exactly following the instructions, and it failed with
CMake Error at /home/peastman/miniconda3/envs/nnpops2/lib/python3.9/site-packages/torch/share/cmake/Caffe2/Caffe2Config.cmake:90 (message):
Your installed Caffe2 version uses CUDA but I cannot find the CUDA
libraries. Please set the proper CUDA prefixes and / or install CUDA.
To make it work, I need to manually set both CUDA_SDK_ROOT_DIR
and CUDA_TOOLKIT_ROOT_DIR
in CMake. That also fixes the other problem above.
Is this still a problem, @peastman ? When installing CUDA from conda, sometimes I need to export CUDA_HOME=$CONDA_PREFIX for CMake to found it.
I don't know. I just tried creating a new environment and building with the instructions in the README and it worked. I don't know what's different though, whether it comes from a change to this repo, a different version of CMake, a different version of CUDA, or something else.