diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 927f151..1ba4d1f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,3 +1,10 @@ add_subdirectory(lib/Dirac) add_subdirectory(lib/Radio) add_subdirectory(MS) + +find_package(MPI) +if(MPI_FOUND) + add_subdirectory(MPI) +else() + message(STATUS "\n MPI not found, so skipping MPI version") +endif() diff --git a/src/MPI/CMakeLists.txt b/src/MPI/CMakeLists.txt new file mode 100644 index 0000000..07bc3bb --- /dev/null +++ b/src/MPI/CMakeLists.txt @@ -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 +)