Skip to content

Commit

Permalink
mpiseq: C,Fortran objects for compiler compatibility
Browse files Browse the repository at this point in the history
Co-authored-by: Dario Mangoni <dariomangoni@users.noreply.github.com>
  • Loading branch information
scivision and dariomangoni committed May 17, 2024
1 parent 5323422 commit 880d235
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ message(VERBOSE "MUMPS ${MUMPS_UPSTREAM_VERSION} source directory: ${mumps_SOURC

# --- mpiseq (No MPI)
if(NOT parallel)
set(NUMERIC_LIBS LAPACK::LAPACK)
include(cmake/libseq.cmake)
set(NUMERIC_LIBS mpiseq LAPACK::LAPACK)
endif()

list(APPEND NUMERIC_LIBS ${CMAKE_THREAD_LIBS_INIT})
Expand Down
17 changes: 16 additions & 1 deletion cmake/libseq.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
set(_l "${mumps_SOURCE_DIR}/libseq/")

add_library(mpiseq ${_l}elapse.c ${_l}mpi.f ${_l}mpic.c)
add_library(mpiseq_C OBJECT ${_l}elapse.c ${_l}mpic.c)
target_include_directories(mpiseq_C PUBLIC
"$<BUILD_INTERFACE:${_l}>"
$<INSTALL_INTERFACE:include>
)

add_library(mpiseq_FORTRAN OBJECT ${_l}mpi.f)
target_include_directories(mpiseq_FORTRAN PUBLIC
"$<BUILD_INTERFACE:${_l}>"
$<INSTALL_INTERFACE:include>
)

add_library(mpiseq $<TARGET_OBJECTS:mpiseq_C> $<TARGET_OBJECTS:mpiseq_FORTRAN>)

target_include_directories(mpiseq PUBLIC
"$<BUILD_INTERFACE:${_l}>"
Expand All @@ -12,3 +24,6 @@ set_property(TARGET mpiseq PROPERTY EXPORT_NAME MPISEQ)
install(TARGETS mpiseq EXPORT ${PROJECT_NAME}-targets)

install(FILES ${_l}elapse.h ${_l}mpi.h ${_l}mpif.h TYPE INCLUDE)

set(NUMERIC_INC ${_l})
list(APPEND NUMERIC_LIBS mpiseq)

0 comments on commit 880d235

Please sign in to comment.