From ecf70fddcba7e25ba699cbf319cc472f0b880ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20Pep=C3=A8=20Sciarria?= Date: Thu, 17 Apr 2025 10:58:20 +0200 Subject: [PATCH] Remove fortran name mangling and DPSB_IPK/LPK for C compiler --- CMakeLists.txt | 60 ++++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ef636090..9798277a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,35 +91,35 @@ endif() # Fortran name mangling introspection #------------------------------------ include("${CMAKE_CURRENT_LIST_DIR}/cmake/CapitalizeString.cmake") -include(FortranCInterface) -CapitalizeString(${FortranCInterface_GLOBAL__CASE} fc_case) -message(STATUS "Name mangling capitalization: ${fc_case}") -message(STATUS "Name mangling fortran global suffix underscore: ${FortranCInterface_GLOBAL__SUFFIX}") -if(FortranCInterface_GLOBAL__SUFFIX STREQUAL "") - add_compile_options("-D${fc_case}Case") -elseif(FortranCInterface_GLOBAL__SUFFIX STREQUAL "_") - add_compile_options("-D${fc_case}Underscore") -elseif(FortranCInterface_GLOBAL__SUFFIX STREQUAL "__") - add_compile_options("-D${fc_case}DoubleUnderscore") -else() - message( FATAL_ERROR "Fortran name mangling suffix, \'${FortranCInterface_GLOBAL__SUFFIX}\', unknown to PSBLAS") -endif() - - - message(STATUS "win? ${WIN32};") -if(TRUE)#NOT ${WIN32}) +#include(FortranCInterface) +#CapitalizeString(${FortranCInterface_GLOBAL__CASE} fc_case) +#message(STATUS "Name mangling capitalization: ${fc_case}") +#message(STATUS "Name mangling fortran global suffix underscore: ${FortranCInterface_GLOBAL__SUFFIX}") +#if(FortranCInterface_GLOBAL__SUFFIX STREQUAL "") +# add_compile_options("-D${fc_case}Case") +#elseif(FortranCInterface_GLOBAL__SUFFIX STREQUAL "_") +# add_compile_options("-D${fc_case}Underscore") +#elseif(FortranCInterface_GLOBAL__SUFFIX STREQUAL "__") +# add_compile_options("-D${fc_case}DoubleUnderscore") +#else() +# message( FATAL_ERROR "Fortran name mangling suffix, \'${FortranCInterface_GLOBAL__SUFFIX}\', unknown to PSBLAS") +#endif() + + +# message(STATUS "win? ${WIN32};") +#if(TRUE)#NOT ${WIN32}) #previous check did not work if WIN32 is empty string #---------------------------------------------- # Determine system endian-ness and pointer size #---------------------------------------------- - include(TestBigEndian) - TEST_BIG_ENDIAN(IS_BIG_ENDIAN) - if(IS_BIG_ENDIAN) - message( STATUS "System appears to be big endian.") - else() - message( STATUS "System appears to be little endian.") - add_compile_options(-DLittleEndian) - endif() +# include(TestBigEndian) +# TEST_BIG_ENDIAN(IS_BIG_ENDIAN) +# if(IS_BIG_ENDIAN) +# message( STATUS "System appears to be big endian.") +# else() +# message( STATUS "System appears to be little endian.") +# add_compile_options(-DLittleEndian) +# endif() # include(CheckTypeSize) # CHECK_TYPE_SIZE("void *" VOID_P_SIZE LANGUAGE C) # if(${VOID_P_SIZE} EQUAL 8) @@ -128,7 +128,7 @@ if(TRUE)#NOT ${WIN32}) # 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 LPKDEF: ${PSB_LPKDEF}") -add_compile_options(-DPSB_IPK${IPK_SIZE}) -add_compile_options(-DPSB_LPK${LPK_SIZE}) - +#add_compile_options(-DPSB_IPK${IPK_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}")