Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Fortran Include File Generation #127

Merged
merged 3 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading