Commit aa00b162 authored by Martin Beseda's avatar Martin Beseda
Browse files

[ENH] Improved compilation, added Fortran MPI

parent e509565d
CMAKE_MINIMUM_REQUIRED(VERSION 3.15)
PROJECT(lib4neuro)
PROJECT(lib4neuro C CXX Fortran)
SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_Fortran_STANDARD 2008) #TODO upgrade to 2018
MESSAGE(STATUS "lib4neuro CMake starting...")
MESSAGE(STATUS "Using CMake ${CMAKE_VERSION}")
......@@ -8,9 +11,15 @@ MESSAGE(STATUS "Using C compiler: ${CMAKE_C_COMPILER}")
MESSAGE(STATUS "Using CXX compiler: ${CMAKE_CXX_COMPILER}")
MESSAGE(STATUS "Using Fortran compiler: ${CMAKE_Fortran_COMPILER}")
# Fortran compile options
SET(CMAKE_Fortran_FLAGS -ffree-line-length-none ${CMAKE_Fortran_FLAGS})
# Looking for MPI
#TODO Make MPI not required => conditional compilation of MPI blocks
set(MPI_TARGETS MPI::MPI_CXX MPI::MPI_C)
OPTION(WITH_MPI ON)
ADD_COMPILE_DEFINITIONS(WITH_MPI)
set(MPI_TARGETS MPI::MPI_CXX MPI::MPI_C MPI::MPI_Fortran)
if(WIN32)
set(MPI_TARGETS "")
......@@ -99,6 +108,7 @@ ELSE()
ADD_COMPILE_DEFINITIONS(BOOST_TEST_DYN_LINK)
ENDIF()
ADD_COMPILE_DEFINITIONS(ARMA_DONT_USE_WRAPPER)
ADD_COMPILE_DEFINITIONS(ARMA_ALLOW_FAKE_GCC)
ADD_COMPILE_DEFINITIONS(BOOST_LIB_DIAGNOSTIC)
#------------#
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment