diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 306d5bad7..268f82fe1 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,7 +21,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - gcc_v: [7, 8, 9, 10, 11] # Version of GFortran we want to use. + gcc_v: [9, 10, 11] # Version of GFortran we want to use. env: FC: gfortran-${{ matrix.gcc_v }} GCC_V: ${{ matrix.gcc_v }} diff --git a/.github/workflows/ci_windows.yml b/.github/workflows/ci_windows.yml index a1070404c..6b780106d 100644 --- a/.github/workflows/ci_windows.yml +++ b/.github/workflows/ci_windows.yml @@ -7,41 +7,6 @@ env: CTEST_TIME_TIMEOUT: "5" # some failures hang forever jobs: - Build: - runs-on: windows-latest - strategy: - fail-fast: false - - steps: - - uses: actions/checkout@v1 - - - name: Install fypp - run: pip install fypp - - - run: cmake -G "MinGW Makefiles" -DCMAKE_SH="CMAKE_SH-NOTFOUND" -Wdev -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_Fortran_FLAGS_DEBUG="-Wall -Wextra -Wimplicit-interface -fPIC -g -fcheck=all -fbacktrace" -DCMAKE_MAXIMUM_RANK=4 - - env: - FC: gfortran - CC: gcc - CXX: g++ - - - name: CMake build - run: cmake --build build --parallel - - - name: catch build fail - run: cmake --build build --verbose --parallel 1 - if: failure() - - - name: CTest - run: ctest --output-on-failure --parallel -V -LE quadruple_precision - working-directory: build - - - uses: actions/upload-artifact@v1 - if: failure() - with: - name: WindowsCMakeTestlog - path: build/Testing/Temporary/LastTest.log - msys2-build: runs-on: windows-latest strategy: diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e06b0250..bae75a426 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,9 @@ add_subdirectory(config) # --- compiler options if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU) + if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 9.0) + message(FATAL_ERROR "GCC Version 9 or newer required") + endif() add_compile_options(-fimplicit-none) add_compile_options(-ffree-line-length-132) add_compile_options(-Wall) @@ -27,11 +30,7 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU) if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 11.0) add_compile_options(-pedantic-errors) endif() - if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0) - add_compile_options(-std=f2018) - else() - add_compile_options(-std=f2008ts) - endif() + add_compile_options(-std=f2018) elseif(CMAKE_Fortran_COMPILER_ID STREQUAL Intel) add_compile_options(-warn declarations,general,usage,interfaces,unused) if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 18.0) diff --git a/README.md b/README.md index f87a2ef9d..5615c4bba 100644 --- a/README.md +++ b/README.md @@ -87,9 +87,8 @@ The following combinations are tested on the default branch of stdlib: Name | Version | Platform | Architecture --- | --- | --- | --- -GCC Fortran | 7, 8, 9, 10, 11 | Ubuntu 20.04 | x86_64 -GCC Fortran | 7, 8, 9, 10, 11 | MacOS Catalina 10.15 | x86_64 -GCC Fortran | 8 | Windows Server 2019 | x86_64 +GCC Fortran | 9, 10, 11 | Ubuntu 20.04 | x86_64 +GCC Fortran | 9, 10, 11 | MacOS Catalina 10.15 | x86_64 GCC Fortran (MSYS) | 10 | Windows Server 2019 | x86_64 GCC Fortran (MinGW) | 10 | Windows Server 2019 | x86_64, i686 Intel oneAPI classic | 2021.1 | Ubuntu 20.04 | x86_64 @@ -106,7 +105,7 @@ A list of tested compilers which are currently not working and the respective is Name | Version | Platform | Architecture | Status --- | --- | --- | --- | --- -GCC Fortran | 7.4 | Windows 10 | i686 | [#296](https://github.com/fortran-lang/stdlib/issues/296) +GCC Fortran | <9 | any | any | [#296](https://github.com/fortran-lang/stdlib/issues/296), [#430](https://github.com/fortran-lang/stdlib/pull/430) NVIDIA HPC SDK | 20.7, 20.9, 20.11 | Manjaro Linux 20 | x86_64 | [#107](https://github.com/fortran-lang/stdlib/issues/107) NAG | 7.0 | RHEL | x86_64 | [#108](https://github.com/fortran-lang/stdlib/issues/108) Intel Parallel Studio XE | 16, 17, 18 | OpenSUSE | x86_64 | failed to compile diff --git a/src/stdlib_string_type.fypp b/src/stdlib_string_type.fypp index 144cd2716..52f5201f8 100644 --- a/src/stdlib_string_type.fypp +++ b/src/stdlib_string_type.fypp @@ -447,9 +447,7 @@ contains !> Return the character sequence represented by the string. pure function char_string(string) result(character_string) type(string_type), intent(in) :: string - ! GCC 8 and older cannot evaluate pure derived type procedures here - !character(len=len(string)) :: character_string - character(len=:), allocatable :: character_string + character(len=len(string)) :: character_string character_string = maybe(string) @@ -1241,9 +1239,7 @@ contains !> Safely return the character sequences represented by the string pure function maybe(string) result(maybe_string) type(string_type), intent(in) :: string - ! GCC 8 and older cannot evaluate pure derived type procedures here - !character(len=len(string)) :: maybe_string - character(len=:), allocatable :: maybe_string + character(len=len(string)) :: maybe_string if (allocated(string%raw)) then maybe_string = string%raw else