-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
28 lines (22 loc) · 967 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
cmake_minimum_required(VERSION 3.21)
project(coarray_halo_exchange Fortran)
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "Setting build type to 'Release' as none was specified")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build" FORCE)
endif()
option(BUILD_MPI_TEST "Build an MPI version of the test program" OFF)
add_compile_definitions("$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
# Set missing CMake defaults for the NAG Fortran compiler
if(CMAKE_Fortran_COMPILER_ID STREQUAL NAG)
set(CMAKE_Fortran_FLAGS_DEBUG "-u -O0 -gline -C -nan")
set(CMAKE_Fortran_FLAGS_RELEASE "-u -O3")
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELEASE} -gline")
endif()
if(BUILD_MPI_TEST)
find_package(MPI REQUIRED Fortran)
add_subdirectory(mpi)
else()
add_compile_options($<$<Fortran_COMPILER_ID:NAG,Intel,IntelLLVM>:-coarray>)
add_link_options($<$<Fortran_COMPILER_ID:NAG,Intel,IntelLLVM>:-coarray>)
add_subdirectory(coarray)
endif()