Skip to content

Commit

Permalink
testing mpich build
Browse files Browse the repository at this point in the history
  • Loading branch information
ShatrovOA committed Oct 24, 2024
1 parent 011a15a commit 66ee627
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,20 @@ else()
endif()
target_include_directories(dtfft PRIVATE ${PROJECT_SOURCE_DIR}/src/include)
target_include_directories(dtfft PRIVATE ${PROJECT_BINARY_DIR})
target_include_directories(dtfft PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:${MPI_Fortran_MODULE_DIR}>)
target_include_directories(dtfft PRIVATE $<$<COMPILE_LANGUAGE:C,CXX>:${MPI_C_INCLUDE_DIRS}>)
target_link_libraries(dtfft PRIVATE ${MPI_Fortran_LIBRARIES})

set(DTFFT_MODULE_DIR ${PROJECT_BINARY_DIR}/mod)
set_target_properties(dtfft PROPERTIES Fortran_MODULE_DIRECTORY ${DTFFT_MODULE_DIR})
set_target_properties(dtfft PROPERTIES VERSION ${CMAKE_PROJECT_VERSION})
set(DTFFT_HEADER_DIR "${PROJECT_SOURCE_DIR}/include")
SET(DTFFT_MODULE "${DTFFT_MODULE_DIR}/dtfft.mod")
SET(DTFFT_HEADERS "${DTFFT_MODULE};${DTFFT_HEADER_DIR}/dtfft.f03")
target_link_libraries(dtfft PRIVATE MPI::MPI_Fortran MPI::MPI_C)

if(DTFFT_BUILD_C_CXX_API)
set(DTFFT_HEADERS "${DTFFT_HEADERS};${DTFFT_HEADER_DIR}/dtfft.h;${DTFFT_HEADER_DIR}/dtfft.hpp;${DTFFT_CONF_HEADER}")
target_link_libraries(dtfft PRIVATE MPI::MPI_CXX)
target_link_libraries(dtfft PRIVATE ${MPI_CXX_LIBRARIES})
endif()
set_target_properties(dtfft PROPERTIES PUBLIC_HEADER "${DTFFT_HEADERS}")
target_include_directories(dtfft INTERFACE $<INSTALL_INTERFACE:include>)
Expand Down
6 changes: 4 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ foreach(test ${TEST_SOURCES})
get_filename_component(extension ${test} EXT)
add_executable(${test_name} ${test})
target_link_libraries(${test_name} PRIVATE dtfft)
target_link_libraries(${test_name} PRIVATE MPI::MPI_Fortran)
target_link_libraries(${test_name} PRIVATE ${MPI_Fortran_LIBRARIES})
target_include_directories(${test_name} PRIVATE ${PROJECT_BINARY_DIR})
target_include_directories(${test_name} PRIVATE ${PROJECT_SOURCE_DIR}/include)
target_include_directories(${test_name} PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:${PROJECT_SOURCE_DIR}/src/include>)
target_include_directories(${test_name} PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:${DTFFT_MODULE_DIR}>)
target_include_directories(${test_name} PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:${MPI_Fortran_MODULE_DIR}>)
target_include_directories(${test_name} PRIVATE $<$<COMPILE_LANGUAGE:C,CXX>:${MPI_C_INCLUDE_DIRS}>)
if( extension STREQUAL ".cpp" )
target_link_libraries(${test_name} PRIVATE MPI::MPI_CXX)
target_link_libraries(${test_name} PRIVATE ${MPI_CXX_LIBRARIES})
endif()

foreach(nproc RANGE 1 ${TESTS_MAX_PROC} 1)
Expand Down

0 comments on commit 66ee627

Please sign in to comment.