1
1
# compiler flags for gfortran
2
2
if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" )
3
3
4
- if (SERIAL)
5
- message (STATUS "Configuring to build with -fcoarray=single" )
6
- add_compile_options ("$<$<COMPILE_LANGUAGE:Fortran>:-fcoarray=single>" )
4
+ if (PARALLEL)
5
+ message (STATUS "Configuring to build with -fcoarray=shared" )
6
+ add_compile_options ("$<$<COMPILE_LANGUAGE:Fortran>:-fcoarray=shared>" )
7
+ add_compile_definitions (PARALLEL)
7
8
else ()
8
- add_compile_options ("$<$<COMPILE_LANGUAGE:Fortran>:-fcoarray=lib >" )
9
+ add_compile_options ("$<$<COMPILE_LANGUAGE:Fortran>:-fcoarray=single >" )
9
10
endif ()
10
11
11
12
if (BLAS)
@@ -14,21 +15,22 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
14
15
message (STATUS "Configuring build to use BLAS from ${BLAS} " )
15
16
endif ()
16
17
17
- add_compile_options ("$<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<CONFIG:Debug>>:-fcheck=bounds;-fbacktrace>" )
18
- add_compile_options ("$<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<CONFIG:Release>>:-Ofast;-fno-frontend-optimize;-fno-backtrace>" )
18
+ add_compile_options ("$<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<CONFIG:Debug>>:-cpp;- fcheck=bounds;-fbacktrace>" )
19
+ add_compile_options ("$<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<CONFIG:Release>>:-cpp;- Ofast;-fno-frontend-optimize;-fno-backtrace>" )
19
20
20
21
elseif (CMAKE_Fortran_COMPILER_ID MATCHES "^Intel" )
21
22
# compiler flags for ifort
22
23
23
- if (SERIAL )
24
- message (STATUS "Configuring to build with -coarray=single " )
24
+ if (PARALLEL )
25
+ message (STATUS "Configuring to build with -coarray=shared " )
25
26
if (WIN32 )
26
- add_compile_options ("$<$<COMPILE_LANGUAGE:Fortran>:/Qcoarray:single >" )
27
- add_link_options ("$<$<COMPILE_LANGUAGE:Fortran>:/Qcoarray:single >" )
27
+ add_compile_options ("$<$<COMPILE_LANGUAGE:Fortran>:/Qcoarray:shared >" )
28
+ add_link_options ("$<$<COMPILE_LANGUAGE:Fortran>:/Qcoarray:shared >" )
28
29
else ()
29
- add_compile_options ("$<$<COMPILE_LANGUAGE:Fortran>:-coarray=single >" )
30
- add_link_options ("$<$<COMPILE_LANGUAGE:Fortran>:-coarray=single >" )
30
+ add_compile_options ("$<$<COMPILE_LANGUAGE:Fortran>:-coarray=shared >" )
31
+ add_link_options ("$<$<COMPILE_LANGUAGE:Fortran>:-coarray=shared >" )
31
32
endif ()
33
+ add_compile_definitions (PARALLEL)
32
34
else ()
33
35
if (WIN32 )
34
36
add_compile_options ("$<$<COMPILE_LANGUAGE:Fortran>:/Qcoarray:shared>" )
@@ -40,16 +42,16 @@ elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^Intel")
40
42
endif ()
41
43
42
44
if (WIN32 )
43
- string (APPEND CMAKE_Fortran_FLAGS " /assume:byterecl" )
45
+ string (APPEND CMAKE_Fortran_FLAGS " /assume:byterecl /fpp " )
44
46
else ()
45
- string (APPEND CMAKE_Fortran_FLAGS " -assume byterecl" )
47
+ string (APPEND CMAKE_Fortran_FLAGS " -assume byterecl -fpp " )
46
48
endif ()
47
- add_compile_options ("$<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<CONFIG:Debug>>:-check;-traceback>" )
48
- # add_compile_options("$<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<CONFIG:Release>>:-O3>")
49
+ add_compile_options ("$<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<CONFIG:Debug>>:-fpp;- check;-traceback>" )
50
+ add_compile_options ("$<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<CONFIG:Release>>:-fpp; -O3>" )
49
51
50
52
elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "Cray" )
51
53
# compiler flags for Cray ftn
52
54
string (APPEND CMAKE_Fortran_FLAGS " -h noomp" )
53
- add_compile_options ("$<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<CONFIG:Debug>>:-O0;-g>" )
54
- add_compile_options ("$<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<CONFIG:Release>>:-O3>" )
55
+ add_compile_options ("$<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<CONFIG:Debug>>:-e Z;- O0;-g>" )
56
+ add_compile_options ("$<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<CONFIG:Release>>:-e Z;- O3>" )
55
57
endif ()
0 commit comments