-
Notifications
You must be signed in to change notification settings - Fork 156
add nvhpc compiler flags to cmake #1743
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
Open
JorgeG94
wants to merge
10
commits into
NOAA-GFDL:main
Choose a base branch
from
JorgeG94:feat/nvhpc-options
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
bcec5bb
add nvhpc options to compile FMS
JorgeG94 35ca0da
turn off quad precision with nvhpc
JorgeG94 447ce6b
Merge branch 'NOAA-GFDL:main' into feat/nvhpc-options
JorgeG94 ca4d10f
add the include dir for nvhpc to find
JorgeG94 d2883c1
comment on nvhpc
JorgeG94 2f07ef3
add comments and fix the debug flags
JorgeG94 58d01ee
make sure that nvhpc gets warning
JorgeG94 ba9b3c1
Update cmake/compiler_flags_NVHPC_Fortran.cmake
JorgeG94 948c30b
Update cmake/compiler_flags_NVHPC_Fortran.cmake
JorgeG94 92251e8
add warning for nvhpc and quad precision
JorgeG94 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,7 +27,7 @@ project(FMS | |
| DESCRIPTION "GFDL FMS Library" | ||
| HOMEPAGE_URL "https://www.gfdl.noaa.gov/fms" | ||
| LANGUAGES C Fortran) | ||
|
|
||
| set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
| include(GNUInstallDirs) | ||
|
|
||
| if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$") | ||
|
|
@@ -67,6 +67,11 @@ option(LARGEFILE "Enable compiler definition -Duse_LARGEFILE" | |
| option(WITH_YAML "Enable compiler definition -Duse_yaml" OFF) | ||
| option(USE_DEPRECATED_IO "THIS OPTION HAS NO EFFECT AND WILL BE REMOVED IN A FUTURE RELEASE" OFF) | ||
|
|
||
| if(CMAKE_Fortran_COMPILER_ID MATCHES "NVHPC") | ||
| # it seems nvidia does not support quad prec | ||
| set(ENABLE_QUAD_PRECISION OFF) | ||
| endif() | ||
|
|
||
| if(32BIT) | ||
| list(APPEND kinds "r4") | ||
| endif() | ||
|
|
@@ -332,6 +337,7 @@ foreach(kind ${kinds}) | |
| mosaic2/include | ||
| constants | ||
| astronomy/include | ||
| field_manager/ | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When building with nvhpc it could not find parse.inc which is here |
||
| field_manager/include | ||
| time_interp/include | ||
| tracer_manager/include | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # NVHPC C | ||
| set(CMAKE_C_FLAGS_RELEASE "-O3") | ||
|
|
||
| set(CMAKE_C_FLAGS_DEBUG "-O0 -g") | ||
|
|
||
| set(CMAKE_C_LINK_FLAGS "") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Precision-based Fortran compiler flags | ||
| set(r8_flags "-r8") # Fortran flags for 64BIT precision | ||
|
|
||
| # NVHPC Fortan | ||
| set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ") | ||
|
|
||
| set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -fast") | ||
JorgeG94 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -Ktrap=fp" ) | ||
JorgeG94 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| # -g can cause bugs, see: https://forums.developer.nvidia.com/t/bug-compiling-with-g-o0-produces-a-compute-sanitizer-error-removing-g-removes-the-error/341478 | ||
| # not sure if this is only on GPUs | ||
|
|
||
| set(CMAKE_Fortran_LINK_FLAGS "" ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.