From b8db77f3cf18db56f9d7c8ff5289c90dd46cab82 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Wed, 12 Jun 2024 22:00:41 +0300 Subject: [PATCH 1/8] fortran fix macos --- .github/workflows/test-fortran-macos.yml | 46 +++++++++++++++++++++++ .github/workflows/test-fortran-ubuntu.yml | 2 +- CMakeLists.txt | 2 +- 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test-fortran-macos.yml diff --git a/.github/workflows/test-fortran-macos.yml b/.github/workflows/test-fortran-macos.yml new file mode 100644 index 0000000000..82d9aa7cd3 --- /dev/null +++ b/.github/workflows/test-fortran-macos.yml @@ -0,0 +1,46 @@ +name: test-fortran-macos + +on: [push, pull_request] + +jobs: + fast_build_release: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest] + # toolchain: + # - {compiler: gcc, version: 13} + # # - {compiler: intel, version: '2023.2'} + # # - {compiler: nvidia-hpc, version: '23.11'} + # include: + # - os: ubuntu-latest + # toolchain: {compiler: gcc, version: 12} + + steps: + - uses: actions/checkout@v4 + + - uses: fortran-lang/setup-fortran@v1 + id: setup-fortran + # with: + # compiler: ${{ matrix.toolchain.compiler }} + # version: ${{ matrix.toolchain.version }} + + - name: Create Build Environment + run: cmake -E make_directory ${{runner.workspace}}/build + + - name: Configure CMake + shell: bash + working-directory: ${{runner.workspace}}/build + run: cmake $GITHUB_WORKSPACE -DFORTRAN=ON + + - name: Build + shell: bash + working-directory: ${{runner.workspace}}/build + run: cmake --build . --parallel + + - name: Test + shell: bash + working-directory: ${{runner.workspace}}/build + run: | + ls + ./bin/fortrantest diff --git a/.github/workflows/test-fortran-ubuntu.yml b/.github/workflows/test-fortran-ubuntu.yml index 937f51b12c..7030087313 100644 --- a/.github/workflows/test-fortran-ubuntu.yml +++ b/.github/workflows/test-fortran-ubuntu.yml @@ -1,4 +1,4 @@ -name: test-fortran +name: test-fortran-ubuntu on: [push, pull_request] diff --git a/CMakeLists.txt b/CMakeLists.txt index 68e24246eb..ccaa64107a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -209,7 +209,7 @@ if (BUILD_CXX) "but it is not supported by the compiler. The check failed with this output:\n" "${check_ipo_support_output}") endif() - elseif(NOT ipo_supported) + elseif(NOT ipo_supported OR APPLE) message(STATUS "IPO / LTO: disabled because it is not supported") elseif(NOT BUILD_SHARED_LIBS) # For a static library, we can't be sure whether the final linking will From 077aaf7ee7b16a5d51b966325e26541d28920e60 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Wed, 12 Jun 2024 22:12:17 +0300 Subject: [PATCH 2/8] macos fortran test workflow --- .github/workflows/test-fortran-macos.yml | 10 +++++----- cmake/README.md | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-fortran-macos.yml b/.github/workflows/test-fortran-macos.yml index 82d9aa7cd3..b6ffc2ff6a 100644 --- a/.github/workflows/test-fortran-macos.yml +++ b/.github/workflows/test-fortran-macos.yml @@ -8,8 +8,8 @@ jobs: strategy: matrix: os: [macos-latest] - # toolchain: - # - {compiler: gcc, version: 13} + toolchain: + - {compiler: gcc, version: 13} # # - {compiler: intel, version: '2023.2'} # # - {compiler: nvidia-hpc, version: '23.11'} # include: @@ -21,9 +21,9 @@ jobs: - uses: fortran-lang/setup-fortran@v1 id: setup-fortran - # with: - # compiler: ${{ matrix.toolchain.compiler }} - # version: ${{ matrix.toolchain.version }} + with: + compiler: ${{ matrix.toolchain.compiler }} + version: ${{ matrix.toolchain.version }} - name: Create Build Environment run: cmake -E make_directory ${{runner.workspace}}/build diff --git a/cmake/README.md b/cmake/README.md index 4cb04ac682..5a24107a5a 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -3,7 +3,7 @@ | OS | C++ | Fortran | Python | CSharp Example | .NET | |:-------- | :---: | :------: | :----: | :----: | :----: | | Linux | [![Status][linux_cpp_svg]][linux_cpp_link] | [![Status][linux_fortran_svg]][linux_fortran_link] | [![Status][linux_python_svg]][linux_python_link] | *(1)* | [![Status][linux_dotnet_svg]][linux_dotnet_link] | -| MacOS | [![Status][macos_cpp_svg]][macos_cpp_link] | *(2)* | [![Status][macos_python_svg]][macos_python_link] | *(1)* |[![Status][macos_dotnet_svg]][macos_dotnet_link] | +| MacOS | [![Status][macos_cpp_svg]][macos_cpp_link] | [![Status][macos_fortran_svg]][macos_fortran_link] | [![Status][macos_python_svg]][macos_python_link] | *(1)* |[![Status][macos_dotnet_svg]][macos_dotnet_link] | | Windows | [![Status][windows_cpp_svg]][windows_cpp_link] | *(2)* | [![Status][windows_python_svg]][windows_python_link] | [![Status][windows_csharp_svg]][windows_csharp_link] | [![Status][windows_dotnet_svg]][windows_dotnet_link] | [linux_cpp_svg]: https://github.com/ERGO-Code/HiGHS/actions/workflows/cmake-linux-cpp.yml/badge.svg From 112d82c82a5b0a1294967236d41f264438edb00b Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Wed, 12 Jun 2024 22:17:46 +0300 Subject: [PATCH 3/8] gfortran on macos test server try homebrew --- .github/workflows/test-fortran-macos.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-fortran-macos.yml b/.github/workflows/test-fortran-macos.yml index b6ffc2ff6a..d4e9ceec75 100644 --- a/.github/workflows/test-fortran-macos.yml +++ b/.github/workflows/test-fortran-macos.yml @@ -8,8 +8,8 @@ jobs: strategy: matrix: os: [macos-latest] - toolchain: - - {compiler: gcc, version: 13} + # toolchain: + # - {compiler: gcc, version: 13} # # - {compiler: intel, version: '2023.2'} # # - {compiler: nvidia-hpc, version: '23.11'} # include: @@ -19,11 +19,14 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: fortran-lang/setup-fortran@v1 - id: setup-fortran - with: - compiler: ${{ matrix.toolchain.compiler }} - version: ${{ matrix.toolchain.version }} + # - uses: fortran-lang/setup-fortran@v1 + # id: setup-fortran + # with: + # compiler: ${{ matrix.toolchain.compiler }} + # version: ${{ matrix.toolchain.version }} + + - name: Install GFortran + run: brew install gfortran - name: Create Build Environment run: cmake -E make_directory ${{runner.workspace}}/build From 464691f9a530b58953902bfdbe731aaff05380d1 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Wed, 12 Jun 2024 22:24:13 +0300 Subject: [PATCH 4/8] clean up workflow --- .github/workflows/test-fortran-macos.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/test-fortran-macos.yml b/.github/workflows/test-fortran-macos.yml index d4e9ceec75..074e8ac4d5 100644 --- a/.github/workflows/test-fortran-macos.yml +++ b/.github/workflows/test-fortran-macos.yml @@ -8,23 +8,10 @@ jobs: strategy: matrix: os: [macos-latest] - # toolchain: - # - {compiler: gcc, version: 13} - # # - {compiler: intel, version: '2023.2'} - # # - {compiler: nvidia-hpc, version: '23.11'} - # include: - # - os: ubuntu-latest - # toolchain: {compiler: gcc, version: 12} steps: - uses: actions/checkout@v4 - # - uses: fortran-lang/setup-fortran@v1 - # id: setup-fortran - # with: - # compiler: ${{ matrix.toolchain.compiler }} - # version: ${{ matrix.toolchain.version }} - - name: Install GFortran run: brew install gfortran From d0f45ccd375e64e1030369e68846b5c4673725d1 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Wed, 12 Jun 2024 22:37:42 +0300 Subject: [PATCH 5/8] iteration count 80bau3b macos --- check/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check/CMakeLists.txt b/check/CMakeLists.txt index 0367e593be..cd8a1080e9 100644 --- a/check/CMakeLists.txt +++ b/check/CMakeLists.txt @@ -173,7 +173,7 @@ if (NOT FAST_BUILD OR ALL_TESTS) set(successMacArmInstances "25fv47\;3103\; 5.5018458883\;" - "80bau3b\;3705\; 9.8722419241\;" + "80bau3b\;3686\; 9.8722419241\;" "adlittle\;74\; 2.2549496316\;" "afiro\;22\;-4.6475314286\;" "etamacro\;531\;-7.5571523330\;" From 3fbe0ccf3eccf38667d791dcab6c88dad7f86515 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Wed, 12 Jun 2024 22:50:33 +0300 Subject: [PATCH 6/8] other runner for linux --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 4908e82a5e..4d6c14f7b2 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -7,7 +7,7 @@ on: types: [opened, synchronize, reopened] jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@latest From f761e9afc3a687b5bd9b92ece53ed6dcc98b9456 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Wed, 12 Jun 2024 22:53:38 +0300 Subject: [PATCH 7/8] disable IPO on macos only if fortran is ON --- CMakeLists.txt | 2 +- check/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ccaa64107a..a861f4088f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -209,7 +209,7 @@ if (BUILD_CXX) "but it is not supported by the compiler. The check failed with this output:\n" "${check_ipo_support_output}") endif() - elseif(NOT ipo_supported OR APPLE) + elseif(NOT ipo_supported OR (APPLE AND FORTRAN)) message(STATUS "IPO / LTO: disabled because it is not supported") elseif(NOT BUILD_SHARED_LIBS) # For a static library, we can't be sure whether the final linking will diff --git a/check/CMakeLists.txt b/check/CMakeLists.txt index cd8a1080e9..0367e593be 100644 --- a/check/CMakeLists.txt +++ b/check/CMakeLists.txt @@ -173,7 +173,7 @@ if (NOT FAST_BUILD OR ALL_TESTS) set(successMacArmInstances "25fv47\;3103\; 5.5018458883\;" - "80bau3b\;3686\; 9.8722419241\;" + "80bau3b\;3705\; 9.8722419241\;" "adlittle\;74\; 2.2549496316\;" "afiro\;22\;-4.6475314286\;" "etamacro\;531\;-7.5571523330\;" From 0a0692c8c660bfc0299f5b17bd3a65366b127680 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Wed, 12 Jun 2024 22:58:06 +0300 Subject: [PATCH 8/8] docs fail was not the other runner --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 4d6c14f7b2..4908e82a5e 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -7,7 +7,7 @@ on: types: [opened, synchronize, reopened] jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@latest