Skip to content

Commit dd2d888

Browse files
Update build script
1 parent 492b62e commit dd2d888

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@ get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
5858
if (Fortran_COMPILER_NAME MATCHES "gfortran.*")
5959
# gfortran
6060
# Options: https://gcc.gnu.org/onlinedocs/gfortran/Option-Summary.html
61-
set(CMAKE_Fortran_FLAGS_RELEASE "-funroll-all-loops -fno-f2c -O3")
61+
if (WIN32 AND NOT BUILD_SHARED_LIBS)
62+
# For some reason higher than -O1 results in a segmentation fault on
63+
# Windows 7 and on Windows 10 (64-bit versions)
64+
set(CMAKE_Fortran_FLAGS_RELEASE "-funroll-all-loops -fno-f2c -O1")
65+
else()
66+
set(CMAKE_Fortran_FLAGS_RELEASE "-funroll-all-loops -fno-f2c -O3")
67+
endif()
6268
set(CMAKE_Fortran_FLAGS_DEBUG "-fno-f2c -O0 -g -Wall -Wno-c-binding-type")
6369
elseif (Fortran_COMPILER_NAME MATCHES "ifort.*")
6470
# ifort (untested)

0 commit comments

Comments
 (0)