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

Remove compiler-specific options from FFLAGS in grid_rotate Makefile #446

Merged
merged 1 commit into from
Oct 21, 2021

Conversation

mgduda
Copy link
Collaborator

@mgduda mgduda commented Oct 20, 2021

This PR removes GNU-specific flags from the grid_rotate tool's Makefile,
enabling the tool to be compiled "out-of-the-box" with many Fortran compilers.

Previously, the FFLAGS variable in the grid_rotate Makefile contained
GNU-specific flags (-m64 -ffree-form -Wall). The -m64 flag has been
removed from the 'gfortran' build option in the main MPAS-Model repository, the
-ffree-form option is unnecessary because the GNU Fortran compiler assumes files
with a .f90 suffix are free-format, and changing the -O2 flag to -O3 is
consistent with the use of -O3 for the 'gfortran' build target in the main
MPAS-Model repository.

The -Wall flag doesn't appear to be generally portable across compilers, but in
the interest of using only generic flags (assuming -O3 is recognized by most
compilers that are in use in the MPAS community), the -Wall flag has been
removed. Accordingly, developers are encouraged to manually add -Wall when
testing code changes to the grid_rotate tool.

With the changes to FFLAGS, the grid_rotate tool now compiles without
modification with the GNU, Intel, NVHPC, and Cray compilers (assuming nc-config
is in the user's PATH).

@mgduda
Copy link
Collaborator Author

mgduda commented Oct 21, 2021

I just realized that I kept writing convert_mpas in the commit message when I meant grid_rotate; I'll someday learn to work on one task at a time.

I'm going to force-push a change that only updates the commit message before merging.

@mgduda mgduda changed the title Remove compiler-specific options from FFLAGS in convert_mpas Makefile Remove compiler-specific options from FFLAGS in grid_rotate Makefile Oct 21, 2021
Previously, the FFLAGS variable in the grid_rotate tool's Makefile contained
GNU-specific flags (-m64 -ffree-form -Wall). The -m64 flag has been removed from
the 'gfortran' build option in the main MPAS-Model repository, the -ffree-form
option is unnecessary because the GNU Fortran compiler assumes files with a .f90
suffix are free-format, and changing the -O2 flag to -O3 is consistent with the
use of -O3 for the 'gfortran' build target in the main MPAS-Model repository.

The -Wall flag doesn't appear to be generally portable across compilers, but in
the interest of using only generic flags (assuming -O3 is recognized by most
compilers that are in use in the MPAS community), the -Wall flag has been
removed. Accordingly, developers are encouraged to manually add -Wall when
testing code changes to the grid_rotate tool.

With the changes to FFLAGS, the grid_rotate utility now compiles without
modification with the GNU, Intel, NVHPC, and Cray compilers (assuming nc-config
is in the user's PATH).
@mgduda mgduda merged commit 7867fd2 into MPAS-Dev:master Oct 21, 2021
@mgduda mgduda deleted the grid_rotate/generic_FFLAGS branch October 21, 2021 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants