From 70b28ddc08c4422e611fb44d0c615afd4ddaf392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20Pep=C3=A8=20Sciarria?= Date: Thu, 17 Apr 2025 13:49:34 +0200 Subject: [PATCH 1/5] change install directory --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c624c1a1..40b747a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -339,10 +339,10 @@ target_link_libraries(amgcbind -install(DIRECTORY "${CMAKE_BINARY_DIR}/include" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" +install(DIRECTORY ${CMAKE_BINARY_DIR}/include/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" FILES_MATCHING PATTERN "*.h") -install(DIRECTORY "${CMAKE_BINARY_DIR}/modules" DESTINATION "${CMAKE_INSTALL_MODULDIR}" +install(DIRECTORY ${CMAKE_BINARY_DIR}/modules/ DESTINATION "${CMAKE_INSTALL_MODULDIR}" FILES_MATCHING PATTERN "*.mod") From 120da08860f3f8f5ee4f842c379a317087300a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20Pep=C3=A8=20Sciarria?= Date: Thu, 17 Apr 2025 13:50:13 +0200 Subject: [PATCH 2/5] remove fortran name mangling --- CMakeLists.txt | 51 -------------------------------------------------- 1 file changed, 51 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 40b747a4..0210e26c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,57 +104,6 @@ endif() -#TODO: what follow should be taken from psblas. We need to set in PSBLAS CMakeLists.txt the right variable to be used here -#------------------------------------ -# 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}) -#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(CheckTypeSize) - CHECK_TYPE_SIZE("void *" VOID_P_SIZE LANGUAGE C) - if(${VOID_P_SIZE} EQUAL 8) - add_compile_options(-DPtr64Bits) - endif() - message(STATUS "Have 64bit pointers") - - #add define values for integer size (IPKx) and long size (LPKx) - CHECK_TYPE_SIZE("int" INT_SIZE LANGUAGE C) - CHECK_TYPE_SIZE("long" LONG_SIZE LANGUAGE C) - message(STATUS "INT SIZE ${INT_SIZE}") - - #add_compile_options(-DIPK${INT_SIZE}) - #add_compile_options(-DLPK${LONG_SIZE}) - - -endif() From 196cedfedbe3dfeb6f70befe1f47a351c75f7ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20Pep=C3=A8=20Sciarria?= Date: Thu, 17 Apr 2025 13:51:02 +0200 Subject: [PATCH 3/5] correct PSB_IPK/LPK flags, now set only for fortran compiler --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0210e26c..dbd636ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,9 +42,9 @@ include_directories(${INCDIR} ${MODDIR} ${LIBDIR}) message(STATUS "Using IPK size: ${PSB_IPK_SIZE}") message(STATUS "Using LPK size: ${PSB_LPK_SIZE}") - -add_compile_options(-DPSB_IPK${PSB_IPK_SIZE}) -add_compile_options(-DPSB_LPK${PSB_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}") From 7abeb7d19231ae7109518a8bad4a0e62f551033e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20Pep=C3=A8=20Sciarria?= Date: Thu, 17 Apr 2025 13:56:34 +0200 Subject: [PATCH 4/5] hot fix --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dbd636ef..5633c9f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,8 +43,8 @@ message(STATUS "Using IPK size: ${PSB_IPK_SIZE}") message(STATUS "Using LPK size: ${PSB_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}") +set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DPSB_IPK${PSB_IPK_SIZE}") +set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DPSB_LPK${PSB_LPK_SIZE}") From 687e0824e8765d8106233b4e71c89bf668e5e833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20Pep=C3=A8=20Sciarria?= Date: Thu, 17 Apr 2025 14:35:36 +0200 Subject: [PATCH 5/5] change how PSBLAS_INSTALL_DIR is set --- CMakeLists.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5633c9f0..c8aaca80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,10 +4,18 @@ project(amg4psblas VERSION 1.0 LANGUAGES C Fortran) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") -# Check for the installation path for psblas -if(NOT DEFINED PSBLAS_INSTALL_DIR) - message(FATAL_ERROR "Please specify the path to the psblas installation directory using -DPSBLAS_INSTALL_DIR=") + +set(PSBLAS_INSTALL_DIR "" CACHE PATH "Path to the PSBLAS installation +directory") +if(PSBLAS_INSTALL_DIR STREQUAL "") + message(FATAL_ERROR "Please specify the path to the PSBLAS installation directory using -DPSBLAS_INSTALL_DIR= or set it in ccmake.") endif() + + +# Check for the installation path for psblas +#if(NOT DEFINED PSBLAS_INSTALL_DIR) +# message(FATAL_ERROR "Please specify the path to the psblas installation directory using -DPSBLAS_INSTALL_DIR=") +#endif() message(STATUS "psblas directory is ${PSBLAS_INSTALL_DIR};;")