Skip to content

Commit b89d0a5

Browse files
committed
don't use -fcoarray flag in serial ifort builds
1 parent bac4497 commit b89d0a5

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

CMakeLists.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ else()
3131
add_definitions(-DREAL32)
3232
endif()
3333

34+
if(SERIAL)
35+
message(STATUS "Configuring build for serial execution")
36+
else()
37+
message(STATUS "Configuring build for parallel execution")
38+
add_definitions(-DCAF)
39+
endif()
40+
3441
# compiler flags for gfortran
3542
if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
3643

@@ -52,9 +59,15 @@ endif()
5259

5360
# compiler flags for ifort
5461
if(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
55-
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -coarray=shared -fpp -assume byterecl,realloc_lhs -heap-arrays")
62+
63+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp -assume byterecl,realloc_lhs -heap-arrays")
5664
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -C -traceback")
5765
set(CMAKE_Fortran_FLAGS_RELEASE "-O3")
66+
67+
if(NOT SERIAL)
68+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -coarray=shared")
69+
endif()
70+
5871
endif()
5972

6073
# compiler flags for Cray ftn

0 commit comments

Comments
 (0)