From b87f09015a4b9f9bb734cee8421cbde2fccd36c8 Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Thu, 2 Nov 2023 09:58:25 -0400 Subject: [PATCH 1/3] Remove pre-generate Fortran include and have Makefile generate it via sed commands --- FORTRAN/Makefile | 5 +++++ FORTRAN/superlu_config.fh | 15 --------------- 2 files changed, 5 insertions(+), 15 deletions(-) delete mode 100644 FORTRAN/superlu_config.fh diff --git a/FORTRAN/Makefile b/FORTRAN/Makefile index 50077c0f..35fec081 100644 --- a/FORTRAN/Makefile +++ b/FORTRAN/Makefile @@ -19,6 +19,11 @@ ZFEXMOBJ = z_f_main.o zhbcode1.o c_fortran_zgssv.o all: dfexm zfexm test_omp +superlu_config.fh: ../SRC/superlu_config.h + sed 's/\/.*$$//' < $< > temp.fh + sed '/typedef/ d' < temp.fh > $@ + rm temp.fh + dfexm: $(DFEXMOBJ) $(SUPERLULIB) $(FORTRAN) $(LOADOPTS) $(DFEXMOBJ) $(LIBS) -o $@ diff --git a/FORTRAN/superlu_config.fh b/FORTRAN/superlu_config.fh deleted file mode 100644 index 0f99068e..00000000 --- a/FORTRAN/superlu_config.fh +++ /dev/null @@ -1,15 +0,0 @@ - -#ifndef SUPERLU_CONFIG_H -#define SUPERLU_CONFIG_H - - - - -#if (XSDK_INDEX_SIZE == 64) -#include -#define _LONGINT 1 -#else -#endif - -#endif /* SUPERLU_CONFIG_H */ - From 48f8b007aaf57704b788d47d2fe427ceff4b70ea Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Thu, 2 Nov 2023 09:59:27 -0400 Subject: [PATCH 2/3] Add step to generate Fortran include in build directory directly. Remove any include path pointing at original Fortran source directory. Add Fortran build directory as an include path. --- FORTRAN/CMakeLists.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/FORTRAN/CMakeLists.txt b/FORTRAN/CMakeLists.txt index 064c7d45..22911779 100644 --- a/FORTRAN/CMakeLists.txt +++ b/FORTRAN/CMakeLists.txt @@ -1,6 +1,6 @@ # include the paths for header files +include_directories(${CMAKE_BINARY_DIR}/FORTRAN) include_directories(${SuperLU_SOURCE_DIR}/SRC) -include_directories(${SuperLU_BINARY_DIR}/FORTRAN) # build examples for target "all" only if enable_examples is set if(NOT enable_examples) @@ -92,10 +92,9 @@ endif() # enable_example # Format superlu_config.fh from superlu_config.h in C add_custom_command( - OUTPUT superlu_config.fh - COMMAND sed;'/^\\//;d';<;superlu_config.h;>;temp.fh + OUTPUT ${CMAKE_BINARY_DIR}/FORTRAN/superlu_config.fh + COMMAND sed;'s/\\/.*$$//';<;superlu_config.h;>;temp.fh COMMAND sed;'/typedef/;d';<;temp.fh;>;superlu_config.fh - COMMAND cp;superlu_config.fh;${SuperLU_SOURCE_DIR}/FORTRAN/. WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/FORTRAN ) -add_custom_target(config_f DEPENDS superlu_config.fh) +add_custom_target(config_f DEPENDS ${CMAKE_BINARY_DIR}/FORTRAN/superlu_config.fh) From 61535006d8efb59321c4e57ded02017c0a4d4a9c Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Thu, 2 Nov 2023 10:28:20 -0400 Subject: [PATCH 3/3] Install Fortran include file generated in build directory. --- FORTRAN/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FORTRAN/CMakeLists.txt b/FORTRAN/CMakeLists.txt index 22911779..b2d7f4fa 100644 --- a/FORTRAN/CMakeLists.txt +++ b/FORTRAN/CMakeLists.txt @@ -52,7 +52,7 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN *.mod ) -install(FILES superlu_config.fh +install(FILES ${CMAKE_BINARY_DIR}/FORTRAN/superlu_config.fh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )