From 0fdc99c65e59bda015e4996768f0959ce5928c48 Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Mon, 30 Aug 2021 12:26:39 -0700 Subject: [PATCH] Allow old Fortran code for LAPACK tests to compile despite argument mismatch errors (REAL passed to COMPLEX workspace argument) with GNU Fortran 10. (cherry picked from commit 7e096ddcb09d560a846b119691e48651e74ee677) --- lapack/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lapack/CMakeLists.txt b/lapack/CMakeLists.txt index e48497fda..4fc7fe195 100644 --- a/lapack/CMakeLists.txt +++ b/lapack/CMakeLists.txt @@ -5,6 +5,13 @@ include(CheckLanguage) check_language(Fortran) if(CMAKE_Fortran_COMPILER) enable_language(Fortran) + if("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU") + if ("${CMAKE_Fortran_COMPILER_VERSION}" VERSION_GREATER_EQUAL 10.0) + # We use an old version of LAPACK with argument type mismatches. + # Allow them to compile anyway with newer GNU versions. + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch") + endif() + endif() set(EIGEN_Fortran_COMPILER_WORKS ON) else() set(EIGEN_Fortran_COMPILER_WORKS OFF)