From d32c3965b97d9eb7365d5de53449771aa787909b Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Fri, 31 Jan 2020 13:23:08 +0100 Subject: [PATCH] add std=legacy flags for f77/f90 codes that don't compile anymore with gfortran >= 10 --- teshsuite/smpi/mpich3-test/f77/coll/CMakeLists.txt | 8 +++----- teshsuite/smpi/mpich3-test/f77/datatype/CMakeLists.txt | 7 +++++-- teshsuite/smpi/mpich3-test/f77/pt2pt/CMakeLists.txt | 3 +++ teshsuite/smpi/mpich3-test/f90/coll/CMakeLists.txt | 3 +++ teshsuite/smpi/mpich3-test/f90/datatype/CMakeLists.txt | 5 ++++- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/teshsuite/smpi/mpich3-test/f77/coll/CMakeLists.txt b/teshsuite/smpi/mpich3-test/f77/coll/CMakeLists.txt index c20537aad2..febf8ff2e5 100644 --- a/teshsuite/smpi/mpich3-test/f77/coll/CMakeLists.txt +++ b/teshsuite/smpi/mpich3-test/f77/coll/CMakeLists.txt @@ -17,14 +17,12 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN) add_executable(${test} EXCLUDE_FROM_ALL ${test}.f) add_dependencies(tests ${test}) target_link_libraries(${test} simgrid mtest_f77) + if((CMAKE_Fortran_COMPILER_ID MATCHES "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "9.99")) + set_property(SOURCE ${test}.f PROPERTY COMPILE_FLAGS -std=legacy) + endif() endforeach() endif() -# These test seem to not compile with gfortran 10 for now, so work around that bug that is not ours -if((CMAKE_Fortran_COMPILER_ID MATCHES "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "9.99")) - set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/inplacef.f" PROPERTY COMPILE_FLAGS -fallow-argument-mismatch) -endif() - set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/allredint8f.f diff --git a/teshsuite/smpi/mpich3-test/f77/datatype/CMakeLists.txt b/teshsuite/smpi/mpich3-test/f77/datatype/CMakeLists.txt index 5132564627..29af36fa6f 100644 --- a/teshsuite/smpi/mpich3-test/f77/datatype/CMakeLists.txt +++ b/teshsuite/smpi/mpich3-test/f77/datatype/CMakeLists.txt @@ -14,10 +14,13 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN) foreach(test gaddressf allctypesf hindex1f hindexed_blockf packef typecntsf typem2f typename3f typenamef typesnamef - typesubf) + typesubf) add_executable(${test} EXCLUDE_FROM_ALL ${test}.f) add_dependencies(tests ${test}) - target_link_libraries(${test} simgrid mtest_f77) + target_link_libraries(${test} simgrid mtest_f77) + if((CMAKE_Fortran_COMPILER_ID MATCHES "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "9.99")) + set_property(SOURCE ${test}.f PROPERTY COMPILE_FLAGS -std=legacy) + endif() endforeach() endif() diff --git a/teshsuite/smpi/mpich3-test/f77/pt2pt/CMakeLists.txt b/teshsuite/smpi/mpich3-test/f77/pt2pt/CMakeLists.txt index 07fc59922c..51e98fb1fd 100644 --- a/teshsuite/smpi/mpich3-test/f77/pt2pt/CMakeLists.txt +++ b/teshsuite/smpi/mpich3-test/f77/pt2pt/CMakeLists.txt @@ -10,6 +10,9 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN) include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi") add_executable(allpairf EXCLUDE_FROM_ALL allpairf.f) + if((CMAKE_Fortran_COMPILER_ID MATCHES "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "9.99")) + set_property(SOURCE allpairf.f PROPERTY COMPILE_FLAGS -std=legacy) + endif() add_executable(greqf EXCLUDE_FROM_ALL greqf.f dummyf.f) # add_executable(mprobef EXCLUDE_FROM_ALL mprobef.f) add_executable(statusesf EXCLUDE_FROM_ALL statusesf.f) diff --git a/teshsuite/smpi/mpich3-test/f90/coll/CMakeLists.txt b/teshsuite/smpi/mpich3-test/f90/coll/CMakeLists.txt index 9651b8ecb0..ee83d0f11b 100644 --- a/teshsuite/smpi/mpich3-test/f90/coll/CMakeLists.txt +++ b/teshsuite/smpi/mpich3-test/f90/coll/CMakeLists.txt @@ -17,6 +17,9 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN) add_executable(${test} EXCLUDE_FROM_ALL ${test}.f90) add_dependencies(tests ${test}) target_link_libraries(${test} simgrid mtest_f90) + if((CMAKE_Fortran_COMPILER_ID MATCHES "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "9.99")) + set_property(SOURCE ${test}.f90 PROPERTY COMPILE_FLAGS -std=legacy) + endif() endforeach() endif() diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/CMakeLists.txt b/teshsuite/smpi/mpich3-test/f90/datatype/CMakeLists.txt index 3218a78d64..35763769ea 100644 --- a/teshsuite/smpi/mpich3-test/f90/datatype/CMakeLists.txt +++ b/teshsuite/smpi/mpich3-test/f90/datatype/CMakeLists.txt @@ -17,7 +17,10 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN) typesubf90) add_executable(${test} EXCLUDE_FROM_ALL ${test}.f90) add_dependencies(tests ${test}) - target_link_libraries(${test} simgrid mtest_f90) + target_link_libraries(${test} simgrid mtest_f90) + if((CMAKE_Fortran_COMPILER_ID MATCHES "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "9.99")) + set_property(SOURCE ${test}.f90 PROPERTY COMPILE_FLAGS -std=legacy) + endif() endforeach() endif() -- 2.20.1