Compiling AMGX with NVHPC 25.5
Open
@mattmartineau is already working on this.
Since Nov 19, 2025.
build issues
- Dominant language
- Cuda
- Stars
- 692
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
When trying to compile AMGX with the last release of NVHPC, cmake acuses a problem with "CUDA::nvToolsExt" preventing the process.
I've found a way to bypass this by changing the CMakeLists.txt file from
IF (WIN32)
target_link_libraries(amgx CUDA::cublas CUDA::cusparse CUDA::cusolver)
target_link_libraries(amgxsh CUDA::cublas CUDA::cusparse CUDA::cusolver)
ELSE (WIN32)
target_link_libraries(amgx CUDA::cublas CUDA::cusparse CUDA::cusolver CUDA::nvToolsExt m pthread)
target_link_libraries(amgxsh CUDA::cublas CUDA::cusparse CUDA::cusolver CUDA::nvToolsExt m pthread)
ENDIF(WIN32)
to
IF (WIN32)
target_link_libraries(amgx CUDA::cublas CUDA::cusparse CUDA::cusolver)
target_link_libraries(amgxsh CUDA::cublas CUDA::cusparse CUDA::cusolver)
ELSE (WIN32)
target_link_libraries(amgx CUDA::cublas CUDA::cusparse CUDA::cusolver m pthread)
target_link_libraries(amgxsh CUDA::cublas CUDA::cusparse CUDA::cusolver m pthread)
ENDIF(WIN32)
and the file "amgx_timer.h" from
#ifdef NVTX_RANGES
#include "nvToolsExt.h"
#endif
to
#ifdef NVTX_RANGES
#include "nvtx3/nvToolsExt.h"
#endif
With this I've managed to compile AMGX, but I don't know if this is the correct fix. Is this right or am I missing something?
Environment information:
- OS: Ubuntu 24.04 LTS
- Compiler version: gcc 14.3.0
- CMake version: 4.0.2
- CUDA used for AMGX compilation: CUDA 12.9 - NVHPC 25.5
- AMGX version or commit hash: v2.4.0
Compilation information
cmake .. -Wno-dev -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release
make
Issue information
The error was happening when running the cmake:
CMake Error at CMakeLists.txt:272 (target_link_libraries):
Target "amgx" links to:
CUDA::nvToolsExt
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
CMake Error at CMakeLists.txt:273 (target_link_libraries):
Target "amgxsh" links to:
CUDA::nvToolsExt
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.