CMake Error at /opt/rocm/hip/cmake/FindHIP.cmake:680 (add_library):NO SOURCES given to target: c10_hip
时间: 2023-09-14 19:09:04 浏览: 41
This error occurs when the add_library() function in the FindHIP.cmake file is unable to find any source files for the c10_hip target. The c10_hip target is used to build HIP-enabled libraries for PyTorch.
To fix this error, ensure that the source files for the c10_hip target are included in the appropriate directory and that the CMakeLists.txt file for the project includes the correct paths to these files.
You can also try updating your version of HIP or PyTorch to ensure that all necessary files are present and up-to-date. Additionally, ensure that your build environment is properly configured to support HIP and that all dependencies are installed correctly.
相关问题
CMake Error at /opt/rocm/hip/cmake/FindHIP.cmake:680 (add library):NO SOURCES given to target: c10_hip
This error message indicates that there are no source files provided to the target "c10_hip" in the HIP module of CMake.
To resolve this error, you need to make sure that there are source files available for the target. You can do this by adding the source files to the CMakeLists.txt file using the "add_library" command.
For example, if you have a source file named "my_source.cpp", you can add it to the target as follows:
```
add_library(c10_hip my_source.cpp)
```
Make sure to replace "my_source.cpp" with the name of your actual source file.
Once you have added the source files to the target, you should be able to build your project without encountering this error message.
CMake Error at simple_layers/CMakeLists.txt:211 (add_library): No SOURCES given to target: my_test
这个错误的原因是在 simple_layers/CMakeLists.txt 文件的第 211 行,你定义了一个名为 `my_test` 的库,但是没有指定任何源文件,导致 CMake 不知道应该如何构建这个库。
你需要检查一下你的 `add_library()` 命令,确保你已经给出了正确的源文件路径或变量名。如果你已经给出了正确的源文件,还需要检查一下这些源文件是否存在,路径是否正确。如果你是使用变量名来添加源文件,还需要确保这些变量已经被正确地设置了。