added cmake support for MPI

This commit is contained in:
Sarod Yatawatta 2018-08-27 11:30:41 +02:00
parent 0b072da621
commit 03cf4b874f
2 changed files with 43 additions and 0 deletions

View File

@ -1,3 +1,10 @@
add_subdirectory(lib/Dirac) add_subdirectory(lib/Dirac)
add_subdirectory(lib/Radio) add_subdirectory(lib/Radio)
add_subdirectory(MS) add_subdirectory(MS)
find_package(MPI)
if(MPI_FOUND)
add_subdirectory(MPI)
else()
message(STATUS "\n MPI not found, so skipping MPI version")
endif()

36
src/MPI/CMakeLists.txt Normal file
View File

@ -0,0 +1,36 @@
include_directories(${CASACORE_INCLUDE_DIR}/casacore)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../lib/Dirac)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../lib/Radio)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../lib/Radio/reserve)
include_directories(./)
find_package(MPI REQUIRED)
link_directories(${LIBRARY_OUTPUT_PATH})
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/../lib/Dirac)
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/../lib/Radio)
FILE(GLOB SRCFILES *.cpp)
include_directories(SYSTEM ${MPI_INCLUDE_PATH})
add_executable(sagecal-mpi ${SRCFILES})
target_link_libraries(sagecal-mpi
${CASACORE_LIBRARIES}
${CFITSIO_LIBRARIES}
${OpenBLAS_LIB}
${LAPACK_LIBRARIES}
${WCSLIB_LIBRARIES}
${GLIB_PKG_LIBRARIES}
${LIBGFORTRAN_LIBRARIES}
${MPI_CXX_LIBRARIES}
${MPI_CXX_LINK_FLAGS}
-lopenblas
-lgfortran
-lpthread
-lcfitsio
-lm
-ldirac
-lradio
)