Skip to content

Commit

Permalink
FORTLINK: Guess of Unknown
Browse files Browse the repository at this point in the history
Guess the FORTLINK API convention is `UNDERSCORE` for unknown values,
unless it's the classic (non-clang) IBM Fortran compiler, where it's
`LOWERCASE`.
  • Loading branch information
ax3l committed Jul 9, 2020
1 parent c2a57a2 commit ee6a7e6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Tools/CMake/AMReX_Defines.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,13 @@ function ( set_amrex_defines )
set(FORTLINK "UNDERSCORE")
message(STATUS "Fortran name mangling scheme: ${FORTLINK} (lower case, append underscore)")
else ()
message(AUTHOR_WARNING "Fortran to C mangling not compatible with AMReX code")
# now we have to guess
if (CMAKE_Fortran_COMPILER_ID MATCHES XL) # old IBM prior to XLClang
set(FORTLINK "LOWERCASE")
else ()
set(FORTLINK "UNDERSCORE")
endif()
message(AUTHOR_WARNING "Fortran to C mangling not compatible with AMReX code, assuming '${FORTLINK}'")
endif ()

add_amrex_define( BL_FORT_USE_${FORTLINK} ) # Only legacy form
Expand Down

0 comments on commit ee6a7e6

Please sign in to comment.