diff --git a/.github/julia/build_tarballs.jl b/.github/julia/build_tarballs.jl index 604a8d0915..7da38d9e38 100644 --- a/.github/julia/build_tarballs.jl +++ b/.github/julia/build_tarballs.jl @@ -33,7 +33,7 @@ cmake -DCMAKE_INSTALL_PREFIX=${prefix} \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=${BUILD_SHARED} \ -DZLIB_USE_STATIC_LIBS=${BUILD_STATIC} \ - -DHIPO=ON \ + -DHIPO=ON -DBUILD_SHARED_EXTRAS_LIB=OFF \ -DBLAS_LIBRARIES="${libdir}/libopenblas.${dlext}" \ .. @@ -53,7 +53,6 @@ install_license ../LICENSE.txt products = [ LibraryProduct("libhighs", :libhighs), - LibraryProduct("libhighs_extras", :libhighs_extras), ExecutableProduct("highs", :highs), ] diff --git a/.github/workflows/build-clang.yml b/.github/workflows/build-clang.yml index 4b373164a8..eaf524f5e7 100644 --- a/.github/workflows/build-clang.yml +++ b/.github/workflows/build-clang.yml @@ -17,15 +17,15 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DFAST_BUILD=OFF - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | @@ -34,7 +34,7 @@ jobs: cmake --build . --parallel --config Debug - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -50,15 +50,15 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=RELEASE - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | @@ -67,7 +67,7 @@ jobs: cmake --build . --parallel --config RELEASE - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -83,15 +83,15 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DFAST_BUILD=OFF -DHIGHSINT64=on - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | @@ -100,7 +100,7 @@ jobs: cmake --build . --parallel --config Debug - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -116,15 +116,15 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=RELEASE -DHIGHSINT64=on - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | @@ -133,7 +133,7 @@ jobs: cmake --build . --parallel --config RELEASE - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail diff --git a/.github/workflows/build-fast.yml b/.github/workflows/build-fast.yml index 5f1808a6b6..094b6fd69d 100644 --- a/.github/workflows/build-fast.yml +++ b/.github/workflows/build-fast.yml @@ -17,20 +17,20 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DFAST_BUILD=ON -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_UNITY_BUILD=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: cmake --build . --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ctest --parallel --timeout 300 --output-on-failure -C RELEASE @@ -44,21 +44,21 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DFAST_BUILD=ON -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_UNITY_BUILD=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail diff --git a/.github/workflows/build-intel.yml b/.github/workflows/build-intel.yml index 76451a3ec7..9bab44ab1b 100644 --- a/.github/workflows/build-intel.yml +++ b/.github/workflows/build-intel.yml @@ -10,7 +10,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Add oneAPI to apt shell: bash diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 3eb77d8c37..cacfa18063 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -17,22 +17,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DFAST_BUILD=OFF - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Debug - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -48,22 +48,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DFAST_BUILD=ON -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Debug - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -79,22 +79,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DFAST_BUILD=OFF - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -110,22 +110,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DFAST_BUILD=ON -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -141,22 +141,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DHIGHSINT64=on -DFAST_BUILD=OFF - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Debug - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -172,22 +172,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DFAST_BUILD=ON -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Debug - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -203,22 +203,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DHIGHSINT64=on -DFAST_BUILD=OFF - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -234,22 +234,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DFAST_BUILD=ON -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 0a1e75dcf4..cad276f2fb 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -17,22 +17,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Debug - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -48,22 +48,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DFAST_BUILD=ON -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Debug - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -79,22 +79,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -110,22 +110,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DFAST_BUILD=ON -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -141,22 +141,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DHIGHSINT64=on -DFAST_BUILD=OFF - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -172,22 +172,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DFAST_BUILD=ON -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Debug - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -203,22 +203,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DHIGHSINT64=on -DFAST_BUILD=OFF - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -234,22 +234,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DHIGHSINT64=on -DALL_TESTS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail diff --git a/.github/workflows/build-nuget-package.yml b/.github/workflows/build-nuget-package.yml index fd339eb896..aab6010693 100644 --- a/.github/workflows/build-nuget-package.yml +++ b/.github/workflows/build-nuget-package.yml @@ -14,23 +14,23 @@ jobs: - uses: actions/checkout@v4 - name: Build HiGHS run: | - cmake -E make_directory ${{runner.workspace}}/build + cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON \ -DCMAKE_C_COMPILER=/usr/bin/clang \ -DCMAKE_CXX_COMPILER=/usr/bin/clang++ - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --config Release --parallel --verbose - uses: actions/upload-artifact@v4 with: name: macos-x64 - path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes + path: ${{github.workspace}}/build/dotnet/Highs.Native/runtimes # Build macos arm64 build_macos_arm: @@ -39,10 +39,10 @@ jobs: - uses: actions/checkout@v4 - name: Build HiGHS run: | - cmake -E make_directory ${{runner.workspace}}/build + cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON \ -DCMAKE_C_COMPILER=/usr/bin/clang \ @@ -50,13 +50,13 @@ jobs: - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --config Release --parallel - uses: actions/upload-artifact@v4 with: name: macos-arm64 - path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes + path: ${{github.workspace}}/build/dotnet/Highs.Native/runtimes # Build windows 32 and linux build_windows_32: @@ -65,22 +65,22 @@ jobs: - uses: actions/checkout@v4 - name: Build HiGHS run: | - cmake -E make_directory ${{runner.workspace}}/build32 + cmake -E make_directory ${{github.workspace}}/build32 - name: Configure CMake win32 shell: bash - working-directory: ${{runner.workspace}}/build32 + working-directory: ${{github.workspace}}/build32 run: cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON -A Win32 - name: Build win32 shell: bash - working-directory: ${{runner.workspace}}/build32 + working-directory: ${{github.workspace}}/build32 run: cmake --build . --config Release --parallel - uses: actions/upload-artifact@v4 with: name: win-x32 - path: ${{runner.workspace}}/build32/dotnet/Highs.Native/runtimes/win-x64/ + path: ${{github.workspace}}/build32/dotnet/Highs.Native/runtimes/win-x64/ build_linux: runs-on: ubuntu-latest @@ -135,68 +135,68 @@ jobs: - uses: actions/checkout@v4 - name: Build HiGHS Windows native run: | - cmake -E make_directory ${{runner.workspace}}/build + cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: cmake --build . --config Release --parallel - name: Display structure of downloaded files run: | pwd - ls -R ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes + ls -R ${{github.workspace}}/build/dotnet/Highs.Native/runtimes - name: Download runtimes macos-x64 uses: actions/download-artifact@v4 with: name: macos-x64 - path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes + path: ${{github.workspace}}/build/dotnet/Highs.Native/runtimes - name: Download runtimes macos-arm64 uses: actions/download-artifact@v4 with: name: macos-arm64 - path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes + path: ${{github.workspace}}/build/dotnet/Highs.Native/runtimes - name: Download runtimes win-x32 uses: actions/download-artifact@v4 with: name: win-x32 - path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes/win-x32 + path: ${{github.workspace}}/build/dotnet/Highs.Native/runtimes/win-x32 - name: Download runtimes uses: actions/download-artifact@v4 with: name: linux-x64 - path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes + path: ${{github.workspace}}/build/dotnet/Highs.Native/runtimes - name: Download runtimes uses: actions/download-artifact@v4 with: name: linux-arm64 - path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes + path: ${{github.workspace}}/build/dotnet/Highs.Native/runtimes - name: Display structure of downloaded files - run: ls -R ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes + run: ls -R ${{github.workspace}}/build/dotnet/Highs.Native/runtimes - uses: actions/setup-dotnet@v4 with: dotnet-version: '6.0.x' - name: Dotnet pack - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native run: dotnet pack -c Release /p:Version=1.13.1 - uses: actions/upload-artifact@v4 with: name: nuget - path: ${{runner.workspace}}/build/dotnet/Highs.Native/bin/Release/*.nupkg + path: ${{github.workspace}}/build/dotnet/Highs.Native/bin/Release/*.nupkg dotnet_push: runs-on: windows-latest diff --git a/.github/workflows/build-python-sdist.yml b/.github/workflows/build-python-sdist.yml index d5e25c81b4..8120e18f3e 100644 --- a/.github/workflows/build-python-sdist.yml +++ b/.github/workflows/build-python-sdist.yml @@ -54,13 +54,13 @@ jobs: - name: install highspy run: | - python3 -m venv path/to/venv - source path/to/venv/bin/activate + python3 -m venv .venv + source .venv/bin/activate python3 -m pip install dist/*.tar.gz - name: Test Python Examples run: | - source path/to/venv/bin/activate + source .venv/bin/activate python3 ./examples/call_highs_from_python_highspy.py python3 ./examples/call_highs_from_python_mps.py python3 ./examples/call_highs_from_python.py @@ -73,16 +73,13 @@ jobs: - uses: actions/checkout@v4 - name: Build sdist - shell: bash run: pipx run build --sdist - name: check metadata run: pipx run twine check dist/* - name: install highspy - run: | - $item = Get-ChildItem dist - python -m pip install "$item" + run: python -m pip install (Get-ChildItem dist\*.tar.gz) - name: Test Python Examples run: | @@ -103,7 +100,7 @@ jobs: - name: Build sdist shell: bash - run: pipx run build --sdist highspy-extras/ + run: pipx run build --sdist --outdir ./dist highspy-extras/ - name: Build sdist shell: bash @@ -140,7 +137,7 @@ jobs: - name: Build sdist shell: bash - run: pipx run build --sdist highspy-extras/ + run: pipx run build --sdist --outdir ./dist highspy-extras/ - name: Build sdist shell: bash @@ -149,20 +146,28 @@ jobs: - name: check metadata run: pipx run twine check dist/* - - name: install highspy + - name: install highspy and highspy_extras run: | - python3 -m venv path/to/venv - source path/to/venv/bin/activate + python3 -m venv .venv + source .venv/bin/activate python3 -m pip install dist/*.tar.gz + - name: Debug extras loading + run: | + source .venv/bin/activate + python -c "import highspy._core; print(highspy._core.getExtrasLoadStatus())" + python -c "import highspy_extras; print(highspy_extras.__file__); print(highspy_extras._PACKAGE_DIR)" + python -c "import highspy_extras; highspy_extras._load_library()" + - name: Test highspy run: | + source .venv/bin/activate python3 -m pip install pytest python3 -m pytest check/test_highspy_hipo.py - name: Test Python Examples run: | - source path/to/venv/bin/activate + source .venv/bin/activate python3 ./examples/call_highs_from_python_highspy.py python3 ./examples/call_highs_from_python_mps.py python3 ./examples/call_highs_from_python.py @@ -174,22 +179,27 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Build sdist - shell: bash - run: pipx run build --sdist highspy-extras/ + - name: Build highspy_extras sdist + run: pipx run build --sdist highspy-extras --outdir dist - - name: Build sdist - shell: bash + - name: Build highspy sdist run: pipx run build --sdist - name: check metadata run: pipx run twine check dist/* - - name: install highspy - run: | - $item = Get-ChildItem dist - python -m pip install "$item" + - name: Pre-install vcpkg dependencies + run: vcpkg install openblas[threads]:x64-windows-static --host-triplet=x64-windows-static + + - name: install highspy and highspy_extras + run: python -m pip install (Get-ChildItem dist\*.tar.gz) + - name: Debug extras loading + run: | + python -c "import highspy._core; print(highspy._core.getExtrasLoadStatus())" + python -c "import highspy_extras; print(highspy_extras.__file__); print(highspy_extras._PACKAGE_DIR)" + python -c "import highspy_extras; highspy_extras._load_library()" + - name: Test highspy run: | python -m pip install pytest diff --git a/.github/workflows/build-unit-tests-external.yml b/.github/workflows/build-unit-tests-external.yml index 75b67d07ae..a1c7f669c8 100644 --- a/.github/workflows/build-unit-tests-external.yml +++ b/.github/workflows/build-unit-tests-external.yml @@ -18,31 +18,31 @@ jobs: - name: Clone extra unit tests repo shell: bash - working-directory: ${{runner.workspace}} + working-directory: ${{github.workspace}} run: | git clone https://github.com/galabovaa/highs-unit-tests.git - name: Create symlink shell: bash - working-directory: ${{runner.workspace}} - run: ln -s ${{runner.workspace}}/highs-unit-tests $GITHUB_WORKSPACE/check + working-directory: ${{github.workspace}} + run: ln -s ${{github.workspace}}/highs-unit-tests $GITHUB_WORKSPACE/check - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DBUILD_EXTRA_UNIT_TESTS=ON -DBUILD_EXTRA_UNIT_ONLY=ON -DBUILD_CXX=OFF - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cmake --build . --parallel - name: Test Extra Only - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ctest --parallel --timeout 300 --output-on-failure @@ -57,31 +57,31 @@ jobs: - name: Clone extra unit tests repo shell: bash - working-directory: ${{runner.workspace}} + working-directory: ${{github.workspace}} run: | git clone https://github.com/galabovaa/highs-unit-tests.git - name: Create symlink shell: bash - working-directory: ${{runner.workspace}} - run: ln -s ${{runner.workspace}}/highs-unit-tests $GITHUB_WORKSPACE/check + working-directory: ${{github.workspace}} + run: ln -s ${{github.workspace}}/highs-unit-tests $GITHUB_WORKSPACE/check - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DALL_TESTS=ON -DBUILD_EXTRA_UNIT_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cmake --build . --parallel - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ctest --parallel --timeout 300 --output-on-failure @@ -92,40 +92,40 @@ jobs: # - uses: actions/checkout@v4 # - name: Create Build Environment - # run: cmake -E make_directory ${{runner.workspace}}/build + # run: cmake -E make_directory ${{github.workspace}}/build # - name: Clone extra unit tests repo - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: git clone https://github.com/galabovaa/highs-unit-tests.git # - name: Create symlink # shell: bash # working-directory: $GITHUB_WORKSPACE/check - # run: mklink /d highs-unit-tests ${{runner.workspace}}/highs-unit-tests + # run: mklink /d highs-unit-tests ${{github.workspace}}/highs-unit-tests # - name: Configure CMake # # Use a bash shell so we can use the same syntax for environment variable # # access regardless of the host operating system # shell: bash - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # # Note the current convention is to use the -S and -B options here to specify source # # and build directories, but this is only available with CMake 3.13 and higher. # # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 # run: cmake $GITHUB_WORKSPACE -DALL_TESTS=ON -DBUILD_EXTRA_UNIT_TESTS=ON # - name: Build - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # shell: bash # # Execute the build. You can specify a specific target with "--target " # run: cmake --build . --config Release --parallel # - name: Unit Test Extra - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # shell: bash # run: ./Release/bin/unit_tests.exe highs-names-extra # - name: Test - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # shell: bash # # Execute tests defined by the CMake configuration. # # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail diff --git a/.github/workflows/build-wheels-push.yml b/.github/workflows/build-wheels-push.yml index 90bcd75c79..7516089c45 100644 --- a/.github/workflows/build-wheels-push.yml +++ b/.github/workflows/build-wheels-push.yml @@ -59,7 +59,7 @@ jobs: path: wheelhouse/*.whl build_wheels_extras: - name: Build highspy-extras wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }} + name: Build highspy-extras wheels for ${{ matrix.buildplat[1] }} runs-on: ${{ matrix.buildplat[0] }} strategy: fail-fast: false @@ -75,23 +75,32 @@ jobs: - [macos-14, macosx_arm64] - [windows-2022, win_amd64] - [windows-2022, win32] - python: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314"] steps: - uses: actions/checkout@v4 + + # Pin the in-container vcpkg to the same version as the host runner so + # that i686/musllinux builds (which can't reuse the host vcpkg) stay + # reproducible and share the same port versions. + - name: Get vcpkg commit + id: vcpkg-commit + shell: bash + run: echo "commit=$(git -C "$VCPKG_INSTALLATION_ROOT" rev-parse HEAD)" >> "$GITHUB_OUTPUT" + - name: Build wheels uses: pypa/cibuildwheel@v3.3.1 with: package-dir: ./highspy-extras env: - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} + CIBW_BUILD: "cp3*-${{ matrix.buildplat[1] }}" + VCPKG_COMMIT: "${{ steps.vcpkg-commit.outputs.commit }}" - uses: actions/setup-python@v5 with: python-version: '3.x' - name: Verify wheels + shell: python run: | - python - <<'PY' import zipfile, glob, sys bad = [] @@ -106,11 +115,10 @@ jobs: sys.exit(1) print("All wheels OK:", glob.glob('wheelhouse/*.whl')) - PY - uses: actions/upload-artifact@v4 with: - name: cibw-extras-wheels-${{ matrix.python }}-${{ matrix.buildplat[1] }} + name: cibw-extras-wheels-${{ matrix.buildplat[1] }} path: wheelhouse/*.whl build_sdist_extras: diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 2a8d023529..c1fd466d0b 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -16,26 +16,26 @@ jobs: - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DFAST_BUILD=ON -DCMAKE_BUILD_TYPE=Release - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config Release --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -43,7 +43,7 @@ jobs: - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DALL_TESTS=ON fast_build_release_all_tests: @@ -55,29 +55,29 @@ jobs: - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest --parallel --timeout 300 --output-on-failure -C Release - name: Install - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --install . @@ -91,26 +91,26 @@ jobs: - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DFAST_BUILD=OFF -DHIGHS_NO_DEFAULT_THREADS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config Release --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -125,26 +125,26 @@ jobs: - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DFAST_BUILD=ON -DHIGHS_NO_DEFAULT_THREADS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config Debug --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -159,26 +159,26 @@ jobs: - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DALL_TESTS=ON -DHIGHS_NO_DEFAULT_THREADS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config Debug --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -193,22 +193,22 @@ jobs: # - name: Create Build Environment # # Some projects don't allow in-source building, so create a separate build directory # # We'll use this as our working directory for all subsequent commands - # run: cmake -E make_directory ${{runner.workspace}}/build + # run: cmake -E make_directory ${{github.workspace}}/build # - name: Configure CMake All # shell: bash - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DFAST_BUILD=OFF # - name: Build All - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # shell: bash # # Execute the build. You can specify a specific target with "--target " # run: | # cmake --build . --parallel --config Debug # - name: Test All - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # shell: bash # # Execute tests defined by the CMake configuration. # # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -223,26 +223,26 @@ jobs: - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DHIGHSINT64=on -DHIGHS_NO_DEFAULT_THREADS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config Release --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -257,26 +257,26 @@ jobs: - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DHIGHSINT64=on -DHIGHS_NO_DEFAULT_THREADS=ON -DALL_TESTS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config Release --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -292,26 +292,26 @@ jobs: - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DFAST_BUILD=OFF -DHIGHSINT64=on -DHIGHS_NO_DEFAULT_THREADS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config Release --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -326,26 +326,26 @@ jobs: - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DHIGHSINT64=on -DHIGHS_NO_DEFAULT_THREADS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config Debug --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -360,26 +360,26 @@ jobs: - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DALL_TESTS=ON -DHIGHSINT64=on -DHIGHS_NO_DEFAULT_THREADS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config Debug --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -396,26 +396,26 @@ jobs: # - name: Create Build Environment # # Some projects don't allow in-source building, so create a separate build directory # # We'll use this as our working directory for all subsequent commands - # run: cmake -E make_directory ${{runner.workspace}}/build + # run: cmake -E make_directory ${{github.workspace}}/build # - name: Configure CMake # # Use a bash shell so we can use the same syntax for environment variable # # access regardless of the host operating system # shell: bash - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # # Note the current convention is to use the -S and -B options here to specify source # # and build directories, but this is only available with CMake 3.13 and higher. # # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 # run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DFAST_BUILD=OFF -DHIGHSINT64=on -DHIGHS_NO_DEFAULT_THREADS=ON # - name: Build - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # shell: bash # # Execute the build. You can specify a specific target with "--target " # run: cmake --build . --config Debug --parallel # - name: Test - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # shell: bash # # Execute tests defined by the CMake configuration. # # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail diff --git a/.github/workflows/cmake-linux-cpp.yml b/.github/workflows/cmake-linux-cpp.yml index 8b14303b6a..5d3b14ae33 100644 --- a/.github/workflows/cmake-linux-cpp.yml +++ b/.github/workflows/cmake-linux-cpp.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest --parallel --timeout 300 --output-on-failure release_all_tests: @@ -41,18 +41,18 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --parallel - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest --parallel --timeout 300 --output-on-failure debug: @@ -65,19 +65,19 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: cmake --build . --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest --parallel --timeout 300 --output-on-failure debug_all_tests: @@ -90,16 +90,16 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --parallel - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest --parallel --timeout 300 --output-on-failure diff --git a/.github/workflows/cmake-macos-cpp.yml b/.github/workflows/cmake-macos-cpp.yml index 0baf60cf81..5291a0b903 100644 --- a/.github/workflows/cmake-macos-cpp.yml +++ b/.github/workflows/cmake-macos-cpp.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest --parallel --timeout 300 --output-on-failure release_all_tests: @@ -41,18 +41,18 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --parallel - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest --parallel --timeout 300 --output-on-failure debug: @@ -65,19 +65,19 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: cmake --build . --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest --parallel --timeout 300 --output-on-failure debug_all_tests: @@ -90,16 +90,16 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --parallel - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest --parallel --timeout 300 --output-on-failure diff --git a/.github/workflows/cmake-windows-cpp.yml b/.github/workflows/cmake-windows-cpp.yml index 1caa1d5f2f..71caccaf85 100644 --- a/.github/workflows/cmake-windows-cpp.yml +++ b/.github/workflows/cmake-windows-cpp.yml @@ -14,20 +14,20 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: cmake --build . --config Release --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ctest --timeout 300 --output-on-failure -C Release @@ -38,20 +38,20 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: cmake --build . --parallel --config Release - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ctest --parallel --timeout 300 --output-on-failure -C Release @@ -62,20 +62,20 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: cmake --build . --config Debug --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ctest --output-on-failure -C Debug @@ -86,19 +86,19 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DALL_TESTS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: cmake --build . --config Debug --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ctest --output-on-failure -C Debug diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index 37bc2a1e91..e349c5bfee 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -16,11 +16,11 @@ jobs: run: sudo apt-get update && sudo apt-get install lcov - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug \ -DHIGHS_COVERAGE=ON \ @@ -30,19 +30,19 @@ jobs: -D CMAKE_CXX_COMPILER=g++ - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cmake --build . -j2 - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ctest --parallel --timeout 300 --output-on-failure # Coverage with HiPO will be different - name: Generate Report - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | lcov -d . -c -o cov.info --ignore-errors empty @@ -57,7 +57,7 @@ jobs: mv cov.info coverage.info - name: Genhtml Results Summary - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | genhtml -o coverage coverage.info @@ -70,6 +70,6 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} slug: ERGO-Code/HiGHS fail_ci_if_error: true # optional (default = false) - files: ${{runner.workspace}}/build/coverage.info # optional + files: ${{github.workspace}}/build/coverage.info # optional # name: codecov-umbrella # optional verbose: true # optional (default = false) \ No newline at end of file diff --git a/.github/workflows/hipo-fetch.yml b/.github/workflows/hipo-fetch.yml index 606c913502..f5e5ef96f5 100644 --- a/.github/workflows/hipo-fetch.yml +++ b/.github/workflows/hipo-fetch.yml @@ -6,6 +6,10 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +env: + # do not use vcpkg for this workflow + VCPKG_INSTALLATION_ROOT: "" + jobs: ubuntu: runs-on: ${{ matrix.os }} @@ -21,25 +25,25 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON -DBUILD_OPENBLAS=ON \ -DALL_TESTS=${{ matrix.all_tests }} - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . -j2 - name: Test executable - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ./bin/highs --solver=hipo $GITHUB_WORKSPACE/check/instances/afiro.mps - name: Ctest - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure @@ -55,7 +59,7 @@ jobs: # - uses: actions/checkout@v4 # - name: Create Build Environment - # run: cmake -E make_directory ${{runner.workspace}}/build + # run: cmake -E make_directory ${{github.workspace}}/build # - name: Install 32-bit deps # run: | @@ -64,7 +68,7 @@ jobs: # sudo apt install -y gcc-multilib g++-multilib libc6-dev-i386 # - name: Configure CMake - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: | # cmake $GITHUB_WORKSPACE -DHIPO=ON -DBUILD_OPENBLAS=ON \ # -DALL_TESTS=${{ matrix.all_tests }} \ @@ -73,22 +77,22 @@ jobs: # -DCMAKE_SHARED_LINKER_FLAGS="-m32" # - name: Build - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: | # cmake --build . -j2 # - name: Check - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: | # cd _deps/openblas-build/lib/ # ar t libopenblas.a | head -1 | xargs ar p libopenblas.a | file - # - name: Test executable - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: ./bin/highs --solver=hipo $GITHUB_WORKSPACE/check/instances/afiro.mps # - name: Ctest - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: | # ctest --parallel --timeout 600 --output-on-failure @@ -103,7 +107,7 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Install 32-bit deps run: | @@ -113,7 +117,7 @@ jobs: sudo apt-get install -y gcc-multilib g++-multilib libc6-dev-i386 - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE \ -DCMAKE_C_COMPILER=gcc \ @@ -124,16 +128,16 @@ jobs: -DALL_TESTS=${{ matrix.all_tests }} - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . -j2 - name: Test executable - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ./bin/highs $GITHUB_WORKSPACE/check/instances/afiro.mps - name: Ctest - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure @@ -148,7 +152,7 @@ jobs: # - uses: actions/checkout@v4 # - name: Create Build Environment - # run: cmake -E make_directory ${{runner.workspace}}/build + # run: cmake -E make_directory ${{github.workspace}}/build # - name: Install 32-bit deps # run: | @@ -160,29 +164,29 @@ jobs: # sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf # - name: Configure CMake - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: | # export CC=arm-linux-gnueabihf-gcc # export CXX=arm-linux-gnueabihf-g++ # cmake $GITHUB_WORKSPACE -DHIPO=ON -DBUILD_OPENBLAS=ON # - name: Build - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: | # cmake --build . --parallel # - name: Check - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: | # cd _deps/openblas-build/lib/ # ar t libopenblas.a | head -1 | xargs ar p libopenblas.a | file - # - name: Test executable - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: ./bin/highs --solver=hipo $GITHUB_WORKSPACE/check/instances/afiro.mps # - name: Ctest - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: | # ctest --parallel --timeout 300 --output-on-failure @@ -197,7 +201,7 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Install 32-bit deps run: | @@ -209,7 +213,7 @@ jobs: sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | export CC=arm-linux-gnueabihf-gcc export CXX=arm-linux-gnueabihf-g++ @@ -217,13 +221,13 @@ jobs: -DALL_TESTS=${{ matrix.all_tests }} - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . --parallel ls - name: Debug armhf execution - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | set -x uname -m @@ -241,12 +245,12 @@ jobs: ./bin/highs $GITHUB_WORKSPACE/check/instances/afiro.mps - name: Test executable - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ./bin/highs $GITHUB_WORKSPACE/check/instances/afiro.mps - name: Ctest - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure @@ -267,7 +271,7 @@ jobs: run: | cmake ` -S "$env:GITHUB_WORKSPACE" ` - -B "${{ runner.workspace }}/build" ` + -B "${{ github.workspace }}/build" ` -A ${{ matrix.arch }} ` -DHIPO=ON ` -DALL_TESTS=${{ matrix.all_tests }} ` @@ -275,20 +279,20 @@ jobs: - name: Build shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . --parallel --config ${{ matrix.config }} - name: Test executable shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | & ".\${{ matrix.config }}\bin\highs.exe" --solver=hipo ` "$env:GITHUB_WORKSPACE/check/instances/afiro.mps" - name: Ctest shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure -C ${{ matrix.config }} @@ -310,7 +314,7 @@ jobs: run: | cmake ` -S "$env:GITHUB_WORKSPACE" ` - -B "${{ runner.workspace }}/build" ` + -B "${{ github.workspace }}/build" ` -A ${{ matrix.arch }} ` -DHIPO=ON ` -DALL_TESTS=${{ matrix.all_tests }} ` @@ -318,20 +322,20 @@ jobs: - name: Build shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . --parallel --config ${{ matrix.config }} - name: Test executable shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | & ".\${{ matrix.config }}\bin\highs.exe" --solver=hipo ` "$env:GITHUB_WORKSPACE/check/instances/afiro.mps" - name: Ctest shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure -C ${{ matrix.config }} @@ -351,20 +355,20 @@ jobs: run: | cmake ` -S "$env:GITHUB_WORKSPACE" ` - -B "${{ runner.workspace }}/build" ` + -B "${{ github.workspace }}/build" ` -DHIPO=ON ` -DBUILD_OPENBLAS=ON ` -DBUILD_SHARED_LIBS=ON - name: Build shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . --parallel --config ${{ matrix.config }} - name: Test executable shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | & ".\${{ matrix.config }}\bin\highs.exe" --solver=hipo ` "$env:GITHUB_WORKSPACE/check/instances/afiro.mps" \ No newline at end of file diff --git a/.github/workflows/hipo.yml b/.github/workflows/hipo.yml index df4bd4dff7..ad6aa14ed1 100644 --- a/.github/workflows/hipo.yml +++ b/.github/workflows/hipo.yml @@ -9,47 +9,56 @@ concurrency: jobs: win-vcpkg: runs-on: windows-latest - strategy: - fail-fast: false - matrix: - config: [Release, Debug] - all_tests: [OFF] steps: - uses: actions/checkout@v4 - - name: Install OpenBLAS - shell: pwsh - run: vcpkg install openblas[threads] - - name: Configure CMake shell: pwsh run: | cmake ` -S "$env:GITHUB_WORKSPACE" ` - -B "${{ runner.workspace }}/build" ` + -B "${{ github.workspace }}/build" ` -DHIPO=ON ` - -DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" ` - -DALL_TESTS=${{ matrix.all_tests }} + -DALL_TESTS=OFF - - name: Build + - name: Build Release shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | - cmake --build . --parallel --config ${{ matrix.config }} + cmake --build . --parallel --config Release - - name: Test executable + - name: Test executable (Release) shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | - & ".\${{ matrix.config }}\bin\highs.exe" --solver=hipo ` + & ".\Release\bin\highs.exe" --solver=hipo ` "$env:GITHUB_WORKSPACE/check/instances/afiro.mps" - - name: Ctest + - name: Ctest (Release) + shell: pwsh + working-directory: ${{github.workspace}}/build + run: | + ctest --parallel --timeout 300 --output-on-failure -C Release + + - name: Build Debug + shell: pwsh + working-directory: ${{github.workspace}}/build + run: | + cmake --build . --parallel --config Debug + + - name: Test executable (Debug) + shell: pwsh + working-directory: ${{github.workspace}}/build + run: | + & ".\Debug\bin\highs.exe" --solver=hipo ` + "$env:GITHUB_WORKSPACE/check/instances/afiro.mps" + + - name: Ctest (Debug) shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | - ctest --parallel --timeout 300 --output-on-failure -C ${{ matrix.config }} + ctest --parallel --timeout 300 --output-on-failure -C Debug macos: runs-on: macos-latest @@ -63,26 +72,26 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON \ -DCMAKE_BUILD_TYPE=${{ matrix.config }} \ -DALL_TESTS=${{ matrix.all_tests }} - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . --parallel - name: Test executable - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ./bin/highs --solver=hipo $GITHUB_WORKSPACE/check/instances/afiro.mps - name: Ctest - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure @@ -114,26 +123,26 @@ jobs: sudo apt install libopenblas-dev - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON \ -DCMAKE_BUILD_TYPE=${{ matrix.config }} \ -DALL_TESTS=${{ matrix.all_tests }} - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . --parallel - name: Test executable - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ./bin/highs --solver=hipo $GITHUB_WORKSPACE/check/instances/afiro.mps - name: Ctest - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure @@ -156,31 +165,33 @@ jobs: sudo apt install libblas-dev - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON \ -DCMAKE_BUILD_TYPE=${{ matrix.config }} \ -DALL_TESTS=${{ matrix.all_tests }} - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . --parallel - name: Test executable - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ./bin/highs --solver=hipo $GITHUB_WORKSPACE/check/instances/afiro.mps - name: Ctest - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure ubuntu_debug: runs-on: ${{ matrix.os }} + env: + VCPKG_INSTALLATION_ROOT: "" strategy: fail-fast: false @@ -193,31 +204,34 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON -DBUILD_OPENBLAS=ON \ -DALL_TESTS=${{ matrix.all_tests }} \ -DCMAKE_BUILD_TYPE=${{ matrix.config }} - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . -j2 - name: Test executable - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ./bin/highs --solver=hipo $GITHUB_WORKSPACE/check/instances/afiro.mps - name: Ctest - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure windows_debug: runs-on: [windows-latest] + env: + VCPKG_INSTALLATION_ROOT: "" + strategy: fail-fast: false matrix: @@ -233,7 +247,7 @@ jobs: run: | cmake ` -S "$env:GITHUB_WORKSPACE" ` - -B "${{ runner.workspace }}/build" ` + -B "${{ github.workspace }}/build" ` -A ${{ matrix.arch }} ` -DHIPO=ON ` -DALL_TESTS=${{ matrix.all_tests }} ` @@ -241,19 +255,19 @@ jobs: - name: Build shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . --parallel --config ${{ matrix.config }} - name: Test executable shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | & ".\${{ matrix.config }}\bin\highs.exe" --solver=hipo ` "$env:GITHUB_WORKSPACE/check/instances/afiro.mps" - name: Ctest shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure -C ${{ matrix.config }} \ No newline at end of file diff --git a/.github/workflows/release-archive-artifact.yml b/.github/workflows/release-archive-artifact.yml index 57bc20df3a..a74d4c8316 100644 --- a/.github/workflows/release-archive-artifact.yml +++ b/.github/workflows/release-archive-artifact.yml @@ -17,17 +17,17 @@ jobs: uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/archive + run: cmake -E make_directory ${{github.workspace}}/archive - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/archive_unzipped + run: cmake -E make_directory ${{github.workspace}}/archive_unzipped - name: working dir run: | pwd - echo ${{runner.workspace}} + echo ${{github.workspace}} echo "" - ls ${{runner.workspace}}/HiGHS + ls ${{github.workspace}}/HiGHS # ls # echo $GITHUB_WORKSPACE @@ -35,7 +35,7 @@ jobs: - name: Generate archive artifact run: | pwd - cd ${{runner.workspace}} + cd ${{github.workspace}} pwd tar -czvf source-archive.tar.gz HiGHS @@ -43,12 +43,12 @@ jobs: - name: unzip archive run: | - cd ${{runner.workspace}} - tar -xvzf source-archive.tar.gz -C ${{runner.workspace}}/archive_unzipped + cd ${{github.workspace}} + tar -xvzf source-archive.tar.gz -C ${{github.workspace}}/archive_unzipped - name: ls unziped archive run: | - cd ${{runner.workspace}}/archive_unzipped + cd ${{github.workspace}}/archive_unzipped pwd ls cd HiGHS @@ -56,7 +56,7 @@ jobs: - name: copy archive run: | - cp ${{runner.workspace}}/source-archive.tar.gz . + cp ${{github.workspace}}/source-archive.tar.gz . ls - name: Release diff --git a/.github/workflows/release-cpack.yml b/.github/workflows/release-cpack.yml index 527aa5e894..8f571aac72 100644 --- a/.github/workflows/release-cpack.yml +++ b/.github/workflows/release-cpack.yml @@ -17,7 +17,7 @@ jobs: matrix: arch: [x64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | cmake -B build -DHIPO=ON -DBUILD_OPENBLAS=ON -DBUILD_STATIC_EXE=ON \ @@ -45,7 +45,7 @@ jobs: matrix: arch: [arm64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | @@ -74,7 +74,7 @@ jobs: matrix: arch: [x64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} ` @@ -104,7 +104,7 @@ jobs: matrix: arch: [Win32] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} ` @@ -125,7 +125,7 @@ jobs: matrix: arch: [ARM64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} ` @@ -151,7 +151,7 @@ jobs: build-macos: runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build Universal Binary run: | cmake -B build -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \ @@ -179,7 +179,7 @@ jobs: matrix: arch: [x64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | cmake -B build -DBUILD_STATIC_EXE=ON @@ -206,7 +206,7 @@ jobs: matrix: arch: [arm64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | @@ -234,7 +234,7 @@ jobs: matrix: arch: [x64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} ` @@ -263,7 +263,7 @@ jobs: matrix: arch: [x64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} ` @@ -293,7 +293,7 @@ jobs: matrix: arch: [Win32] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} ` @@ -314,7 +314,7 @@ jobs: matrix: arch: [ARM64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} ` @@ -340,7 +340,7 @@ jobs: build-macos-mit: runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build Universal Binary run: | cmake -B build -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \ diff --git a/.github/workflows/sanitizers-cmake.yml b/.github/workflows/sanitizers-cmake.yml index 194dd05fc3..92a0370d8c 100644 --- a/.github/workflows/sanitizers-cmake.yml +++ b/.github/workflows/sanitizers-cmake.yml @@ -18,17 +18,17 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake and Build shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEBUG_MEMORY=${{ matrix.sanitizer }} -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ cmake --build . --parallel - name: Run - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ./bin/highs $GITHUB_WORKSPACE/check/instances/afiro.mps @@ -44,17 +44,17 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake and Build shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DDEBUG_MEMORY=${{ matrix.sanitizer }} -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ cmake --build . --parallel - name: Run - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ./bin/highs $GITHUB_WORKSPACE/check/instances/afiro.mps @@ -70,17 +70,17 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake and Build shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEBUG_MEMORY=${{ matrix.sanitizer }} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ cmake --build . --parallel - name: Run - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ./bin/highs $GITHUB_WORKSPACE/check/instances/afiro.mps @@ -96,17 +96,17 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake and Build shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DDEBUG_MEMORY=${{ matrix.sanitizer }} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ cmake --build . --parallel - name: Run - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ./bin/highs $GITHUB_WORKSPACE/check/instances/afiro.mps @@ -125,10 +125,10 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON -DBUILD_OPENBLAS=ON \ -DALL_TESTS=${{ matrix.all_tests }} \ @@ -139,15 +139,15 @@ jobs: - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . -j2 - name: Test executable - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ./bin/highs --solver=hipo $GITHUB_WORKSPACE/check/instances/afiro.mps - name: Test hipo - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ./bin/unit_tests [highs_hipo] diff --git a/.github/workflows/test-csharp-win.yml b/.github/workflows/test-csharp-win.yml index c37915519c..0e29805d48 100644 --- a/.github/workflows/test-csharp-win.yml +++ b/.github/workflows/test-csharp-win.yml @@ -14,21 +14,21 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCSHARP=ON - name: Build shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --config Release --parallel - name: Test shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ls ./Release/bin/csharpexample.exe @@ -40,21 +40,21 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCSHARP=ON - name: Build shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --config Debug --parallel - name: Test shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ls ./Debug/bin/csharpexample.exe diff --git a/.github/workflows/test-exe.yml b/.github/workflows/test-exe.yml index 1563206114..2835166fd4 100644 --- a/.github/workflows/test-exe.yml +++ b/.github/workflows/test-exe.yml @@ -17,22 +17,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -45,22 +45,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -74,22 +74,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Debug - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail diff --git a/.github/workflows/test-fortran-macos.yml b/.github/workflows/test-fortran-macos.yml index 8500939a39..4f5b94cf24 100644 --- a/.github/workflows/test-fortran-macos.yml +++ b/.github/workflows/test-fortran-macos.yml @@ -24,11 +24,11 @@ jobs: # run: brew install gfortran gcc - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --version gfortran-14 --version @@ -36,12 +36,12 @@ jobs: - name: Build shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --parallel - name: Test shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ls ./bin/fortrantest diff --git a/.github/workflows/test-fortran-ubuntu.yml b/.github/workflows/test-fortran-ubuntu.yml index 1416279f44..17e7d97663 100644 --- a/.github/workflows/test-fortran-ubuntu.yml +++ b/.github/workflows/test-fortran-ubuntu.yml @@ -30,21 +30,21 @@ jobs: version: ${{ matrix.toolchain.version }} - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DFORTRAN=ON - name: Build shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --parallel - name: Test shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ls ./bin/fortrantest diff --git a/.github/workflows/test-nuget-macos.yml b/.github/workflows/test-nuget-macos.yml index 0a07d91892..cb4081a99c 100644 --- a/.github/workflows/test-nuget-macos.yml +++ b/.github/workflows/test-nuget-macos.yml @@ -16,19 +16,19 @@ jobs: - uses: actions/checkout@v4 - name: Build HiGHS run: | - cmake -E make_directory ${{runner.workspace}}/build - cmake -E make_directory ${{runner.workspace}}/nugets - cmake -E make_directory ${{runner.workspace}}/test_nuget + cmake -E make_directory ${{github.workspace}}/build + cmake -E make_directory ${{github.workspace}}/nugets + cmake -E make_directory ${{github.workspace}}/test_nuget - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON \ -DCMAKE_C_COMPILER=/usr/bin/clang \ -DCMAKE_CXX_COMPILER=/usr/bin/clang++ - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --config Release --parallel - uses: actions/setup-dotnet@v4 @@ -36,24 +36,24 @@ jobs: dotnet-version: '6.0.x' - name: Dotnet pack - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native run: dotnet pack -c Release /p:Version=1.13.1 - name: Add local feed - run: dotnet nuget add source ${{runner.workspace}}/nugets + run: dotnet nuget add source ${{github.workspace}}/nugets - name: Dotnet push to local feed - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native - run: dotnet nuget push ./bin/Release/*.nupkg -s ${{runner.workspace}}/nugets + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native + run: dotnet nuget push ./bin/Release/*.nupkg -s ${{github.workspace}}/nugets - name: Create new project and test shell: bash - working-directory: ${{runner.workspace}}/test_nuget + working-directory: ${{github.workspace}}/test_nuget run: | dotnet new console rm Program.cs cp $GITHUB_WORKSPACE/examples/call_highs_from_csharp.cs . - dotnet add package Highs.Native -s ${{runner.workspace}}/nugets + dotnet add package Highs.Native -s ${{github.workspace}}/nugets dotnet run @@ -63,12 +63,12 @@ jobs: - uses: actions/checkout@v4 - name: Build HiGHS run: | - cmake -E make_directory ${{runner.workspace}}/build - cmake -E make_directory ${{runner.workspace}}/nugets - cmake -E make_directory ${{runner.workspace}}/test_nuget + cmake -E make_directory ${{github.workspace}}/build + cmake -E make_directory ${{github.workspace}}/nugets + cmake -E make_directory ${{github.workspace}}/test_nuget - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON \ -DCMAKE_C_COMPILER=/usr/bin/clang \ @@ -76,7 +76,7 @@ jobs: - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --config Release --parallel - uses: actions/setup-dotnet@v4 @@ -84,22 +84,22 @@ jobs: dotnet-version: '6.0.x' - name: Dotnet pack - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native run: dotnet pack -c Release /p:Version=1.13.1 - name: Add local feed - run: dotnet nuget add source ${{runner.workspace}}/nugets + run: dotnet nuget add source ${{github.workspace}}/nugets - name: Dotnet push to local feed - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native - run: dotnet nuget push ./bin/Release/*.nupkg -s ${{runner.workspace}}/nugets + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native + run: dotnet nuget push ./bin/Release/*.nupkg -s ${{github.workspace}}/nugets - name: Create new project and test shell: bash - working-directory: ${{runner.workspace}}/test_nuget + working-directory: ${{github.workspace}}/test_nuget run: | dotnet new console rm Program.cs cp $GITHUB_WORKSPACE/examples/call_highs_from_csharp.cs . - dotnet add package Highs.Native -s ${{runner.workspace}}/nugets + dotnet add package Highs.Native -s ${{github.workspace}}/nugets dotnet run diff --git a/.github/workflows/test-nuget-package.yml b/.github/workflows/test-nuget-package.yml index 4d32833a00..5aaeebff84 100644 --- a/.github/workflows/test-nuget-package.yml +++ b/.github/workflows/test-nuget-package.yml @@ -16,19 +16,19 @@ jobs: - uses: actions/checkout@v4 - name: Build HiGHS run: | - cmake -E make_directory ${{runner.workspace}}/build - cmake -E make_directory ${{runner.workspace}}/nugets - cmake -E make_directory ${{runner.workspace}}/test_nuget + cmake -E make_directory ${{github.workspace}}/build + cmake -E make_directory ${{github.workspace}}/nugets + cmake -E make_directory ${{github.workspace}}/test_nuget - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON \ -DCMAKE_C_COMPILER=/usr/bin/clang \ -DCMAKE_CXX_COMPILER=/usr/bin/clang++ - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --config Release --parallel - uses: actions/setup-dotnet@v4 @@ -36,24 +36,24 @@ jobs: dotnet-version: '6.0.x' - name: Dotnet pack - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native run: dotnet pack -c Release /p:Version=1.13.1 - name: Add local feed - run: dotnet nuget add source ${{runner.workspace}}/nugets + run: dotnet nuget add source ${{github.workspace}}/nugets - name: Dotnet push to local feed - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native - run: dotnet nuget push ./bin/Release/*.nupkg -s ${{runner.workspace}}/nugets + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native + run: dotnet nuget push ./bin/Release/*.nupkg -s ${{github.workspace}}/nugets - name: Create new project and test shell: bash - working-directory: ${{runner.workspace}}/test_nuget + working-directory: ${{github.workspace}}/test_nuget run: | dotnet new console rm Program.cs cp $GITHUB_WORKSPACE/examples/call_highs_from_csharp.cs . - dotnet add package Highs.Native -s ${{runner.workspace}}/nugets + dotnet add package Highs.Native -s ${{github.workspace}}/nugets dotnet run build_macos_arm: @@ -62,12 +62,12 @@ jobs: - uses: actions/checkout@v4 - name: Build HiGHS run: | - cmake -E make_directory ${{runner.workspace}}/build - cmake -E make_directory ${{runner.workspace}}/nugets - cmake -E make_directory ${{runner.workspace}}/test_nuget + cmake -E make_directory ${{github.workspace}}/build + cmake -E make_directory ${{github.workspace}}/nugets + cmake -E make_directory ${{github.workspace}}/test_nuget - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON \ -DCMAKE_C_COMPILER=/usr/bin/clang \ @@ -75,7 +75,7 @@ jobs: - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --config Release --parallel - uses: actions/setup-dotnet@v4 @@ -83,24 +83,24 @@ jobs: dotnet-version: '6.0.x' - name: Dotnet pack - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native run: dotnet pack -c Release /p:Version=1.13.1 - name: Add local feed - run: dotnet nuget add source ${{runner.workspace}}/nugets + run: dotnet nuget add source ${{github.workspace}}/nugets - name: Dotnet push to local feed - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native - run: dotnet nuget push ./bin/Release/*.nupkg -s ${{runner.workspace}}/nugets + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native + run: dotnet nuget push ./bin/Release/*.nupkg -s ${{github.workspace}}/nugets - name: Create new project and test shell: bash - working-directory: ${{runner.workspace}}/test_nuget + working-directory: ${{github.workspace}}/test_nuget run: | dotnet new console rm Program.cs cp $GITHUB_WORKSPACE/examples/call_highs_from_csharp.cs . - dotnet add package Highs.Native -s ${{runner.workspace}}/nugets + dotnet add package Highs.Native -s ${{github.workspace}}/nugets dotnet run build_linux: @@ -197,18 +197,18 @@ jobs: - uses: actions/checkout@v4 - name: Build HiGHS Windows native run: | - cmake -E make_directory ${{runner.workspace}}/build - cmake -E make_directory ${{runner.workspace}}/nugets - cmake -E make_directory ${{runner.workspace}}/test_nuget + cmake -E make_directory ${{github.workspace}}/build + cmake -E make_directory ${{github.workspace}}/nugets + cmake -E make_directory ${{github.workspace}}/test_nuget - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON - name: Build shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --config Release --parallel - uses: actions/setup-dotnet@v4 @@ -216,22 +216,22 @@ jobs: dotnet-version: '6.0.x' - name: Dotnet pack - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native run: dotnet pack -c Release /p:Version=1.13.1 - name: Add local feed - run: dotnet nuget add source -n name ${{runner.workspace}}\nugets + run: dotnet nuget add source -n name ${{github.workspace}}\nugets - name: Dotnet push to local feed - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native shell: bash run: dotnet nuget push ./bin/Release/*.nupkg -s name - name: Create new project and test - working-directory: ${{runner.workspace}}/test_nuget + working-directory: ${{github.workspace}}/test_nuget run: | dotnet new console rm Program.cs - cp ${{runner.workspace}}\HiGHS\examples\call_highs_from_csharp.cs . - dotnet add package Highs.Native -v 1.13.1 -s ${{runner.workspace}}\nugets + cp ${{github.workspace}}\examples\call_highs_from_csharp.cs . + dotnet add package Highs.Native -v 1.13.1 -s ${{github.workspace}}\nugets dotnet run diff --git a/.github/workflows/test-nuget-win.yml b/.github/workflows/test-nuget-win.yml index 7fc4374576..018d3195c3 100644 --- a/.github/workflows/test-nuget-win.yml +++ b/.github/workflows/test-nuget-win.yml @@ -13,18 +13,18 @@ jobs: - uses: actions/checkout@v4 - name: Build HiGHS Windows native run: | - cmake -E make_directory ${{runner.workspace}}/build - cmake -E make_directory ${{runner.workspace}}/nugets - cmake -E make_directory ${{runner.workspace}}/test_nuget + cmake -E make_directory ${{github.workspace}}/build + cmake -E make_directory ${{github.workspace}}/nugets + cmake -E make_directory ${{github.workspace}}/test_nuget - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON - name: Build shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --config Release --parallel - uses: actions/setup-dotnet@v4 @@ -32,22 +32,22 @@ jobs: dotnet-version: '6.0.x' - name: Dotnet pack - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native run: dotnet pack -c Release /p:Version=1.13.1 - name: Add local feed - run: dotnet nuget add source -n name ${{runner.workspace}}\nugets + run: dotnet nuget add source -n name ${{github.workspace}}\nugets - name: Dotnet push to local feed - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native shell: bash run: dotnet nuget push ./bin/Release/*.nupkg -s name - name: Create new project and test - working-directory: ${{runner.workspace}}/test_nuget + working-directory: ${{github.workspace}}/test_nuget run: | dotnet new console rm Program.cs - cp ${{runner.workspace}}\HiGHS\examples\call_highs_from_csharp.cs . - dotnet add package Highs.Native -v 1.13.1 -s ${{runner.workspace}}\nugets + cp ${{github.workspace}}\examples\call_highs_from_csharp.cs . + dotnet add package Highs.Native -v 1.13.1 -s ${{github.workspace}}\nugets dotnet run diff --git a/.github/workflows/test-python-macos.yml b/.github/workflows/test-python-macos.yml index 6f9d9edc0f..8895004092 100644 --- a/.github/workflows/test-python-macos.yml +++ b/.github/workflows/test-python-macos.yml @@ -54,7 +54,7 @@ jobs: - name: Test Python Interface run: | - python3 -m pip install ./highspy-extras + python3 -m pip install -v ./highspy-extras python3 -m pip install . pytest -v ./highspy pytest check/test_highspy_hipo.py diff --git a/.github/workflows/test-python-ubuntu.yml b/.github/workflows/test-python-ubuntu.yml index f06ef7c925..8be84cc089 100644 --- a/.github/workflows/test-python-ubuntu.yml +++ b/.github/workflows/test-python-ubuntu.yml @@ -44,6 +44,7 @@ jobs: python: [3.12] steps: - uses: actions/checkout@v4 + - name: Install correct python version uses: actions/setup-python@v5 with: @@ -122,7 +123,7 @@ jobs: run: python3 -m pip install pytest - name: Create install dir for openblas - run: mkdir ${{runner.workspace}}/install-openblas + run: mkdir ${{github.workspace}}/install-openblas - name: Checkout OpenBLAS uses: actions/checkout@v4 @@ -132,13 +133,13 @@ jobs: path: pathtoopenblas - name: Configure openblas - working-directory: ${{runner.workspace}}/HiGHS/pathtoopenblas + working-directory: ${{github.workspace}}/pathtoopenblas run: | - make -j2 PREFIX=${{runner.workspace}}/install-openblas - make install PREFIX=${{runner.workspace}}/install-openblas - ls ${{runner.workspace}}/install-openblas + make -j2 PREFIX=${{github.workspace}}/install-openblas + make install PREFIX=${{github.workspace}}/install-openblas + ls ${{github.workspace}}/install-openblas echo "" - ls ${{runner.workspace}}/install-openblas/lib + ls ${{github.workspace}}/install-openblas/lib echo "" # Can pass path with an additional @@ -148,7 +149,7 @@ jobs: run: | python3 -m pip install ./highspy-extras \ --config-settings=cmake.define.BUILD_OPENBLAS=OFF \ - --config-settings=cmake.define.BLAS_LIBRARIES=${{runner.workspace}}/install-openblas/lib/libopenblas.a + --config-settings=cmake.define.BLAS_LIBRARIES=${{github.workspace}}/install-openblas/lib/libopenblas.a python3 -m pip install . pytest -v ./highspy pytest check/test_highspy_hipo.py diff --git a/.github/workflows/test-python-win.yml b/.github/workflows/test-python-win.yml index a1b0d991f0..db6814b480 100644 --- a/.github/workflows/test-python-win.yml +++ b/.github/workflows/test-python-win.yml @@ -87,19 +87,16 @@ jobs: - name: Install highspy-extras run: | - python -m pip install ./highspy-extras ` - --config-settings=cmake.define.BUILD_OPENBLAS=OFF ` - --config-settings=cmake.define.CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" + python -m pip install ./highspy-extras - name: Install highspy run: | - python -m pip install . ` - --config-settings=cmake.define.CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" + python -m pip install . python -c "import highspy; print(dir(highspy))" - name: Test python install run: | - pytest + pytest highspy/tests check/test_highspy_hipo.py - name: Test Python Examples run: | diff --git a/.github/workflows/valgrind-hipo.yml b/.github/workflows/valgrind-hipo.yml index bcc2746298..c26966eb53 100644 --- a/.github/workflows/valgrind-hipo.yml +++ b/.github/workflows/valgrind-hipo.yml @@ -17,11 +17,11 @@ jobs: run: sudo apt-get update && sudo apt-get install valgrind - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON \ -DBUILD_OPENBLAS=ON \ @@ -31,13 +31,13 @@ jobs: -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cmake --build . -j2 - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | valgrind \ @@ -49,7 +49,7 @@ jobs: 2>&1 | tee logfile - name: Check log for Errors - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cat logfile @@ -72,11 +72,11 @@ jobs: run: sudo apt-get update && sudo apt-get install valgrind - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON \ -DBUILD_OPENBLAS=ON \ @@ -86,13 +86,13 @@ jobs: -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cmake --build . -j2 - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | valgrind \ @@ -106,7 +106,7 @@ jobs: 2>&1 | tee logfile2 - name: Check log for Errors - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cat logfile2 @@ -129,24 +129,24 @@ jobs: run: sudo apt-get update && sudo apt-get install valgrind - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON \ -DBUILD_OPENBLAS=ON \ -DCMAKE_BUILD_TYPE=Debug - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cmake --build . -j2 - name: Test cpp example - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | valgrind \ @@ -160,7 +160,7 @@ jobs: 2>&1 | tee logfile2 - name: Check log for Errors - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cat logfile2 @@ -171,7 +171,7 @@ jobs: exit 1 - name: Test C example - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | valgrind \ @@ -185,7 +185,7 @@ jobs: 2>&1 | tee logfile2 - name: Check log for Errors - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cat logfile2 diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index dd5d9356ec..1f31b10b45 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -20,21 +20,21 @@ jobs: run: sudo apt-get update && sudo apt-get install valgrind - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DALL_TESTS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cmake --build . --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | valgrind \ @@ -46,7 +46,7 @@ jobs: 2>&1 | tee logfile - name: Check log for Errors - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cat logfile @@ -69,21 +69,21 @@ jobs: run: sudo apt-get update && sudo apt-get install valgrind - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cmake --build . --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | valgrind \ @@ -97,7 +97,7 @@ jobs: 2>&1 | tee logfile2 - name: Check log for Errors - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cat logfile2 @@ -120,21 +120,21 @@ jobs: run: sudo apt-get update && sudo apt-get install valgrind - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cmake --build . --parallel - name: Test cpp example - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | valgrind \ @@ -148,7 +148,7 @@ jobs: 2>&1 | tee logfile2 - name: Check log for Errors - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cat logfile2 @@ -159,7 +159,7 @@ jobs: exit 1 - name: Test C example - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | valgrind \ @@ -173,7 +173,7 @@ jobs: 2>&1 | tee logfile2 - name: Check log for Errors - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cat logfile2 diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b7c1302f3..616371d8c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ set(CMAKE_CXX_COMPILER_NAMES clang++ g++ icpx c++ ${CMAKE_CXX_COMPILER_NAMES}) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +include(vcpkg) # vcpkg must be configured BEFORE project() include(set-version) set_version(VERSION ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 32542ed0b5..a06a2583d5 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -20,11 +20,11 @@ if(FAST_BUILD) set_target_properties(highs-bin PROPERTIES POSITION_INDEPENDENT_CODE ON) - if (${BUILD_SHARED_EXTRAS_LIB}) + if (BUILD_SHARED_EXTRAS_LIB) target_compile_definitions(highs-bin PRIVATE HIGHS_SHARED_EXTRAS_LIBRARY) - else() - target_link_libraries(highs-bin PRIVATE highs_extras) - endif() + else() + target_link_libraries(highs-bin PRIVATE highs_extras) + endif() if(UNIX) target_compile_options(highs-bin PUBLIC "-Wno-unused-variable") @@ -63,6 +63,25 @@ if(FAST_BUILD) ) endif() + # Set the build RPATH for the highs app + if (APPLE OR UNIX) + set(highs_bin_build_rpath) + + if(BUILD_SHARED_LIBS) + list(APPEND highs_bin_build_rpath "$") + endif() + + if(HIPO AND BUILD_SHARED_EXTRAS_LIB) + list(APPEND highs_bin_build_rpath "$") + endif() + + if(highs_bin_build_rpath) + list(REMOVE_DUPLICATES highs_bin_build_rpath) + set_target_properties(highs-bin PROPERTIES + BUILD_RPATH "${highs_bin_build_rpath}") + endif() + endif() + if(WIN32 AND HIPO AND BUILD_OPENBLAS AND BUILD_SHARED_LIBS) add_custom_command(TARGET highs-bin POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different diff --git a/app/HighsRuntimeOptions.h b/app/HighsRuntimeOptions.h index 42704455f8..d00b75fe3f 100644 --- a/app/HighsRuntimeOptions.h +++ b/app/HighsRuntimeOptions.h @@ -151,11 +151,9 @@ bool loadOptions(const CLI::App& app, const HighsLogOptions& report_log_options, std::cout << " Githash " << HIGHS_GITHASH << ". "; std::cout << kHighsCopyrightStatement << std::endl; -#ifdef HIPO if (HighsExternalDeps::isAvailable()) { std::cout << HighsExternalDeps::getCopyrightInfo() << std::endl; } -#endif exit(0); } diff --git a/check/CMakeLists.txt b/check/CMakeLists.txt index 36ace0bbab..a7f80e84fe 100644 --- a/check/CMakeLists.txt +++ b/check/CMakeLists.txt @@ -39,6 +39,7 @@ if ((NOT FAST_BUILD OR ALL_TESTS) AND NOT (BUILD_EXTRA_UNIT_ONLY)) TestFactor.cpp TestFilereader.cpp TestHighsCDouble.cpp + TestHighsExternalDeps.cpp TestHighsGFkSolve.cpp TestHighsHash.cpp TestHighsHessian.cpp @@ -107,6 +108,12 @@ if ((NOT FAST_BUILD OR ALL_TESTS) AND NOT (BUILD_EXTRA_UNIT_ONLY)) set_target_properties(unit_tests PROPERTIES UNITY_BUILD OFF) + if (BUILD_SHARED_EXTRAS_LIB) + target_compile_definitions(unit_tests PRIVATE HIGHS_SHARED_EXTRAS_LIBRARY) + else() + target_link_libraries(unit_tests PRIVATE highs_extras) + endif() + if (UNIX) target_compile_options(unit_tests PRIVATE "-Wno-unused-variable") target_compile_options(unit_tests PRIVATE "-Wno-unused-const-variable") diff --git a/check/TestHighsExternalDeps.cpp b/check/TestHighsExternalDeps.cpp new file mode 100644 index 0000000000..2846d8dc82 --- /dev/null +++ b/check/TestHighsExternalDeps.cpp @@ -0,0 +1,40 @@ +#include "Highs.h" +#include "HighsExternalDeps.h" +#include "catch.hpp" + +// simple test for now +// extended tests require workflow changes to include/exclude dependencies +TEST_CASE("HighsExternalDeps", "[highs_external_deps]") { + // tryLoad without a path — returns true only if extras are available + bool loaded = HighsExternalDeps::tryLoad(); + + std::string status = HighsExternalDeps::getLoadStatus(); + REQUIRE(!status.empty()); + + if (loaded) { + REQUIRE(HighsExternalDeps::isAvailable()); + } else { + REQUIRE(!HighsExternalDeps::isAvailable()); + } +} + +TEST_CASE("HighsExternalDeps-compile-time", "[highs_external_deps]") { + // isAvailableAtCompile should be consistent with build config + bool compile = HighsExternalDeps::isAvailableAtCompile(); + + // If compile-time available, runtime must also be available + if (compile) { + REQUIRE(HighsExternalDeps::isAvailable()); + } +} + +TEST_CASE("HighsExternalDeps-getCopyrightInfo", "[highs_external_deps]") { + HighsExternalDeps::tryLoad(); + std::string info = HighsExternalDeps::getCopyrightInfo(); + + if (HighsExternalDeps::isAvailable()) { + REQUIRE(!info.empty()); + } else { + REQUIRE(info.empty()); + } +} \ No newline at end of file diff --git a/cmake/FindHipoDeps.cmake b/cmake/FindHipoDeps.cmake index ba3d3bbb61..f954da4812 100644 --- a/cmake/FindHipoDeps.cmake +++ b/cmake/FindHipoDeps.cmake @@ -298,7 +298,7 @@ if (NOT USE_CMAKE_FIND_BLAS) endif() else() - if (WIN32 AND NOT BLAS_LIBRARIES AND NOT BLA_VENDOR) + if (NOT BLAS_LIBRARIES AND NOT BLA_VENDOR) find_package(OpenBLAS CONFIG) if(OpenBLAS_FOUND) message(STATUS "OpenBLAS CMake config path: ${OpenBLAS_DIR}") diff --git a/cmake/vcpkg.cmake b/cmake/vcpkg.cmake new file mode 100644 index 0000000000..5a5432f1cd --- /dev/null +++ b/cmake/vcpkg.cmake @@ -0,0 +1,133 @@ +# cmake/vcpkg.cmake +# +# Shared vcpkg integration for HiGHS-related projects. +# +# Usage: +# cmake_minimum_required(VERSION 3.15) +# list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake") +# include(vcpkg) # MUST be before the first project() call +# project(my_project LANGUAGES C CXX) +# +# Behavior: +# * If $ENV{VCPKG_ROOT} is set and CMAKE_TOOLCHAIN_FILE is not, point +# CMAKE_TOOLCHAIN_FILE at vcpkg's toolchain so manifest mode kicks in. +# * Auto-pick a sensible VCPKG_TARGET_TRIPLET unless the caller (or env +# var VCPKG_DEFAULT_TRIPLET) already set one. Windows defaults to the +# *-windows-static triplet so wheels stay self-contained. +# +# Notes on cross-compilation: +# * Visual Studio generators expose the target arch via +# CMAKE_GENERATOR_PLATFORM (-A Win32/x64/ARM64) — handled below. +# * For Ninja/Makefile generators we cannot tell host vs. target before +# project(); we fall back to the host arch (queried via +# cmake_host_system_information OS_PLATFORM, which works pre-project() +# unlike CMAKE_HOST_SYSTEM_PROCESSOR which is empty until project() +# runs on CMake < 3.25). When cross-compiling with such a generator, +# set VCPKG_TARGET_TRIPLET (or the VCPKG_DEFAULT_TRIPLET env var) +# explicitly, e.g. -DVCPKG_TARGET_TRIPLET=arm64-windows-static. +# +# Skip when consumed as a vcpkg port: +# When HiGHS is built as a port (e.g. installed via `vcpkg install highs`), +# the outer vcpkg invocation already owns the toolchain, triplet, and +# manifest settings. Detecting that situation and bailing out early +# prevents this module from forcing a *-windows-static triplet, hijacking +# VCPKG_MANIFEST_DIR to extern/vcpkg.json, or otherwise interfering with +# the port build. Indicators that we're inside a vcpkg-driven build: +# * CMAKE_TOOLCHAIN_FILE is already set (any toolchain in effect) +# * Z_VCPKG_ROOT_DIR exported by vcpkg's portfile + +if(DEFINED CMAKE_TOOLCHAIN_FILE + OR DEFINED ENV{Z_VCPKG_ROOT_DIR}) + return() +endif() + +if (DEFINED ENV{VCPKG_INSTALLATION_ROOT} AND NOT DEFINED ENV{VCPKG_ROOT}) + set(ENV{VCPKG_ROOT} $ENV{VCPKG_INSTALLATION_ROOT}) +endif() + +# Treat an empty VCPKG_ROOT the same as undefined (allows overrides to +# disable vcpkg by setting VCPKG_ROOT=""). +if(DEFINED ENV{VCPKG_ROOT} AND NOT "$ENV{VCPKG_ROOT}" STREQUAL "") + message(STATUS "Using VCPKG_ROOT: $ENV{VCPKG_ROOT}") + file(TO_CMAKE_PATH "$ENV{VCPKG_ROOT}" VCPKG_ROOT_CMAKE) + + set(CMAKE_TOOLCHAIN_FILE + "${VCPKG_ROOT_CMAKE}/scripts/buildsystems/vcpkg.cmake" + CACHE FILEPATH "vcpkg toolchain file") + + # The manifest lives in extern/ alongside the code that consumes the + # dependencies. vcpkg only auto-discovers vcpkg.json in CMAKE_SOURCE_DIR, + # so point VCPKG_MANIFEST_DIR at extern/ explicitly. This makes manifest + # mode work whether the top-level project is highspy-extras/, extern/ + # itself, or any future consumer. + if(NOT DEFINED VCPKG_MANIFEST_DIR + AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/../extern/vcpkg.json") + get_filename_component(VCPKG_MANIFEST_DIR + "${CMAKE_CURRENT_LIST_DIR}/../extern" ABSOLUTE) + set(VCPKG_MANIFEST_DIR "${VCPKG_MANIFEST_DIR}" + CACHE PATH "vcpkg manifest directory") + endif() + + if(NOT DEFINED VCPKG_TARGET_TRIPLET AND NOT DEFINED ENV{VCPKG_DEFAULT_TRIPLET}) + # CMAKE_HOST_SYSTEM_PROCESSOR isn't reliably populated before project() + # on CMake < 3.25, so query the host arch explicitly. + if(NOT _vcpkg_host_arch) + cmake_host_system_information(RESULT _vcpkg_host_arch + QUERY OS_PLATFORM) + endif() + + if(CMAKE_GENERATOR_PLATFORM STREQUAL "Win32") + set(_vcpkg_arch x86) + elseif(CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64") + set(_vcpkg_arch arm64) + elseif(CMAKE_GENERATOR_PLATFORM STREQUAL "x64") + set(_vcpkg_arch x64) + elseif(_vcpkg_host_arch MATCHES "^(x86_64|AMD64|x64)$") + set(_vcpkg_arch x64) + elseif(_vcpkg_host_arch MATCHES "^(aarch64|arm64|ARM64)$") + set(_vcpkg_arch arm64) + elseif(_vcpkg_host_arch MATCHES "^(i.86|x86|X86)$") + set(_vcpkg_arch x86) + endif() + + message(STATUS "Host arch (OS_PLATFORM): ${_vcpkg_host_arch}") + message(STATUS "Auto-detected vcpkg architecture: ${_vcpkg_arch}") + + if(WIN32 AND DEFINED _vcpkg_arch) + set(VCPKG_TARGET_TRIPLET "${_vcpkg_arch}-windows-static" + CACHE STRING "vcpkg triplet") + set(VCPKG_HOST_TRIPLET "${_vcpkg_arch}-windows-static" + CACHE STRING "vcpkg host triplet") + + # Match the static CRT used by the *-windows-static triplet to + # avoid LNK4098 "defaultlib 'LIBCMT' conflicts with ..." warnings. + set(CMAKE_MSVC_RUNTIME_LIBRARY + "MultiThreaded$<$:Debug>" + CACHE STRING "MSVC runtime library") + + elseif(APPLE AND DEFINED _vcpkg_arch) + set(VCPKG_TARGET_TRIPLET "${_vcpkg_arch}-osx" + CACHE STRING "vcpkg triplet") + elseif(UNIX AND DEFINED _vcpkg_arch) + set(VCPKG_TARGET_TRIPLET "${_vcpkg_arch}-linux" + CACHE STRING "vcpkg triplet") + endif() + + unset(_vcpkg_arch) + unset(_vcpkg_host_arch) + endif() + + # Fall back to the env-var default if nothing else picked a triplet. + if(NOT DEFINED VCPKG_TARGET_TRIPLET AND DEFINED ENV{VCPKG_DEFAULT_TRIPLET}) + set(VCPKG_TARGET_TRIPLET "$ENV{VCPKG_DEFAULT_TRIPLET}" + CACHE STRING "vcpkg triplet") + endif() + + if(DEFINED VCPKG_TARGET_TRIPLET) + message(STATUS "Using vcpkg triplet: ${VCPKG_TARGET_TRIPLET}") + else() + message(WARNING + "VCPKG_TARGET_TRIPLET not set; vcpkg will use its built-in default. " + "Set -DVCPKG_TARGET_TRIPLET=... when cross-compiling.") + endif() +endif() diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 4c688bd2cc..1d36778347 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -5,6 +5,7 @@ option(BUILD_SHARED_EXTRAS_LIB "Build shared extras library" ON) # configure the version list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake") +include(vcpkg) include(set-version) set_version(VERSION ${CMAKE_CURRENT_LIST_DIR}/..) @@ -19,34 +20,6 @@ configure_file(${CMAKE_CURRENT_LIST_DIR}/../highs/HConfig.h.in ${PROJECT_BINARY_ # print the version for debugging message(STATUS "Configuring highs_extras version ${VERSION}") - -# support vcpkg for external dependencies -if(WIN32 AND DEFINED ENV{VCPKG_ROOT}) - file(TO_CMAKE_PATH "$ENV{VCPKG_ROOT}" VCPKG_ROOT_CMAKE) - - if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) - set(CMAKE_TOOLCHAIN_FILE - "${VCPKG_ROOT_CMAKE}/scripts/buildsystems/vcpkg.cmake" - CACHE FILEPATH "vcpkg toolchain file") - endif() - - if(NOT DEFINED VCPKG_TARGET_TRIPLET) - if(DEFINED ENV{VCPKG_TARGET_TRIPLET}) - set(VCPKG_TARGET_TRIPLET "$ENV{VCPKG_TARGET_TRIPLET}" - CACHE STRING "vcpkg triplet") - else() - set(VCPKG_TARGET_TRIPLET "x64-windows-static" - CACHE STRING "vcpkg triplet") - endif() - endif() - - if(NOT DEFINED OpenBLAS_DIR) - set(OpenBLAS_DIR - "${VCPKG_ROOT_CMAKE}/installed/${VCPKG_TARGET_TRIPLET}/share/openblas" - CACHE PATH "Path to OpenBLAS CMake package") - endif() -endif() - include(FindHipoDeps) set(highs_extras_sources @@ -171,7 +144,7 @@ function(highs_extras_link_blas target_name) message(FATAL_ERROR "OpenBLAS not found for highs_extras") endfunction() -if (${BUILD_SHARED_EXTRAS_LIB}) +if (BUILD_SHARED_EXTRAS_LIB) add_library(highs_extras SHARED ${highs_extras_sources} ${highs_extras_headers}) @@ -196,14 +169,15 @@ highs_extras_link_blas(highs_extras) if(MSVC) target_compile_options(highs_extras PRIVATE "/bigobj") else() - target_compile_options(highs_extras PRIVATE "-ftemplate-depth=2048") + target_compile_options(highs_extras PRIVATE + $<$:-ftemplate-depth=2048>) endif() set_target_properties(highs_extras PROPERTIES OUTPUT_NAME "highs_extras" POSITION_INDEPENDENT_CODE ON) -if(${BUILD_SHARED_EXTRAS_LIB}) +if(BUILD_SHARED_EXTRAS_LIB) set_target_properties(highs_extras PROPERTIES CXX_VISIBILITY_PRESET hidden C_VISIBILITY_PRESET hidden diff --git a/extern/HighsExtrasApi.cpp b/extern/HighsExtrasApi.cpp index 79eae42a49..2fecb157c4 100644 --- a/extern/HighsExtrasApi.cpp +++ b/extern/HighsExtrasApi.cpp @@ -149,7 +149,7 @@ HIGHS_EXTRAS_API void highs_extras_dtrsm( } HIGHS_EXTRAS_API void highs_extras_openblas_set_num_threads(int num_threads) { -#if defined(__APPLE__) && defined(HIPO_USES_OPENBLAS) +#if defined(HIPO_USES_OPENBLAS) openblas_set_num_threads(num_threads); #endif } diff --git a/extern/HighsExtrasApi.h b/extern/HighsExtrasApi.h index ea80f97f66..67a48ad6c3 100644 --- a/extern/HighsExtrasApi.h +++ b/extern/HighsExtrasApi.h @@ -88,14 +88,6 @@ HIGHS_EXTRAS_API int highs_extras_amd_order(amd_int n, const amd_int Ap[], const amd_int Ai[], amd_int P[], double Control[], double Info[]); -// rcm -// HIGHS_EXTRAS_API int highs_extras_genrcm(HighsInt node_num, -// HighsInt adj_num, -// const HighsInt adj_row[], -// const HighsInt adj[], -// HighsInt perm[]); - - // blas HIGHS_EXTRAS_API void highs_extras_daxpy(const blasint n, const double alpha, const double* x, const blasint incx, @@ -188,10 +180,6 @@ struct amd { using order_t = decltype(&highs_extras_amd_order); }; -//struct rcm { -// using genrcm_t = decltype(&highs_extras_genrcm); -//}; - struct blas { using daxpy_t = decltype(&highs_extras_daxpy); using dcopy_t = decltype(&highs_extras_dcopy); diff --git a/extern/metis/metis.h b/extern/metis/metis.h index 3a2df2ecaf..2a0f331be3 100644 --- a/extern/metis/metis.h +++ b/extern/metis/metis.h @@ -63,31 +63,16 @@ #define COMPILER_GCC #endif -/* Include c99 int definitions and need constants. When building the library, +/* Include c99 int definitions and needed constants. When building the library, * these are already defined by GKlib; hence the test for _GKLIB_H_ */ #ifndef _GKLIB_H_ -#ifdef COMPILER_MSC -#include - -typedef __int32 int32_t; -typedef __int64 int64_t; -#define PRId32 "I32d" -#define PRId64 "I64d" -#define SCNd32 "ld" -#define SCNd64 "I64d" - -#ifdef _WIN32 -#include -#else -#define INT32_MIN ((int32_t)_I32_MIN) -#define INT32_MAX _I32_MAX -#define INT64_MIN ((int64_t)_I64_MIN) -#define INT64_MAX _I64_MAX +#ifdef __cplusplus +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS #endif - -#else -#include #endif +#include +#include #endif diff --git a/extern/mycblas.h b/extern/mycblas.h index 8dcb9f9b50..e9227cc858 100644 --- a/extern/mycblas.h +++ b/extern/mycblas.h @@ -76,6 +76,10 @@ void cblas_dtrsm(const enum CBLAS_ORDER order, const enum CBLAS_SIDE side, const double alpha, const double* a, const blasint lda, double* b, const blasint ldb); +#if defined(HIPO_USES_OPENBLAS) +void openblas_set_num_threads(int num_threads); +#endif + #ifdef __cplusplus } #endif diff --git a/extern/vcpkg.json b/extern/vcpkg.json new file mode 100644 index 0000000000..dfd8d7f104 --- /dev/null +++ b/extern/vcpkg.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", + "name": "extras", + "description": "Dependencies for the highs_extras library", + "dependencies": [ + { + "name": "openblas", + "platform": "!osx", + "features": ["threads"] + } + ] +} diff --git a/highs/CMakeLists.txt b/highs/CMakeLists.txt index 30da477cc9..776f1a9978 100644 --- a/highs/CMakeLists.txt +++ b/highs/CMakeLists.txt @@ -12,8 +12,9 @@ if(HIPO) set(sources ${sources} ${hipo_sources} ${factor_highs_sources} ${hipo_util_sources} ${hipo_orderings_sources}) set(headers ${headers} ${hipo_headers} ${factor_highs_headers} ${hipo_util_headers} ${hipo_orderings_headers}) endif() -# set(sources ${highs_sources} ${cupdlp_sources} ${ipx_sources} ${basiclu_sources} ${hipo_sources} ${factor_highs_sources} ${hipo_util_sources}) -# set(headers ${highs_headers} ${cupdlp_headers} ${ipx_headers} ${basiclu_headers} ${hipo_headers} ${factor_highs_headers} ${hipo_util_headers}) + +# set(sources ${highs_sources} ${cupdlp_sources} ${ipx_sources} ${basiclu_sources} ${hipo_sources} ${factor_highs_sources} ${hipo_util_sources} ${hipo_orderings_sources}) +# set(headers ${highs_headers} ${cupdlp_headers} ${ipx_headers} ${basiclu_headers} ${hipo_headers} ${factor_highs_headers} ${hipo_util_headers} ${hipo_orderings_headers}) # Configure the config windows version file @@ -160,10 +161,26 @@ else() set_target_properties(highs PROPERTIES INSTALL_RPATH "$ORIGIN") endif() - if (${BUILD_SHARED_EXTRAS_LIB}) - target_compile_definitions(highs PRIVATE HIGHS_SHARED_EXTRAS_LIBRARY) - else() - target_link_libraries(highs PRIVATE highs_extras) + if (HIPO) + if (BUILD_SHARED_EXTRAS_LIB) + target_compile_definitions(highs PRIVATE HIGHS_SHARED_EXTRAS_LIBRARY) + + if (NOT HIPO_PYTHON) + if(APPLE) + set_target_properties(highs PROPERTIES + INSTALL_RPATH "@loader_path;@loader_path/../${CMAKE_INSTALL_LIBDIR}" + BUILD_RPATH "$" + ) + elseif(UNIX) + set_target_properties(highs PROPERTIES + INSTALL_RPATH "$ORIGIN" + BUILD_RPATH "$" + ) + endif() + endif() + else() + target_link_libraries(highs PRIVATE highs_extras) + endif() endif() target_sources(highs PRIVATE ${sources} ${headers} ${win_version_file}) diff --git a/highs/HighsExternalDeps.cpp b/highs/HighsExternalDeps.cpp index 9313a2112d..b80ed9fb2e 100644 --- a/highs/HighsExternalDeps.cpp +++ b/highs/HighsExternalDeps.cpp @@ -10,25 +10,46 @@ */ #include "HighsExternalDeps.h" + #include "HConfig.h" +// c++11 does not support inline static definition +HighsExternalDeps::amd HighsExternalDeps::amd_; +HighsExternalDeps::blas HighsExternalDeps::blas_; +HighsExternalDeps::metis HighsExternalDeps::metis_; +HighsExternalDeps::rcm HighsExternalDeps::rcm_; + +HighsExternalDeps& HighsExternalDeps::instance() { + static HighsExternalDeps _instance; + return _instance; +} + +bool HighsExternalDeps::tryLoad() { + static const std::string empty_path = ""; + return tryLoad(empty_path); +} + +#ifdef HIGHS_SHARED_EXTRAS_LIBRARY // Platform-specific includes for dynamic loading #if defined(_WIN32) || defined(_WIN64) #define WIN32_LEAN_AND_MEAN #include -#define PATH_SEPARATOR "\\" #else #include -#define PATH_SEPARATOR "/" #endif -std::string getLibraryFilename() { +#include + +// anonymous namespace to limit the scope of helper functions to this file +namespace { +std::string getLibraryFilename(const std::string& path) { #if defined(_WIN32) || defined(_WIN64) - return "highs_extras.dll"; + return path + (path.empty() ? "" : "\\") + "highs_extras.dll"; #elif defined(__APPLE__) - return "libhighs_extras.dylib"; + return path + (path.empty() ? "@loader_path/" : "/") + + "libhighs_extras.dylib"; #else - return "libhighs_extras.so"; + return path + (path.empty() ? "" : "/") + "libhighs_extras.so"; #endif } @@ -43,20 +64,8 @@ bool resolveSymbol(void* handle, FuncType& target, const char* name) { return target != nullptr; } +} // namespace -// c++11 does not support inline static definition -HighsExternalDeps::amd HighsExternalDeps::amd_; -HighsExternalDeps::blas HighsExternalDeps::blas_; -HighsExternalDeps::metis HighsExternalDeps::metis_; -HighsExternalDeps::rcm HighsExternalDeps::rcm_; - -HighsExternalDeps& HighsExternalDeps::instance() { - static HighsExternalDeps _instance; - return _instance; -} - -#ifdef HIPO -#ifdef HIGHS_SHARED_EXTRAS_LIBRARY void HighsExternalDeps::clear() { amd_ = amd{}; blas_ = blas{}; @@ -84,98 +93,98 @@ void HighsExternalDeps::unload() { bool HighsExternalDeps::tryLoad(const std::string& path) { HighsExternalDeps& inst = instance(); + static std::once_flag flag; - // Allow multiple attempts. - if (inst.available_) - return true; + // prevents multiple attempts to load the library + // ensure thread safety (multiple threads may call tryLoad simultaneously) + std::call_once(flag, [&]() { + inst.available_ = false; - // printf("Attempting to load HiGHS Extras from: %s\n", path.c_str()); - inst.initialized_ = true; - inst.available_ = false; - - // Load library - const std::string full_path = path + PATH_SEPARATOR + getLibraryFilename(); + // Load library + const std::string full_path = getLibraryFilename(path); + bool ok = true; #if defined(_WIN32) || defined(_WIN64) - inst.lib_handle_ = static_cast(LoadLibraryA(full_path.c_str())); - if (!inst.lib_handle_) { - DWORD error = GetLastError(); - char* msg = nullptr; - FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - nullptr, error, 0, reinterpret_cast(&msg), 0, - nullptr); - inst.last_error_ = - "Failed to load " + full_path + ": " + (msg ? msg : "Unknown error"); - if (msg) LocalFree(msg); - return false; - } + inst.lib_handle_ = static_cast(LoadLibraryA(full_path.c_str())); + if (!inst.lib_handle_) { + DWORD error = GetLastError(); + char* msg = nullptr; + FormatMessageA( + FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, nullptr, + error, 0, reinterpret_cast(&msg), 0, nullptr); + inst.status_ = "Extras: Failed to load " + full_path + ": " + + (msg ? msg : "Unknown error"); + if (msg) LocalFree(msg); + ok = false; + } #else - inst.lib_handle_ = dlopen(full_path.c_str(), RTLD_NOW | RTLD_LOCAL); - if (!inst.lib_handle_) { - const char* err = dlerror(); - inst.last_error_ = - "Failed to load " + full_path + ": " + (err ? err : "Unknown error"); - return false; - } + inst.lib_handle_ = dlopen(full_path.c_str(), RTLD_NOW | RTLD_LOCAL); + if (!inst.lib_handle_) { + const char* err = dlerror(); + inst.status_ = + "Extras: Failed to load " + full_path + ": " + (err ? err : "Unknown error"); + ok = false; + } #endif - - // Resolve all function pointers - void* h = inst.lib_handle_; - bool ok = true; - - // AMD - ok &= resolveSymbol(h, amd_.defaults_,"highs_extras_amd_defaults"); - ok &= resolveSymbol(h, amd_.order_, "highs_extras_amd_order"); - - // BLAS - ok &= resolveSymbol(h, blas_.daxpy_, "highs_extras_daxpy"); - ok &= resolveSymbol(h, blas_.dcopy_, "highs_extras_dcopy"); - ok &= resolveSymbol(h, blas_.dscal_, "highs_extras_dscal"); - ok &= resolveSymbol(h, blas_.dswap_, "highs_extras_dswap"); - ok &= resolveSymbol(h, blas_.dgemv_, "highs_extras_dgemv"); - ok &= resolveSymbol(h, blas_.dtpsv_, "highs_extras_dtpsv"); - ok &= resolveSymbol(h, blas_.dtrsv_, "highs_extras_dtrsv"); - ok &= resolveSymbol(h, blas_.dger_, "highs_extras_dger"); - ok &= resolveSymbol(h, blas_.dgemm_, "highs_extras_dgemm"); - ok &= resolveSymbol(h, blas_.dsyrk_, "highs_extras_dsyrk"); - ok &= resolveSymbol(h, blas_.dtrsm_, "highs_extras_dtrsm"); - ok &= resolveSymbol(h, blas_.set_num_threads_, "highs_extras_openblas_set_num_threads"); - ok &= resolveSymbol(h, blas_.library_, "highs_extras_blas_library"); - - // METIS - ok &= resolveSymbol(h, metis_.set_default_options_, - "highs_extras_metis_set_default_options"); - ok &= resolveSymbol(h, metis_.nodend_, "highs_extras_metis_nodend"); - - //// RCM - //ok &= resolveSymbol(h, rcm.genrcm_, "highs_extras_genrcm"); - - // Check ABI compatibility - highs_extras_api::core::get_version_t get_version = nullptr; - ok &= resolveSymbol(h, get_version, "highs_extras_get_version"); - - ok &= resolveSymbol(h, instance().get_copyright_, "highs_extras_get_copyright"); - - if (!ok) { - inst.last_error_ = "Failed to resolve required external functions"; - inst.unload(); - return false; - } - - std::string highs_version = STRINGFY(HIGHS_VERSION_MAJOR) "." STRINGFY( - HIGHS_VERSION_MINOR) "." STRINGFY(HIGHS_VERSION_PATCH); - std::string extras_version = get_version(); - if (extras_version != highs_version) { - inst.last_error_ = - "HiGHS Extras ABI version mismatch: expected " + highs_version + - ", got " + extras_version + - ". Please reinstall: pip install --force-reinstall highspy[extras]"; - inst.unload(); - return false; - } - - inst.available_ = true; - return true; + else { + // Resolve all function pointers + void* h = inst.lib_handle_; + + // AMD + ok &= resolveSymbol(h, amd_.defaults_, "highs_extras_amd_defaults"); + ok &= resolveSymbol(h, amd_.order_, "highs_extras_amd_order"); + + // BLAS + ok &= resolveSymbol(h, blas_.daxpy_, "highs_extras_daxpy"); + ok &= resolveSymbol(h, blas_.dcopy_, "highs_extras_dcopy"); + ok &= resolveSymbol(h, blas_.dscal_, "highs_extras_dscal"); + ok &= resolveSymbol(h, blas_.dswap_, "highs_extras_dswap"); + ok &= resolveSymbol(h, blas_.dgemv_, "highs_extras_dgemv"); + ok &= resolveSymbol(h, blas_.dtpsv_, "highs_extras_dtpsv"); + ok &= resolveSymbol(h, blas_.dtrsv_, "highs_extras_dtrsv"); + ok &= resolveSymbol(h, blas_.dger_, "highs_extras_dger"); + ok &= resolveSymbol(h, blas_.dgemm_, "highs_extras_dgemm"); + ok &= resolveSymbol(h, blas_.dsyrk_, "highs_extras_dsyrk"); + ok &= resolveSymbol(h, blas_.dtrsm_, "highs_extras_dtrsm"); + ok &= resolveSymbol(h, blas_.set_num_threads_, + "highs_extras_openblas_set_num_threads"); + ok &= resolveSymbol(h, blas_.library_, "highs_extras_blas_library"); + + // METIS + ok &= resolveSymbol(h, metis_.set_default_options_, + "highs_extras_metis_set_default_options"); + ok &= resolveSymbol(h, metis_.nodend_, "highs_extras_metis_nodend"); + + // Check ABI compatibility + highs_extras_api::core::get_version_t get_version = nullptr; + ok &= resolveSymbol(h, get_version, "highs_extras_get_version"); + + ok &= resolveSymbol(h, instance().get_copyright_, + "highs_extras_get_copyright"); + + if (!ok) { + inst.status_ = "Extras: Failed to resolve required external functions"; + inst.unload(); + } else { + std::string highs_version = STRINGFY(HIGHS_VERSION_MAJOR) "." STRINGFY( + HIGHS_VERSION_MINOR) "." STRINGFY(HIGHS_VERSION_PATCH); + std::string extras_version = get_version(); + if (extras_version != highs_version) { + inst.status_ = "Extras: ABI version mismatch: expected " + + highs_version + ", got " + extras_version + + ". Please reinstall: pip install --force-reinstall " + "highspy[extras]"; + inst.unload(); + ok = false; + } else { + inst.status_ = "Extras: Successfully loaded"; + } + } + } + + inst.available_ = ok; + }); + + return inst.available_; } #endif -#endif diff --git a/highs/HighsExternalDeps.h b/highs/HighsExternalDeps.h index a1c63960fe..051963b30c 100644 --- a/highs/HighsExternalDeps.h +++ b/highs/HighsExternalDeps.h @@ -11,9 +11,10 @@ #ifndef HIGHS_EXTERNAL_DEPS_H_ #define HIGHS_EXTERNAL_DEPS_H_ #include + #include "HighsExtrasApi.h" -#include "util/HighsInt.h" #include "rcm/rcm.h" +#include "util/HighsInt.h" // support dynamic or static function calls #ifdef HIGHS_SHARED_EXTRAS_LIBRARY @@ -22,9 +23,8 @@ #define HIGHS_EXTERN_CALL(fn_member, fn_direct) fn_direct #endif - /** - * External dependencies for HiGHS that can either be dynamically loaded + * External dependencies for HiGHS that can either be dynamically loaded * or linked at compile time, depending on the build configuration. * * This class handles runtime loading or static linking of external dependencies @@ -42,9 +42,9 @@ struct HighsExternalDeps { } static inline int order(amd_int n, const amd_int Ap[], const amd_int Ai[], - amd_int P[], double Control[], double Info[]) { + amd_int P[], double Control[], double Info[]) { return HIGHS_EXTERN_CALL(amd_.order_, Highs_amd_order)(n, Ap, Ai, P, - Control, Info); + Control, Info); } }; @@ -61,18 +61,18 @@ struct HighsExternalDeps { highs_extras_api::blas::dgemm_t dgemm_ = nullptr; highs_extras_api::blas::dsyrk_t dsyrk_ = nullptr; highs_extras_api::blas::dtrsm_t dtrsm_ = nullptr; - highs_extras_api::blas::openblas_set_num_threads_t set_num_threads_ = nullptr; + highs_extras_api::blas::openblas_set_num_threads_t set_num_threads_ = + nullptr; highs_extras_api::blas::library_t library_ = nullptr; #endif static void daxpy(blasint n, double alpha, const double* x, blasint incx, double* y, blasint incy) { - HIGHS_EXTERN_CALL(blas_.daxpy_, cblas_daxpy)( - n, alpha, x, incx, y, incy); + HIGHS_EXTERN_CALL(blas_.daxpy_, cblas_daxpy)(n, alpha, x, incx, y, incy); } - static inline void dcopy(blasint n, const double* x, blasint incx, double* y, - blasint incy) { + static inline void dcopy(blasint n, const double* x, blasint incx, + double* y, blasint incy) { HIGHS_EXTERN_CALL(blas_.dcopy_, cblas_dcopy)(n, x, incx, y, incy); } @@ -81,68 +81,66 @@ struct HighsExternalDeps { } static inline void dswap(blasint n, double* x, blasint incx, double* y, - blasint incy) { + blasint incy) { HIGHS_EXTERN_CALL(blas_.dswap_, cblas_dswap)(n, x, incx, y, incy); } - static inline void dgemv(CBLAS_ORDER order, CBLAS_TRANSPOSE trans, blasint m, - blasint n, double alpha, const double* A, blasint lda, - const double* x, blasint incx, double beta, double* y, - blasint incy) { + static inline void dgemv(CBLAS_ORDER order, CBLAS_TRANSPOSE trans, + blasint m, blasint n, double alpha, + const double* A, blasint lda, const double* x, + blasint incx, double beta, double* y, + blasint incy) { HIGHS_EXTERN_CALL(blas_.dgemv_, cblas_dgemv)(order, trans, m, n, alpha, A, - lda, - x, incx, beta, y, incy); + lda, x, incx, beta, y, incy); } static inline void dtpsv(CBLAS_ORDER order, CBLAS_UPLO uplo, - CBLAS_TRANSPOSE transa, CBLAS_DIAG diag, blasint n, - const double* ap, double* x, blasint incx) { + CBLAS_TRANSPOSE transa, CBLAS_DIAG diag, blasint n, + const double* ap, double* x, blasint incx) { HIGHS_EXTERN_CALL(blas_.dtpsv_, cblas_dtpsv)(order, uplo, transa, diag, n, - ap, - x, incx); + ap, x, incx); } static inline void dtrsv(CBLAS_ORDER order, CBLAS_UPLO uplo, - CBLAS_TRANSPOSE transa, const enum CBLAS_DIAG diag, - blasint n, const double* a, blasint lda, double* x, - blasint incx) { + CBLAS_TRANSPOSE transa, const enum CBLAS_DIAG diag, + blasint n, const double* a, blasint lda, double* x, + blasint incx) { HIGHS_EXTERN_CALL(blas_.dtrsv_, cblas_dtrsv)(order, uplo, transa, diag, n, - a, - lda, x, incx); + a, lda, x, incx); } - static inline void dger(CBLAS_ORDER order, blasint m, blasint n, double alpha, - const double* x, blasint incx, const double* y, - blasint incy, double* A, blasint lda) { + static inline void dger(CBLAS_ORDER order, blasint m, blasint n, + double alpha, const double* x, blasint incx, + const double* y, blasint incy, double* A, + blasint lda) { HIGHS_EXTERN_CALL(blas_.dger_, cblas_dger)(order, m, n, alpha, x, incx, y, - incy, - A, lda); + incy, A, lda); } static inline void dgemm(CBLAS_ORDER order, CBLAS_TRANSPOSE transa, - CBLAS_TRANSPOSE transb, blasint m, blasint n, blasint k, - double alpha, const double* A, blasint lda, - const double* B, blasint ldb, double beta, double* C, - blasint ldc) { + CBLAS_TRANSPOSE transb, blasint m, blasint n, + blasint k, double alpha, const double* A, + blasint lda, const double* B, blasint ldb, + double beta, double* C, blasint ldc) { HIGHS_EXTERN_CALL(blas_.dgemm_, cblas_dgemm)( order, transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc); } - static inline void dsyrk(CBLAS_ORDER order, CBLAS_UPLO uplo, CBLAS_TRANSPOSE trans, - blasint n, blasint k, double alpha, const double* A, - blasint lda, double beta, double* C, blasint ldc) { + static inline void dsyrk(CBLAS_ORDER order, CBLAS_UPLO uplo, + CBLAS_TRANSPOSE trans, blasint n, blasint k, + double alpha, const double* A, blasint lda, + double beta, double* C, blasint ldc) { HIGHS_EXTERN_CALL(blas_.dsyrk_, cblas_dsyrk)(order, uplo, trans, n, k, - alpha, A, - lda, beta, C, ldc); + alpha, A, lda, beta, C, ldc); } - static inline void dtrsm(CBLAS_ORDER order, CBLAS_SIDE side, CBLAS_UPLO uplo, - CBLAS_TRANSPOSE transa, CBLAS_DIAG diag, blasint m, - blasint n, double alpha, const double* A, blasint lda, - double* B, blasint ldb) { + static inline void dtrsm(CBLAS_ORDER order, CBLAS_SIDE side, + CBLAS_UPLO uplo, CBLAS_TRANSPOSE transa, + CBLAS_DIAG diag, blasint m, blasint n, + double alpha, const double* A, blasint lda, + double* B, blasint ldb) { HIGHS_EXTERN_CALL(blas_.dtrsm_, cblas_dtrsm)( - order, side, uplo, transa, diag, m, - n, alpha, A, lda, B, ldb); + order, side, uplo, transa, diag, m, n, alpha, A, lda, B, ldb); } static inline void openblas_set_num_threads(int num_threads) { @@ -151,15 +149,14 @@ struct HighsExternalDeps { } static inline std::string blas_library() { - return HIGHS_EXTERN_CALL(blas_.library_, - highs_extras_blas_library)(); + return HIGHS_EXTERN_CALL(blas_.library_, highs_extras_blas_library)(); } }; struct metis { #ifdef HIGHS_SHARED_EXTRAS_LIBRARY - highs_extras_api::metis::set_default_options_t - set_default_options_ = nullptr; + highs_extras_api::metis::set_default_options_t set_default_options_ = + nullptr; highs_extras_api::metis::nodend_t nodend_ = nullptr; #endif @@ -168,22 +165,20 @@ struct HighsExternalDeps { Highs_METIS_SetDefaultOptions)(options); } - static inline int nodeND(idx_t* nvtxs, const idx_t* xadj, const idx_t* adjncy, - idx_t* vwgt, idx_t* options, idx_t* perm, - idx_t* iperm) { + static inline int nodeND(idx_t* nvtxs, const idx_t* xadj, + const idx_t* adjncy, idx_t* vwgt, idx_t* options, + idx_t* perm, idx_t* iperm) { return HIGHS_EXTERN_CALL(metis_.nodend_, Highs_METIS_NodeND)( nvtxs, xadj, adjncy, vwgt, options, perm, iperm); } }; + // rcm has MIT license and is always statically linked + // accessed via HighsExternalDeps for consistency struct rcm { -//#ifdef HIGHS_SHARED_EXTRAS_LIBRARY -// highs_extras_api::rcm::genrcm_t genrcm_ = nullptr; -//#endif - static inline int genrcm(HighsInt node_num, HighsInt adj_num, - const HighsInt adj_row[], const HighsInt adj[], - HighsInt perm[]) { + const HighsInt adj_row[], const HighsInt adj[], + HighsInt perm[]) { return Highs_genrcm(node_num, adj_num, adj_row, adj, perm); } }; @@ -203,48 +198,51 @@ struct HighsExternalDeps { HighsExternalDeps(const HighsExternalDeps&) = delete; HighsExternalDeps& operator=(const HighsExternalDeps&) = delete; + static bool tryLoad(); + +// Exclude dependencies #ifndef HIPO static inline bool isAvailable() { return false; } static constexpr bool isAvailableAtCompile() { return false; } - static bool tryLoad(const std::string& path) {return false; } - static void unload() {}; - static const std::string getLastError() { return ""; } + static inline bool tryLoad(const std::string& path) { return false; } + static inline void unload() {} + static inline std::string getCopyrightInfo() { return ""; } + static inline const std::string getLoadStatus() { + return "Extras: Unavailable"; + } +// Shared library support #elif defined(HIGHS_SHARED_EXTRAS_LIBRARY) - static inline bool isAvailable() { return instance().available_; } + static inline bool isAvailable() { return tryLoad(); } static constexpr bool isAvailableAtCompile() { return false; } static bool tryLoad(const std::string& path); static void unload(); - static const std::string getLastError() { return instance().last_error_; } + static std::string getCopyrightInfo() { return instance().get_copyright_(); } + static const std::string getLoadStatus() { return instance().status_; } + +// Static library support #else static inline bool isAvailable() { return true; } static constexpr bool isAvailableAtCompile() { return true; } - static inline bool tryLoad(const std::string&) { return true; } + static inline bool tryLoad(const std::string& path) { return true; } static inline void unload() {} - static inline const std::string getLastError() { return ""; } -#endif + static std::string getCopyrightInfo() { return highs_extras_get_copyright(); } - static inline std::string getCopyrightInfo() { - return HIGHS_EXTERN_CALL(instance().get_copyright_, - highs_extras_get_copyright)(); + static inline const std::string getLoadStatus() { + return "Extras: Available at compile time"; } -private: +#endif + + private: #ifdef HIGHS_SHARED_EXTRAS_LIBRARY -// Library handle (platform-specific) -#if defined(_WIN32) || defined(_WIN64) - void* lib_handle_ = nullptr; // HMODULE -#else void* lib_handle_ = nullptr; -#endif - highs_extras_api::core::get_copyright_t get_copyright_ = nullptr; bool available_ = false; - bool initialized_ = false; - std::string last_error_; + std::string status_; void clear(); #endif diff --git a/highs/lp_data/HighsOptions.cpp b/highs/lp_data/HighsOptions.cpp index eb7282ca49..f6d60cba45 100644 --- a/highs/lp_data/HighsOptions.cpp +++ b/highs/lp_data/HighsOptions.cpp @@ -17,41 +17,6 @@ #include "HighsExternalDeps.h" #include "util/stringutil.h" -#ifdef __linux__ -#include - -#include - -static std::string getExecutableDir() { - char buf[PATH_MAX]; - ssize_t len = readlink("/proc/self/exe", buf, sizeof(buf) - 1); - if (len == -1) return "."; - buf[len] = '\0'; - std::string path(buf); - size_t pos = path.find_last_of('/'); - return path.substr(0, pos); -} -#endif - -bool hipoAvailable() { - if (HighsExternalDeps::tryLoad(".") == false) { -#ifdef __linux__ - const std::string exeDir = getExecutableDir(); - const std::string libDir = exeDir + "/../lib"; - const std::string lib64Dir = exeDir + "/../lib64"; - - if (HighsExternalDeps::tryLoad(exeDir) == false && - HighsExternalDeps::tryLoad(libDir) == false && - HighsExternalDeps::tryLoad(lib64Dir) == false) - std::cout << HighsExternalDeps::getLastError() << std::endl; -#else - std::cout << HighsExternalDeps::getLastError() << std::endl; -#endif - } - - return HighsExternalDeps::isAvailable(); -} - void highsOpenLogFile(HighsLogOptions& log_options, std::vector& option_records, const std::string& log_file) { @@ -114,21 +79,9 @@ bool optionOffOnOk(const HighsLogOptions& report_log_options, return false; } -// #ifndef HIPO -// static void noHipoErrorLog(const HighsLogOptions& report_log_options, -// const string& option_name) { -// highsLogUser( -// report_log_options, HighsLogType::kError, -// "The HiPO solver was requested via the \"%s\" option, but this build " -// "was compiled without HiPO support. Reconfigure with -DFAST_BUILD=ON " -// "and -DHIPO=ON to enable HiPO.\n", -// option_name.c_str()); -// } -// #endif - bool optionSolverOk(const HighsLogOptions& report_log_options, const string& value) { - if (value == kHipoString && !hipoAvailable()) { + if (value == kHipoString && !HighsExternalDeps::isAvailable()) { if (HighsExternalDeps::isAvailableAtCompile()) { highsLogUser( report_log_options, HighsLogType::kError, @@ -150,22 +103,24 @@ bool optionSolverOk(const HighsLogOptions& report_log_options, return false; } if (value == kHighsChooseString || value == kSimplexString || - value == kIpmString || (value == kHipoString && hipoAvailable()) || + value == kIpmString || + (value == kHipoString && HighsExternalDeps::isAvailable()) || value == kIpxString || value == kPdlpString) return true; - highsLogUser(report_log_options, HighsLogType::kWarning, - "Value \"%s\" for LP solver option (\"%s\") is not one of " - "%s\"%s\", \"%s\", \"%s\", \"%s\" or \"%s\"\n", - value.c_str(), kSolverString.c_str(), - hipoAvailable() ? (kHipoString + "\", \"").c_str() : "", - kHighsChooseString.c_str(), kSimplexString.c_str(), - kIpmString.c_str(), kIpxString.c_str(), kPdlpString.c_str()); + highsLogUser( + report_log_options, HighsLogType::kWarning, + "Value \"%s\" for LP solver option (\"%s\") is not one of " + "%s\"%s\", \"%s\", \"%s\", \"%s\" or \"%s\"\n", + value.c_str(), kSolverString.c_str(), + HighsExternalDeps::isAvailable() ? (kHipoString + "\", \"").c_str() : "", + kHighsChooseString.c_str(), kSimplexString.c_str(), kIpmString.c_str(), + kIpxString.c_str(), kPdlpString.c_str()); return false; } bool optionMipLpSolverOk(const HighsLogOptions& report_log_options, const string& value) { - if (value == kHipoString && !hipoAvailable()) { + if (value == kHipoString && !HighsExternalDeps::isAvailable()) { if (HighsExternalDeps::isAvailableAtCompile()) { highsLogUser( report_log_options, HighsLogType::kError, @@ -188,22 +143,24 @@ bool optionMipLpSolverOk(const HighsLogOptions& report_log_options, } if (value == kHighsChooseString || value == kSimplexString || - value == kIpmString || (value == kHipoString && hipoAvailable()) || + value == kIpmString || + (value == kHipoString && HighsExternalDeps::isAvailable()) || value == kIpxString) return true; - highsLogUser(report_log_options, HighsLogType::kError, - "Value \"%s\" for MIP LP solver option (\"%s\") is not one of " - "%s\"%s\", \"%s\", \"%s\" or \"%s\"\n", - value.c_str(), kMipLpSolverString.c_str(), - hipoAvailable() ? (kHipoString + "\", \"").c_str() : "", - kHighsChooseString.c_str(), kSimplexString.c_str(), - kIpmString.c_str(), kIpxString.c_str()); + highsLogUser( + report_log_options, HighsLogType::kError, + "Value \"%s\" for MIP LP solver option (\"%s\") is not one of " + "%s\"%s\", \"%s\", \"%s\" or \"%s\"\n", + value.c_str(), kMipLpSolverString.c_str(), + HighsExternalDeps::isAvailable() ? (kHipoString + "\", \"").c_str() : "", + kHighsChooseString.c_str(), kSimplexString.c_str(), kIpmString.c_str(), + kIpxString.c_str()); return false; } bool optionMipIpmSolverOk(const HighsLogOptions& report_log_options, const string& value) { - if (value == kHipoString && !hipoAvailable()) { + if (value == kHipoString && !HighsExternalDeps::isAvailable()) { if (HighsExternalDeps::isAvailableAtCompile()) { highsLogUser( report_log_options, HighsLogType::kError, @@ -225,15 +182,16 @@ bool optionMipIpmSolverOk(const HighsLogOptions& report_log_options, return false; } if (value == kHighsChooseString || value == kIpmString || - (value == kHipoString && hipoAvailable()) || value == kIpxString) + (value == kHipoString && HighsExternalDeps::isAvailable()) || + value == kIpxString) return true; - highsLogUser(report_log_options, HighsLogType::kError, - "Value \"%s\" for MIP IPM solver (\"%s\") option is not one of " - "%s\"%s\", \"%s\" or \"%s\"\n", - value.c_str(), kMipIpmSolverString.c_str(), - hipoAvailable() ? (kHipoString + "\", \"").c_str() : "", - kHighsChooseString.c_str(), kIpmString.c_str(), - kIpxString.c_str()); + highsLogUser( + report_log_options, HighsLogType::kError, + "Value \"%s\" for MIP IPM solver (\"%s\") option is not one of " + "%s\"%s\", \"%s\" or \"%s\"\n", + value.c_str(), kMipIpmSolverString.c_str(), + HighsExternalDeps::isAvailable() ? (kHipoString + "\", \"").c_str() : "", + kHighsChooseString.c_str(), kIpmString.c_str(), kIpxString.c_str()); return false; } diff --git a/highspy-extras/CMakeLists.txt b/highspy-extras/CMakeLists.txt index 75e0c05e2c..d4f7941ce6 100644 --- a/highspy-extras/CMakeLists.txt +++ b/highspy-extras/CMakeLists.txt @@ -5,13 +5,21 @@ cmake_minimum_required(VERSION 3.15...3.27) +# Resolve parent repo from either current dir (sdist) or parent (standard build) +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/extern/CMakeLists.txt") + set(_PARENT_DIR "${CMAKE_CURRENT_LIST_DIR}") +else() + set(_PARENT_DIR "${CMAKE_CURRENT_LIST_DIR}/..") +endif() + +list(APPEND CMAKE_MODULE_PATH "${_PARENT_DIR}/cmake") +include(vcpkg) + project(highs_extras LANGUAGES C CXX) -add_subdirectory( - "${CMAKE_CURRENT_LIST_DIR}/../extern" - "${CMAKE_CURRENT_BINARY_DIR}/extern") +add_subdirectory("${_PARENT_DIR}/extern" "${CMAKE_CURRENT_BINARY_DIR}/extern") install(TARGETS highs_extras RUNTIME DESTINATION highspy_extras LIBRARY DESTINATION highspy_extras -) \ No newline at end of file +) diff --git a/highspy-extras/build_backend.py b/highspy-extras/build_backend.py new file mode 100644 index 0000000000..558f2c7751 --- /dev/null +++ b/highspy-extras/build_backend.py @@ -0,0 +1,60 @@ +"""Thin wrapper around scikit-build-core that stages parent-repo files +into the project tree before building the sdist.""" + +import shutil +from pathlib import Path + +try: + import tomllib +except ModuleNotFoundError: + import tomli as tomllib + +from scikit_build_core import build as _orig + +_HERE = Path(__file__).resolve().parent +_PARENT = _HERE.parent + + +def _get_sdist_include(): + with open(_HERE / "pyproject.toml", "rb") as f: + cfg = tomllib.load(f) + return cfg.get("tool", {}).get("scikit-build", {}).get("sdist", {}).get("include", []) + + +def build_sdist(sdist_directory, config_settings=None): + created = [] + try: + for name in _get_sdist_include(): + dst, src = _HERE / name, _PARENT / name + print(f"Staging {src} -> {dst}") + if dst.exists() or not src.exists(): + continue + + # Track any new parent dirs so they can be cleaned up + new_dirs = [] + for parent in reversed(dst.relative_to(_HERE).parents[:-1]): + d = _HERE / parent + if d.exists(): + break + new_dirs.append(d) + + if new_dirs: + new_dirs[0].mkdir(parents=True) + created.extend(reversed(new_dirs)) + + (shutil.copytree if src.is_dir() else shutil.copy2)(src, dst) + created.append(dst) + return _orig.build_sdist(sdist_directory, config_settings) + finally: + for p in reversed(created): + shutil.rmtree(p) if p.is_dir() else p.unlink(missing_ok=True) + + +# Re-export everything else unchanged. +build_wheel = _orig.build_wheel +build_editable = _orig.build_editable +get_requires_for_build_sdist = _orig.get_requires_for_build_sdist +get_requires_for_build_wheel = _orig.get_requires_for_build_wheel +get_requires_for_build_editable = _orig.get_requires_for_build_editable +prepare_metadata_for_build_wheel = _orig.prepare_metadata_for_build_wheel +prepare_metadata_for_build_editable = _orig.prepare_metadata_for_build_editable diff --git a/highspy-extras/pyproject.toml b/highspy-extras/pyproject.toml index f7938520c8..9afd62c930 100644 --- a/highspy-extras/pyproject.toml +++ b/highspy-extras/pyproject.toml @@ -1,6 +1,10 @@ +# scikit_build_core can't access files in parent directory +# https://github.com/scikit-build/scikit-build-core/issues/615 +# so we use our own build_backend.py [build-system] requires = ["scikit-build-core>=0.3.3"] -build-backend = "scikit_build_core.build" +build-backend = "build_backend" +backend-path = ["."] [project] name = "highspy-extras" @@ -37,12 +41,13 @@ wheel.exclude = ["include", "lib*/", "bin", "LICENSE.txt", "README.md"] # Files to include in the SDist even if they are skipped by default. Supports # gitignore syntax. sdist.include = [ - "highspy-extras/*", - "LICENSE", + "LICENSE.txt", "README.md", "THIRD_PARTY_NOTICES.md", "extern", "cmake", + "Version.txt", + "highs/HConfig.h.in" ] sdist.exclude = [ @@ -65,24 +70,42 @@ sdist.exclude = [ "WORKSPACE", "nuget/", "nuget/README.md", - "highs/*.bazel*", - "highs/*.meson*", "interfaces/*csharp*", "interfaces/*fortran*", "flake.*", "highs.pc.in", ] -[tool.scikit-build.cmake.define] -BUILD_OPENBLAS = "ON" - -[[tool.scikit-build.overrides]] -if.platform-system = "darwin" -cmake.define.BUILD_OPENBLAS = "OFF" - [tool.cibuildwheel] build = "*" archs = ["auto64", "auto32"] repair-wheel-command = "" +build-verbosity = 1 + +# All github runners have vcpkg pre-installed +# Assume either VCPKG_ROOT xor VCPKG_INSTALLATION_ROOT is defined +environment-pass = ["VCPKG_ROOT", "VCPKG_INSTALLATION_ROOT", "VCPKG_DEFAULT_BINARY_CACHE", "VCPKG_COMMIT"] + +[tool.cibuildwheel.linux] +before-all = "yum install -y zip unzip" +environment = { VCPKG_ROOT = "/host$VCPKG_ROOT$VCPKG_INSTALLATION_ROOT", VCPKG_DEFAULT_BINARY_CACHE = "/host$VCPKG_DEFAULT_BINARY_CACHE" } + +# cannot use host vcpkg on i686 and musllinux — install vcpkg inside the +# container once via before-all; the binary cache avoids rebuilding OpenBLAS +# for each Python version. +[[tool.cibuildwheel.overrides]] +select = "*-manylinux_i686" +inherit.environment = "none" +before-all = "yum install -y zip unzip ninja-build cmake && export LDFLAGS=\"${LDFLAGS:-} -ldl\" && git clone https://github.com/microsoft/vcpkg.git /opt/vcpkg && if [ -n \"$VCPKG_COMMIT\" ]; then git -C /opt/vcpkg checkout $VCPKG_COMMIT; fi && /opt/vcpkg/bootstrap-vcpkg.sh -disableMetrics" +environment = { VCPKG_ROOT = "/opt/vcpkg", VCPKG_FORCE_SYSTEM_BINARIES = "1" } + +# Disable DLSYM in vcpkg bootstrap so it uses system curl-dev headers; +# the FetchContent'd curl 7.55.1 headers lack proper musl/aarch64 support. +[[tool.cibuildwheel.overrides]] +select = "*-musllinux_*" +inherit.environment = "none" +before-all = "apk add --no-cache zip unzip curl curl-dev build-base linux-headers perl ninja cmake && git clone https://github.com/microsoft/vcpkg.git /opt/vcpkg && if [ -n \"$VCPKG_COMMIT\" ]; then git -C /opt/vcpkg checkout $VCPKG_COMMIT; fi && sed -i '/cmakeConfigOptions=/s/\"$/ -DVCPKG_LIBCURL_DLSYM=OFF\"/' /opt/vcpkg/scripts/bootstrap.sh && /opt/vcpkg/bootstrap-vcpkg.sh -disableMetrics" +environment = { VCPKG_ROOT = "/opt/vcpkg", VCPKG_FORCE_SYSTEM_BINARIES = "1" } -build-verbosity = 1 \ No newline at end of file +[tool.cibuildwheel.windows] +environment = { VCPKG_ROOT = "$VCPKG_ROOT$VCPKG_INSTALLATION_ROOT" } \ No newline at end of file diff --git a/highspy/CMakeLists.txt b/highspy/CMakeLists.txt index f6cc2fda7a..2cdf7a659f 100644 --- a/highspy/CMakeLists.txt +++ b/highspy/CMakeLists.txt @@ -41,7 +41,7 @@ set_target_properties(_core PROPERTIES target_compile_definitions(_core PRIVATE VERSION_INFO=${PROJECT_VERSION}) -if (${BUILD_SHARED_EXTRAS_LIB}) +if (BUILD_SHARED_EXTRAS_LIB) target_compile_definitions(_core PRIVATE HIGHS_SHARED_EXTRAS_LIBRARY) else() target_link_libraries(_core PRIVATE highs_extras) @@ -62,11 +62,13 @@ endif() # The install directory is the output (wheel) directory install(TARGETS _core RUNTIME DESTINATION highspy - LIBRARY DESTINATION highspy) + LIBRARY DESTINATION highspy + COMPONENT python) # Only needed if the wheel is built with a shared library, but can be left in for static linking as well. # Include highs library (but ignore .lib file) install(TARGETS highs RUNTIME DESTINATION highspy LIBRARY DESTINATION highspy - NAMELINK_SKIP) + NAMELINK_SKIP + COMPONENT python) diff --git a/highspy/highs_bindings.cpp b/highspy/highs_bindings.cpp index 52045a48c7..9f6d105d3b 100644 --- a/highspy/highs_bindings.cpp +++ b/highspy/highs_bindings.cpp @@ -20,25 +20,7 @@ std::string get_parent_directory(const std::string& path) { if (pos == 0) return path.substr(0, 1); return path.substr(0, pos); } - -std::string join_paths(const std::string& base, const std::string& leaf) { - if (base.empty()) return leaf; - if (leaf.empty()) return base; - - const char last = base.back(); - const char first = leaf.front(); - const bool base_has_sep = last == '/' || last == '\\'; - const bool leaf_has_sep = first == '/' || first == '\\'; - - if (base_has_sep && leaf_has_sep) return base + leaf.substr(1); - if (base_has_sep || leaf_has_sep) return base + leaf; -#ifdef _WIN32 - return base + "\\" + leaf; -#else - return base + "/" + leaf; -#endif } -} // namespace // arrays are assumed to be contiguous c-style arrays of correct type // * c_style forces the array to be stored in C-style contiguous order @@ -1012,21 +994,10 @@ std::string highs_locatePythonPackage(const std::string module_name) { } PYBIND11_MODULE(_core, m, py::mod_gil_not_used()) { - auto extras_module = highs_locatePythonPackage("highspy_extras"); + HighsExternalDeps::tryLoad(highs_locatePythonPackage("highspy_extras")); - if (!extras_module.empty()) { - bool loaded = HighsExternalDeps::tryLoad(extras_module); - - /// TODO: Remove DEBUG prints - if (loaded) { - py::print("Successfully loaded highs extras"); - } else { - py::print("Failed to load highs extras; skipping optional DLL preload"); - py::print(HighsExternalDeps::getLastError()); - } - } else { - py::print("highs extras not available; skipping optional DLL preload"); - } + // static function to get the load status of the extras library + m.def("getExtrasLoadStatus", &HighsExternalDeps::getLoadStatus); // To keep a smaller diff, for reviewers, the declarations are not moved, but // keep in mind: diff --git a/pyproject.toml b/pyproject.toml index 38961479b0..7ad6fa0476 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -93,8 +93,11 @@ sdist.exclude = [ # # exclude files from CMake output as well. Editable installs may not respect # # this exclusion. wheel.exclude = ["include", "share", "lib*/", "bin", "LICENSE.txt", "README.md"] +install.components = ["python"] [tool.scikit-build.cmake.define] +# Allows the HiPO IpxWrapper link to be compiled +HIPO = "ON" HIPO_PYTHON = "ON" [tool.pytest.ini_options] @@ -113,6 +116,9 @@ archs = ["auto64", "auto32"] # Enable free-threaded support enable = ["cpython-freethreading"] +# highspy does not need vcpkg dependencies (avoid unnecessary compile) +environment = { VCPKG_ROOT = "", VCPKG_INSTALLATION_ROOT = "" } + test-command = "pytest {project}/highspy/tests" test-extras = ["test", "numpy"] build-verbosity = 1