Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

lrknox
Copy link
Collaborator

@lrknox lrknox commented Oct 6, 2023

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.

@lrknox lrknox added Merge - To 1.12 Priority - 1. High 🔼 These are important issues that should be resolved in the next release Component - Build CMake, Autotools labels Oct 6, 2023
@lrknox lrknox marked this pull request as draft October 6, 2023 15:58
@lrknox lrknox changed the title Add config files for NVIDIA compilers, always add -fPIC flag for nvfortran. Add autotools config files for NVIDIA compilers, always add -fPIC flag for nvfortran. Oct 6, 2023
Copy link
Member

@derobins derobins left a 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)

@@ -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")
Copy link
Contributor

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.

Copy link
Collaborator Author

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")
Copy link
Contributor

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.

Copy link
Contributor

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 ()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this code.

@lrknox
Copy link
Collaborator Author

lrknox commented Oct 16, 2023

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]
break;
^
"H5VLnative_attr.c", line 79: warning: variable "plist" was set but never used [set_but_not_used]
Error: No space left on device : '/home/runner/runners/2.309.0/_diag/blocks/ff8f94e9-195c-4cef-9334-c4fd08e4cf2a_ca395085-040a-526b-2ce8-bdc85f692774.1'

I don't know what we can do about this.

Otherwise I think the PR is ready for final review.

@lrknox lrknox marked this pull request as ready for review October 16, 2023 12:51
@derobins
Copy link
Member

Replaced with #3686

@derobins derobins closed this Oct 18, 2023
@lrknox lrknox deleted the nvidia_compiler_config branch October 19, 2023 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - Build CMake, Autotools Priority - 1. High 🔼 These are important issues that should be resolved in the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants