Remove fortran name mangling and DPSB_IPK/LPK for C compiler

pull/28/head
Luca Pepè Sciarria 1 year ago
parent c017dd7e30
commit ecf70fddcb

@ -91,35 +91,35 @@ endif()
# Fortran name mangling introspection # Fortran name mangling introspection
#------------------------------------ #------------------------------------
include("${CMAKE_CURRENT_LIST_DIR}/cmake/CapitalizeString.cmake") include("${CMAKE_CURRENT_LIST_DIR}/cmake/CapitalizeString.cmake")
include(FortranCInterface) #include(FortranCInterface)
CapitalizeString(${FortranCInterface_GLOBAL__CASE} fc_case) #CapitalizeString(${FortranCInterface_GLOBAL__CASE} fc_case)
message(STATUS "Name mangling capitalization: ${fc_case}") #message(STATUS "Name mangling capitalization: ${fc_case}")
message(STATUS "Name mangling fortran global suffix underscore: ${FortranCInterface_GLOBAL__SUFFIX}") #message(STATUS "Name mangling fortran global suffix underscore: ${FortranCInterface_GLOBAL__SUFFIX}")
if(FortranCInterface_GLOBAL__SUFFIX STREQUAL "") #if(FortranCInterface_GLOBAL__SUFFIX STREQUAL "")
add_compile_options("-D${fc_case}Case") # add_compile_options("-D${fc_case}Case")
elseif(FortranCInterface_GLOBAL__SUFFIX STREQUAL "_") #elseif(FortranCInterface_GLOBAL__SUFFIX STREQUAL "_")
add_compile_options("-D${fc_case}Underscore") # add_compile_options("-D${fc_case}Underscore")
elseif(FortranCInterface_GLOBAL__SUFFIX STREQUAL "__") #elseif(FortranCInterface_GLOBAL__SUFFIX STREQUAL "__")
add_compile_options("-D${fc_case}DoubleUnderscore") # add_compile_options("-D${fc_case}DoubleUnderscore")
else() #else()
message( FATAL_ERROR "Fortran name mangling suffix, \'${FortranCInterface_GLOBAL__SUFFIX}\', unknown to PSBLAS") # message( FATAL_ERROR "Fortran name mangling suffix, \'${FortranCInterface_GLOBAL__SUFFIX}\', unknown to PSBLAS")
endif() #endif()
message(STATUS "win? ${WIN32};") # message(STATUS "win? ${WIN32};")
if(TRUE)#NOT ${WIN32}) #if(TRUE)#NOT ${WIN32})
#previous check did not work if WIN32 is empty string #previous check did not work if WIN32 is empty string
#---------------------------------------------- #----------------------------------------------
# Determine system endian-ness and pointer size # Determine system endian-ness and pointer size
#---------------------------------------------- #----------------------------------------------
include(TestBigEndian) # include(TestBigEndian)
TEST_BIG_ENDIAN(IS_BIG_ENDIAN) # TEST_BIG_ENDIAN(IS_BIG_ENDIAN)
if(IS_BIG_ENDIAN) # if(IS_BIG_ENDIAN)
message( STATUS "System appears to be big endian.") # message( STATUS "System appears to be big endian.")
else() # else()
message( STATUS "System appears to be little endian.") # message( STATUS "System appears to be little endian.")
add_compile_options(-DLittleEndian) # add_compile_options(-DLittleEndian)
endif() # endif()
# include(CheckTypeSize) # include(CheckTypeSize)
# CHECK_TYPE_SIZE("void *" VOID_P_SIZE LANGUAGE C) # CHECK_TYPE_SIZE("void *" VOID_P_SIZE LANGUAGE C)
# if(${VOID_P_SIZE} EQUAL 8) # if(${VOID_P_SIZE} EQUAL 8)
@ -128,7 +128,7 @@ if(TRUE)#NOT ${WIN32})
# message(STATUS "Have 64bit pointers") # message(STATUS "Have 64bit pointers")
endif() #endif()
@ -156,9 +156,11 @@ set(PSB_LPKDEF "#define PSB_LPK${LPK_SIZE}")
message(STATUS "Using IPKDEF: ${PSB_IPKDEF}") message(STATUS "Using IPKDEF: ${PSB_IPKDEF}")
message(STATUS "Using LPKDEF: ${PSB_LPKDEF}") message(STATUS "Using LPKDEF: ${PSB_LPKDEF}")
add_compile_options(-DPSB_IPK${IPK_SIZE}) #add_compile_options(-DPSB_IPK${IPK_SIZE})
add_compile_options(-DPSB_LPK${LPK_SIZE}) #add_compile_options(-DPSB_LPK${LPK_SIZE})
# Add PSB_IPK/LPK flag only for fortran files.
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DPSB_IPK${IPK_SIZE}")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DPSB_LPK${LPK_SIZE}")

Loading…
Cancel
Save