Compillation bug with NVIDIA/PGI compilers
I've been trying to compile VTK with the latest (22.3) NVIDIA-HPC-SDK compilers, a.k.a. the old PGI compiler suite. Unfortunately, CMake eventually complains that it cannot find the OpenGL libraries:
-- Found CMath: TRUE
-- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY OpenGL)
CMake Error at CMake/vtkModule.cmake:4403 (message):
Could not find the OpenGL external dependency.
Call Stack (most recent call first):
CMake/vtkModule.cmake:4997 (vtk_module_find_package)
Utilities/OpenGL/CMakeLists.txt:58 (vtk_module_third_party_external)
I've then switched to the "standard" compilers (gcc (Ubuntu 11.1.0-1ubuntu1~20.04) 11.1.0) and CMake configured without issues. I do have the PATH and LD_LIBRARY_PATH correctly set to find both CUDA 11.6 and the NVHPC SDK, and the CUDA Samples 11.6 using OpenGL did build properly for me, so I'm not sure what might be going on. I've tried every combination of nvc,nvc++,nvcc possible; when I set:
-
CC=nvc
-
CXX=nvcc
CMake returns:
-- Performing Test EIGEN_COMPILER_SUPPORT_CPP11 -- Performing Test EIGEN_COMPILER_SUPPORT_CPP11 - Failed -- Performing Test standard_math_library_linked_to_automatically -- Performing Test standard_math_library_linked_to_automatically - Failed -- Performing Test standard_math_library_linked_to_as_m -- Performing Test standard_math_library_linked_to_as_m - Failed CMake Error at ThirdParty/eigen/vtkeigen/CMakeLists.txt:123 (message): Can't link to the standard math library. Please report to the Eigen developers, telling them about your platform.
Else, if I set:
- CC=nvcc
- CXX=nvcc
-- Looking for pthread.h -- Looking for pthread.h - not found -- Could NOT find Threads (missing: Threads_FOUND) CMake Error at CMake/vtkModule.cmake:4403 (message): Could not find the Threads external dependency. Call Stack (most recent call first): ThirdParty/loguru/vtkloguru/CMakeLists.txt:18 (vtk_module_find_package)
Looks like CMake is not properly set for the PGI compilers, that would be my take. Anything else I could try?
Thank you in advance!