diff --git a/blas/testing/CMakeLists.txt b/blas/testing/CMakeLists.txt index f0ee6a487..8b8ff44fd 100644 --- a/blas/testing/CMakeLists.txt +++ b/blas/testing/CMakeLists.txt @@ -48,5 +48,13 @@ ei_add_blas_test(zblat3) # add_custom_target(level1) # add_dependencies(level1 sblat1) +# Workaround for gfortran -O3 bug. The optimization +# introduces a bug in the calculation of the norm of the error +# in the complex case. +if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") + target_compile_options(cblat3 PRIVATE "-O0") + target_compile_options(zblat3 PRIVATE "-O0") +endif() + endif()