Skip to content

Commit

Permalink
Merge pull request #127 from ArmstrongJ/fortran-include-fix
Browse files Browse the repository at this point in the history
Fix Fortran Include File Generation
  • Loading branch information
xiaoyeli committed Nov 26, 2023
2 parents 32832c6 + 6153500 commit f530ef3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 21 deletions.
11 changes: 5 additions & 6 deletions FORTRAN/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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}
)

Expand Down Expand Up @@ -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)
5 changes: 5 additions & 0 deletions FORTRAN/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@

Expand Down
15 changes: 0 additions & 15 deletions FORTRAN/superlu_config.fh

This file was deleted.

0 comments on commit f530ef3

Please sign in to comment.