-
-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add autotools config files for NVIDIA compilers, always add -fPIC flag for nvfortran. #3642
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good (as long as it's passing tests)
…a_compiler_config Adjust nvhpc compiler flags.
@@ -57,6 +57,15 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "NAG") | |||
list (APPEND HDF5_CMAKE_Fortran_FLAGS "-ieee=full") | |||
endif () | |||
|
|||
if (CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") | |||
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fPIC") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might not be needed as CMake should handle this flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it does
@@ -49,6 +49,15 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND CMAKE_CXX_COMPILER_LOADED) | |||
endif () | |||
endif () | |||
|
|||
if (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC") | |||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Minform=warn") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c++11 flag should have a CMake option available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC" AND CMAKE_CXX_COMPILER_LOADED)
if (NOT DEFINED CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION)
if (NOT CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD EQUAL 11)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C11_STANDARD_COMPILE_OPTION}")
endif ()
endif ()
endif ()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this code.
linux autotools nvhpc test fails when disk space is filled. I tried it twice with the same results: "H5Tdbg.c", line 365: warning: statement is unreachable [code_is_unreachable] I don't know what we can do about this. Otherwise I think the PR is ready for final review. |
Replaced with #3686 |
Note that nvcc compiler doesn't match compiler and version processing in nvidia-flags because the output of "nvcc -V" doesn't provide version information on the line beginning with "nvcc". The only version information in the output is the Cuda version. As it is now, nvcc will not get the -c99 flag from nvida-flags. We could add different sed lines to get the compiler_vendor and compiler_version information with the Cuda version, but I'm told we should use nvc and not nvcc, so nvcc is not supported.