#9676 Follow Up - Make it more resilient to subtle differences in gfortran versions#9682
Merged
Myoldmopar merged 1 commit intoNatLabRockies:developfrom Sep 30, 2022
Conversation
Myoldmopar
approved these changes
Sep 30, 2022
| check_fortran_compiler_flag(-static-libgfortran HAS_STATIC_LIBGFORTRAN) | ||
| check_fortran_compiler_flag(-static-libgcc HAS_STATIC_LIBGCC) | ||
| check_fortran_compiler_flag(-static-libquadmath HAS_STATIC_LIBQUADMATH) | ||
| message(DEBUG "HAS_STATIC_LIBGFORTRAN=${HAS_STATIC_LIBGFORTRAN}, HAS_STATIC_LIBGCC=${HAS_STATIC_LIBGCC}, HAS_STATIC_LIBQUADMATH=${HAS_STATIC_LIBQUADMATH}") |
Member
There was a problem hiding this comment.
This is a nice robustness improvement.
| list(TRANSFORM CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES REPLACE "quadmath" " ${static-libquadmath}") | ||
| message(DEBUG "CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES-${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES}") | ||
| if (NOT HAS_STATIC_LIBGFORTRAN OR NOT HAS_STATIC_LIBGCC) | ||
| message(FATAL_ERROR "Please check your compiler. gfortran supports -static-libgcc and -static-libgfortran since at least 2007, but HAS_STATIC_LIBGFORTRAN=${HAS_STATIC_LIBGFORTRAN}, HAS_STATIC_LIBGCC=${HAS_STATIC_LIBGCC}") |
Member
There was a problem hiding this comment.
I think this is quite reasonable. And kind wording "Please check your compiler..."
| message(FATAL_ERROR "Please check your compiler. gfortran supports -static-libgcc and -static-libgfortran since at least 2007, but HAS_STATIC_LIBGFORTRAN=${HAS_STATIC_LIBGFORTRAN}, HAS_STATIC_LIBGCC=${HAS_STATIC_LIBGCC}") | ||
| endif() | ||
| if (HAS_STATIC_LIBQUADMATH) | ||
| target_link_options(fortran_project_options INTERFACE |
| message(DEBUG "CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES=${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES}") | ||
| # On brew gcc 12.2.0 | ||
| # => CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES=gfortran;emutls_w;gcc;quadmath;emutls_w;gcc;gcc | ||
| # On https://github.com/fxcoudert/gfortran-for-macOS |
Member
There was a problem hiding this comment.
I think moving forward we'll just always plan on brewing gcc, but this is good to have documented, thanks.
Member
|
This tests fine locally. I'll go ahead and merge this one in. Thanks @jmarrec |
This was referenced Nov 20, 2023
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull request overview
Pull Request Author
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
Reviewer
This will not be exhaustively relevant to every PR.