diff --git a/.github/julia/build_tarballs.jl b/.github/julia/build_tarballs.jl index 655e6968d26..c930506a614 100644 --- a/.github/julia/build_tarballs.jl +++ b/.github/julia/build_tarballs.jl @@ -33,7 +33,10 @@ cmake -DCMAKE_INSTALL_PREFIX=${prefix} \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=${BUILD_SHARED} \ -DZLIB_USE_STATIC_LIBS=${BUILD_STATIC} \ - -DFAST_BUILD=ON .. + -DHIPO=ON \ + -DBLAS_ROOT="${prefix}" \ + -DMETIS_ROOT=${prefix} \ + .. if [[ "${target}" == *-linux-* ]]; then make -j ${nproc} @@ -60,6 +63,8 @@ platforms = expand_cxxstring_abis(platforms) dependencies = [ Dependency("CompilerSupportLibraries_jll"), Dependency("Zlib_jll"), + Dependency("METIS_jll"), + Dependency("OpenBLAS32_jll"), HostBuildDependency(PackageSpec(; name="CMake_jll")), ] diff --git a/.github/workflows/hipo-macos.yml b/.github/workflows/hipo-macos.yml index 317993b99ea..b231f718ed6 100644 --- a/.github/workflows/hipo-macos.yml +++ b/.github/workflows/hipo-macos.yml @@ -13,18 +13,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Checkout GKlib - uses: actions/checkout@v4 - with: - repository: KarypisLab/GKlib - ref: master - path: GKlib - - name: Checkout METIS uses: actions/checkout@v4 with: - repository: KarypisLab/METIS - ref: master + repository: galabovaa/METIS + ref: 510-w path: METIS - name: Create installs dir @@ -33,21 +26,15 @@ jobs: mkdir installs ls - - name: Install GKLIB - run: | - cd GKlib - make config prefix=${{runner.workspace}}/installs - make - make install - - name: Install METIS run: | cd METIS - make config prefix=${{runner.workspace}}/installs - make - make install + pwd + cmake -S. -B build -DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/installs + cmake --build build --parallel --config Release + cmake --install build - - name: Check METIS and GKlib + - name: Check METIS working-directory: ${{runner.workspace}} run: | cd installs @@ -61,8 +48,7 @@ jobs: working-directory: ${{runner.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON \ - -DMETIS_ROOT=${{runner.workspace}}/installs \ - -DGKLIB_ROOT=${{runner.workspace}}/installs + -DMETIS_ROOT=${{runner.workspace}}/installs - name: Build working-directory: ${{runner.workspace}}/build @@ -88,18 +74,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Checkout GKlib - uses: actions/checkout@v4 - with: - repository: KarypisLab/GKlib - ref: master - path: GKlib - - name: Checkout METIS uses: actions/checkout@v4 with: - repository: KarypisLab/METIS - ref: master + repository: galabovaa/METIS + ref: 510-w path: METIS - name: Create installs dir @@ -108,21 +87,15 @@ jobs: mkdir installs ls - - name: Install GKLIB - run: | - cd GKlib - make config prefix=${{runner.workspace}}/installs - make - make install - - name: Install METIS run: | cd METIS - make config prefix=${{runner.workspace}}/installs - make - make install + pwd + cmake -S. -B build -DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/installs + cmake --build build --parallel --config Debug + cmake --install build - - name: Check METIS and GKlib + - name: Check METIS working-directory: ${{runner.workspace}} run: | cd installs @@ -137,7 +110,6 @@ jobs: run: | cmake $GITHUB_WORKSPACE -DHIPO=ON \ -DMETIS_ROOT=${{runner.workspace}}/installs \ - -DGKLIB_ROOT=${{runner.workspace}}/installs \ -DCMAKE_BUILD_TYPE=Debug - name: Build @@ -164,18 +136,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Checkout GKlib - uses: actions/checkout@v4 - with: - repository: KarypisLab/GKlib - ref: master - path: GKlib - - name: Checkout METIS uses: actions/checkout@v4 with: - repository: KarypisLab/METIS - ref: master + repository: galabovaa/METIS + ref: 510-w path: METIS - name: Create installs dir @@ -184,21 +149,15 @@ jobs: mkdir installs ls - - name: Install GKLIB - run: | - cd GKlib - make config prefix=${{runner.workspace}}/installs - make - make install - - name: Install METIS run: | cd METIS - make config prefix=${{runner.workspace}}/installs - make - make install + pwd + cmake -S. -B build -DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/installs + cmake --build build --parallel --config Release + cmake --install build - - name: Check METIS and GKlib + - name: Check METIS working-directory: ${{runner.workspace}} run: | cd installs @@ -212,8 +171,7 @@ jobs: working-directory: ${{runner.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON -DALL_TESTS=ON \ - -DMETIS_ROOT=${{runner.workspace}}/installs \ - -DGKLIB_ROOT=${{runner.workspace}}/installs + -DMETIS_ROOT=${{runner.workspace}}/installs - name: Build working-directory: ${{runner.workspace}}/build @@ -239,18 +197,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Checkout GKlib - uses: actions/checkout@v4 - with: - repository: KarypisLab/GKlib - ref: master - path: GKlib - - name: Checkout METIS uses: actions/checkout@v4 with: - repository: KarypisLab/METIS - ref: master + repository: galabovaa/METIS + ref: 510-w path: METIS - name: Create installs dir @@ -259,21 +210,15 @@ jobs: mkdir installs ls - - name: Install GKLIB - run: | - cd GKlib - make config prefix=${{runner.workspace}}/installs - make - make install - - name: Install METIS run: | cd METIS - make config prefix=${{runner.workspace}}/installs - make - make install + pwd + cmake -S. -B build -DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/installs + cmake --build build --parallel --config Debug + cmake --install build - - name: Check METIS and GKlib + - name: Check METIS working-directory: ${{runner.workspace}} run: | cd installs @@ -288,7 +233,6 @@ jobs: run: | cmake $GITHUB_WORKSPACE -DHIPO=ON -DALL_TESTS=ON \ -DMETIS_ROOT=${{runner.workspace}}/installs \ - -DGKLIB_ROOT=${{runner.workspace}}/installs \ -DCMAKE_BUILD_TYPE=Debug - name: Build diff --git a/.github/workflows/hipo-ubuntu.yml b/.github/workflows/hipo-ubuntu.yml index de9cdafc396..fe09bea77e8 100644 --- a/.github/workflows/hipo-ubuntu.yml +++ b/.github/workflows/hipo-ubuntu.yml @@ -13,18 +13,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Checkout GKlib - uses: actions/checkout@v4 - with: - repository: KarypisLab/GKlib - ref: master - path: GKlib - - name: Checkout METIS uses: actions/checkout@v4 with: - repository: KarypisLab/METIS - ref: master + repository: galabovaa/METIS + ref: 510-w path: METIS - name: Create installs dir @@ -33,34 +26,13 @@ jobs: mkdir installs ls - - name: Install GKLIB - run: | - cd GKlib - make config shared=1 prefix=${{runner.workspace}}/installs - make - make install - - # - name: Check installs - # working-directory: ${{runner.workspace}} - # run: | - # cd installs - # ls - # ls lib - - - name: Copy GKlib shared (bug) - working-directory: ${{runner.workspace}} - run: | - cd installs - cd lib - ln libGKlib.so.0 libGKlib.so - ls - - name: Install METIS run: | cd METIS - make config shared=1 prefix=${{runner.workspace}}/installs - make - make install + pwd + cmake -S. -B build -DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/installs + cmake --build build --parallel --config Release + cmake --install build # no default blas available on runner @@ -85,8 +57,7 @@ jobs: working-directory: ${{runner.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON \ - -DMETIS_ROOT=${{runner.workspace}}/installs \ - -DGKLIB_ROOT=${{runner.workspace}}/installs + -DMETIS_ROOT=${{runner.workspace}}/installs - name: Build working-directory: ${{runner.workspace}}/build @@ -112,18 +83,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Checkout GKlib - uses: actions/checkout@v4 - with: - repository: KarypisLab/GKlib - ref: master - path: GKlib - - name: Checkout METIS uses: actions/checkout@v4 with: - repository: KarypisLab/METIS - ref: master + repository: galabovaa/METIS + ref: 510-w path: METIS - name: Create installs dir @@ -132,28 +96,14 @@ jobs: mkdir installs ls - - name: Install GKLIB - run: | - cd GKlib - make config shared=1 prefix=${{runner.workspace}}/installs - make - make install - - - name: Copy GKlib shared (bug) - working-directory: ${{runner.workspace}} - run: | - cd installs - cd lib - ln libGKlib.so.0 libGKlib.so - ls - - name: Install METIS shell: bash run: | cd METIS - make config shared=1 prefix=${{runner.workspace}}/installs - make - make install + pwd + cmake -S. -B build -DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/installs + cmake --build build --parallel --config Debug + cmake --install build - name: Cache APT packages uses: actions/cache@v4 @@ -177,7 +127,6 @@ jobs: run: | cmake $GITHUB_WORKSPACE -DHIPO=ON \ -DMETIS_ROOT=${{runner.workspace}}/installs \ - -DGKLIB_ROOT=${{runner.workspace}}/installs \ -DCMAKE_BUILD_TYPE=Debug - name: Build @@ -204,18 +153,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Checkout GKlib - uses: actions/checkout@v4 - with: - repository: KarypisLab/GKlib - ref: master - path: GKlib - - name: Checkout METIS uses: actions/checkout@v4 with: - repository: KarypisLab/METIS - ref: master + repository: galabovaa/METIS + ref: 510-w path: METIS - name: Create installs dir @@ -224,34 +166,13 @@ jobs: mkdir installs ls - - name: Install GKLIB - run: | - cd GKlib - make config shared=1 prefix=${{runner.workspace}}/installs - make - make install - - # - name: Check installs - # working-directory: ${{runner.workspace}} - # run: | - # cd installs - # ls - # ls lib - - - name: Copy GKlib shared (bug) - working-directory: ${{runner.workspace}} - run: | - cd installs - cd lib - ln libGKlib.so.0 libGKlib.so - ls - - name: Install METIS run: | cd METIS - make config shared=1 prefix=${{runner.workspace}}/installs - make - make install + pwd + cmake -S. -B build -DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/installs + cmake --build build --parallel --config Release + cmake --install build # no default blas available on runner @@ -276,8 +197,7 @@ jobs: working-directory: ${{runner.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON -DALL_TESTS=ON \ - -DMETIS_ROOT=${{runner.workspace}}/installs \ - -DGKLIB_ROOT=${{runner.workspace}}/installs + -DMETIS_ROOT=${{runner.workspace}}/installs - name: Build working-directory: ${{runner.workspace}}/build @@ -303,18 +223,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Checkout GKlib - uses: actions/checkout@v4 - with: - repository: KarypisLab/GKlib - ref: master - path: GKlib - - name: Checkout METIS uses: actions/checkout@v4 with: - repository: KarypisLab/METIS - ref: master + repository: galabovaa/METIS + ref: 510-w path: METIS - name: Create installs dir @@ -323,28 +236,13 @@ jobs: mkdir installs ls - - name: Install GKLIB - run: | - cd GKlib - make config shared=1 prefix=${{runner.workspace}}/installs - make - make install - - - name: Copy GKlib shared (bug) - working-directory: ${{runner.workspace}} - run: | - cd installs - cd lib - ln libGKlib.so.0 libGKlib.so - ls - - name: Install METIS - shell: bash run: | cd METIS - make config shared=1 prefix=${{runner.workspace}}/installs - make - make install + pwd + cmake -S. -B build -DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/installs + cmake --build build --parallel --config Debug + cmake --install build - name: Cache APT packages uses: actions/cache@v4 @@ -368,7 +266,6 @@ jobs: run: | cmake $GITHUB_WORKSPACE -DHIPO=ON -DALL_TESTS=ON \ -DMETIS_ROOT=${{runner.workspace}}/installs \ - -DGKLIB_ROOT=${{runner.workspace}}/installs \ -DCMAKE_BUILD_TYPE=Debug - name: Build diff --git a/.github/workflows/hipo-win.yml b/.github/workflows/hipo-win.yml index 3844c014914..d816d374ac0 100644 --- a/.github/workflows/hipo-win.yml +++ b/.github/workflows/hipo-win.yml @@ -13,33 +13,32 @@ jobs: steps: - uses: actions/checkout@v4 - # 2. Set up caching for vcpkg - - name: Cache vcpkg - uses: actions/cache@v3 + - name: Checkout METIS + uses: actions/checkout@v4 with: - path: | - ./vcpkg/installed - ./vcpkg/downloads - key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }} - restore-keys: | - vcpkg-${{ runner.os }}- + repository: galabovaa/METIS + ref: 510-w + path: METIS - # - name: Install GKlib - # run: vcpkg install gklib - - # - name: ls - # run: ls C:/vcpkg/packages/gklib_x64-windows/share/gklib + - name: Create installs dir + working-directory: ${{runner.workspace}} + run: | + ls + mkdir installs + ls - name: Install METIS - run: vcpkg install metis - - # run: ls C:/vcpkg/packages/metis_x64-windows/ - # run: ls C:/vcpkg/packages/metis_x64-windows/lib - # run: ls C:/vcpkg/packages/metis_x64-windows/share - # run: ls C:/vcpkg/packages/gklib_x64-windows/share/gklib + shell: bash + run: | + INSTALLS_PREFIX=$(cygpath "${{ runner.workspace }}")/installs + cd METIS + pwd + cmake -S. -B build -DGKLIB_PATH=$GITHUB_WORKSPACE/METIS/GKlib -DCMAKE_INSTALL_PREFIX=$INSTALLS_PREFIX + cmake --build build --parallel --config Release + cmake --install build --config Release - name: Install OpenBLAS - run: vcpkg install openblas + run: vcpkg install openblas[threads] - name: Create build dir run: cmake -E make_directory ${{runner.workspace}}/build @@ -48,11 +47,11 @@ jobs: shell: bash working-directory: ${{runner.workspace}}/build run: | + METIS_ROOT=$(cygpath "${{ runner.workspace }}")/installs cmake $GITHUB_WORKSPACE \ -DHIPO=ON \ - -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake - - # -DCMAKE_CXX_FLAGS="-I C:/vcpkg/packages/gklib_x64-windows/include/GKlib" + -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake \ + -DMETIS_ROOT=$METIS_ROOT - name: Build shell: bash @@ -81,22 +80,32 @@ jobs: steps: - uses: actions/checkout@v4 - # 2. Set up caching for vcpkg - - name: Cache vcpkg - uses: actions/cache@v3 + - name: Checkout METIS + uses: actions/checkout@v4 with: - path: | - ./vcpkg/installed - ./vcpkg/downloads - key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }} - restore-keys: | - vcpkg-${{ runner.os }}- + repository: galabovaa/METIS + ref: 510-w + path: METIS + + - name: Create installs dir + working-directory: ${{runner.workspace}} + run: | + ls + mkdir installs + ls - name: Install METIS - run: vcpkg install metis + shell: bash + run: | + INSTALLS_PREFIX=$(cygpath "${{ runner.workspace }}")/installs + cd METIS + pwd + cmake -S. -B build -DGKLIB_PATH=$GITHUB_WORKSPACE/METIS/GKlib -DCMAKE_INSTALL_PREFIX=$INSTALLS_PREFIX + cmake --build build --parallel --config Debug + cmake --install build --config Debug - name: Install OpenBLAS - run: vcpkg install openblas + run: vcpkg install openblas[threads] - name: Create build dir run: cmake -E make_directory ${{runner.workspace}}/build @@ -105,9 +114,11 @@ jobs: shell: bash working-directory: ${{runner.workspace}}/build run: | + METIS_ROOT=$(cygpath "${{ runner.workspace }}")/installs cmake $GITHUB_WORKSPACE \ -DHIPO=ON \ - -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake + -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake \ + -DMETIS_ROOT=$METIS_ROOT - name: Build shell: bash @@ -136,22 +147,32 @@ jobs: steps: - uses: actions/checkout@v4 - # 2. Set up caching for vcpkg - - name: Cache vcpkg - uses: actions/cache@v3 + - name: Checkout METIS + uses: actions/checkout@v4 with: - path: | - ./vcpkg/installed - ./vcpkg/downloads - key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }} - restore-keys: | - vcpkg-${{ runner.os }}- + repository: galabovaa/METIS + ref: 510-w + path: METIS + + - name: Create installs dir + working-directory: ${{runner.workspace}} + run: | + ls + mkdir installs + ls - name: Install METIS - run: vcpkg install metis + shell: bash + run: | + INSTALLS_PREFIX=$(cygpath "${{ runner.workspace }}")/installs + cd METIS + pwd + cmake -S. -B build -DGKLIB_PATH=$GITHUB_WORKSPACE/METIS/GKlib -DCMAKE_INSTALL_PREFIX=$INSTALLS_PREFIX + cmake --build build --parallel --config Release + cmake --install build --config Release - name: Install OpenBLAS - run: vcpkg install openblas + run: vcpkg install openblas[threads] - name: Create build dir run: cmake -E make_directory ${{runner.workspace}}/build @@ -160,10 +181,12 @@ jobs: shell: bash working-directory: ${{runner.workspace}}/build run: | + METIS_ROOT=$(cygpath "${{ runner.workspace }}")/installs cmake $GITHUB_WORKSPACE \ -DHIPO=ON \ -DALL_TESTS=ON \ - -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake + -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake \ + -DMETIS_ROOT=$METIS_ROOT - name: Build shell: bash @@ -192,22 +215,32 @@ jobs: steps: - uses: actions/checkout@v4 - # 2. Set up caching for vcpkg - - name: Cache vcpkg - uses: actions/cache@v3 + - name: Checkout METIS + uses: actions/checkout@v4 with: - path: | - ./vcpkg/installed - ./vcpkg/downloads - key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }} - restore-keys: | - vcpkg-${{ runner.os }}- + repository: galabovaa/METIS + ref: 510-w + path: METIS + + - name: Create installs dir + working-directory: ${{runner.workspace}} + run: | + ls + mkdir installs + ls - name: Install METIS - run: vcpkg install metis + shell: bash + run: | + INSTALLS_PREFIX=$(cygpath "${{ runner.workspace }}")/installs + cd METIS + pwd + cmake -S. -B build -DGKLIB_PATH=$GITHUB_WORKSPACE/METIS/GKlib -DCMAKE_INSTALL_PREFIX=$INSTALLS_PREFIX + cmake --build build --parallel --config Debug + cmake --install build --config Debug - name: Install OpenBLAS - run: vcpkg install openblas + run: vcpkg install openblas[threads] - name: Create build dir run: cmake -E make_directory ${{runner.workspace}}/build @@ -216,10 +249,12 @@ jobs: shell: bash working-directory: ${{runner.workspace}}/build run: | + METIS_ROOT=$(cygpath "${{ runner.workspace }}")/installs cmake $GITHUB_WORKSPACE \ -DHIPO=ON \ -DALL_TESTS=ON \ - -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake + -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake \ + -DMETIS_ROOT=$METIS_ROOT - name: Build shell: bash diff --git a/.github/workflows/julia-tests-ubuntu.yml b/.github/workflows/julia-tests-ubuntu.yml deleted file mode 100644 index 357c877e989..00000000000 --- a/.github/workflows/julia-tests-ubuntu.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: JuliaCompileAndTest -on: - push: - branches: [master, latest] - pull_request: - types: [opened, synchronize, ready_for_review, reopened] -# needed to allow julia-actions/cache to delete old caches that it has created -permissions: - actions: write - contents: read -jobs: - test: - name: Julia - ${{ github.event_name }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - # Install Julia 1.7 for BinaryBuilder. Note that this is an old version of - # Julia, but it is required for compatibility with BinaryBuilder. - - uses: julia-actions/setup-julia@v2 - with: - version: "1.7" - arch: x64 - - uses: julia-actions/cache@v2 - # Set the environment variables required by BinaryBuilder. - - run: | - git fetch --tags - echo "HIGHS_RELEASE=$(git describe --tags $(git rev-list --tags --max-count=1) | sed 's/^v//')" >> $GITHUB_ENV - if [ "${{ github.event_name }}" = "pull_request" ]; then - echo "HIGHS_COMMIT=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV - echo "HIGHS_URL=${{ github.event.pull_request.head.repo.clone_url }}" >> $GITHUB_ENV - else - echo "HIGHS_COMMIT=${{ github.sha }}" >> $GITHUB_ENV - echo "HIGHS_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV - fi - - run: | - julia --color=yes -e 'using Pkg; Pkg.add("BinaryBuilder")' - julia --color=yes .github/julia/build_tarballs.jl x86_64-linux-gnu-cxx11 --verbose --deploy="local" - # Now install a newer version of Julia to actually test HiGHS_jll. We - # choose v1.10 because it is the current Long-Term Support (LTS). - - uses: julia-actions/setup-julia@v2 - with: - version: "1.10" - arch: x64 - # We want to install the latest version of HiGHS.jl, but we also want it - # to be compatible with our newly compiled HiGHS_jll. To do so, we - # manually edit HiGHS.jl's Project.toml file to allow any v1.X.Y version - # of HiGHS_jll - - shell: julia --color=yes {0} - run: | - using Pkg - Pkg.develop("HiGHS") - project_filename = "/home/runner/.julia/dev/HiGHS/Project.toml" - project = read(project_filename, String) - write( - project_filename, - replace(project, r"HiGHS_jll = \"=.+?\"" => "HiGHS_jll = \"1\""), - ) - # Now we can add HiGHS_jll and run the tests for HiGHS. - - shell: julia --color=yes {0} - run: | - using Pkg - Pkg.develop(; path="/home/runner/.julia/dev/HiGHS_jll") - Pkg.test("HiGHS") diff --git a/.github/workflows/julia-tests.yml b/.github/workflows/julia-tests.yml new file mode 100644 index 00000000000..496b4281dd2 --- /dev/null +++ b/.github/workflows/julia-tests.yml @@ -0,0 +1,116 @@ +name: JuliaCompileAndTest +on: + push: + branches: [master, latest] + pull_request: + types: [opened, synchronize, ready_for_review, reopened] +# needed to allow julia-actions/cache to delete old caches that it has created +permissions: + actions: write + contents: read +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + triplet: ['x86_64-linux-gnu-cxx11', 'aarch64-apple-darwin', 'x86_64-w64-mingw32-cxx11'] + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 + with: + version: "1.7" + arch: x64 + - uses: julia-actions/cache@v2 + - run: | + git fetch --tags + echo "HIGHS_RELEASE=$(git describe --tags $(git rev-list --tags --max-count=1) | sed 's/^v//')" >> $GITHUB_ENV + if [ "${{ github.event_name }}" = "pull_request" ]; then + echo "HIGHS_COMMIT=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV + echo "HIGHS_URL=${{ github.event.pull_request.head.repo.clone_url }}" >> $GITHUB_ENV + else + echo "HIGHS_COMMIT=${{ github.sha }}" >> $GITHUB_ENV + echo "HIGHS_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV + fi + - run: | + julia --color=yes -e 'using Pkg; Pkg.add("BinaryBuilder")' + julia --color=yes .github/julia/build_tarballs.jl ${{ matrix.triplet }} --verbose --deploy="local" + env: + BINARYBUILDER_AUTOMATIC_APPLE: true + - uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.triplet }} + path: ${{ github.workspace }}/products/* + - uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.triplet }}-jll + path: /home/runner/.julia/dev/HiGHS_jll + test: + runs-on: ${{ matrix.os }} + needs: build + strategy: + fail-fast: false + matrix: + include: + - triplet: 'x86_64-linux-gnu-cxx11' + os: 'ubuntu-latest' + arch: x64 + - triplet: 'aarch64-apple-darwin' + os: 'macos-14' + arch: aarch64 + - triplet: 'x86_64-w64-mingw32-cxx11' + os: 'windows-latest' + arch: x64 + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 + with: + version: "1.10" + arch: ${{ matrix.arch }} + # Download and setup the artifact + - uses: actions/download-artifact@v4 + with: + name: ${{ matrix.triplet }} + path: ${{ github.workspace }}/products + - shell: bash + run: tar -xzf products/HiGHS.*.${{ matrix.triplet }}.tar.gz -C products + # We also need to download the JLL package, because it contains the new + # dependencies + - uses: actions/download-artifact@v4 + with: + name: ${{ matrix.triplet }}-jll + path: ${{ github.workspace }}/HiGHS_jll + # We need to update the [compat] section in HiGHS to support HiGHS_jll + - shell: julia --color=yes {0} + run: | + using Pkg + Pkg.develop("HiGHS") + project_filename = joinpath(Pkg.devdir(), "HiGHS", "Project.toml") + project = read(project_filename, String) + write( + project_filename, + replace(project, r"HiGHS_jll = \"=.+?\"" => "HiGHS_jll = \"1\""), + ) + # Now we need to update the Artifacts.toml in the HiGHS_jll that we've + # downloaded. Otherwise Julia will try to download the default on install. + - shell: julia --color=yes {0} + run: | + import Pkg + file = joinpath(ENV["GITHUB_WORKSPACE"], "HiGHS_jll", "Artifacts.toml") + m = match(r"git-tree-sha1 = \"(.+?)\"", read(file, String)) + dir = escape_string(joinpath(ENV["GITHUB_WORKSPACE"], "products")) + write( + joinpath(homedir(), ".julia", "artifacts", "Overrides.toml"), + "$(m[1]) = \"$(dir)\"\n", + ) + Pkg.develop(; path = joinpath(ENV["GITHUB_WORKSPACE"], "HiGHS_jll")) + - shell: julia --color=yes {0} + run: | + import HiGHS_jll + file = joinpath(ENV["GITHUB_WORKSPACE"], "check", "instances", "flugpl.mps") + run(`$(HiGHS_jll.highs()) --solver=hipo $file`) + run(`$(HiGHS_jll.highs()) $file`) + - shell: julia --color=yes {0} + run: | + using Pkg + Pkg.test("HiGHS") diff --git a/cmake/FindHipoDeps.cmake b/cmake/FindHipoDeps.cmake index bd7cf6bcf4c..6c9d457c045 100644 --- a/cmake/FindHipoDeps.cmake +++ b/cmake/FindHipoDeps.cmake @@ -1,17 +1,10 @@ # BLAS -option(BLAS_ROOT "Root directory of BLAS or OpenBLAS" "") +set(BLAS_ROOT "" CACHE STRING "Root directory of BLAS or OpenBLAS") message(STATUS "BLAS_ROOT is " ${BLAS_ROOT}) if (WIN32) - find_package(OpenBLAS CONFIG REQUIRED) message(STATUS "OpenBLAS CMake config path: ${OpenBLAS_DIR}") - - find_package(metis CONFIG REQUIRED) - message(STATUS "metis CMake config path: ${metis_DIR}") - - # find_package(gklib CONFIG REQUIRED) - # message(STATUS "gklib CMake config path: ${gklib_DIR}") elseif(NOT APPLE) # LINUX find_library(OPENBLAS_LIB @@ -31,43 +24,73 @@ elseif(NOT APPLE) endif(NOT BLAS_LIB) message("Found BLAS library at ${BLAS_LIB}") endif(OPENBLAS_LIB) - endif() -if (NOT WIN32) - # Find_package works if deps are installed with vcpkg. +# METIS +set(METIS_ROOT "" CACHE STRING "Root directory of METIS") +message(STATUS "METIS_ROOT is " ${METIS_ROOT}) - # METIS - option(METIS_ROOT "Root directory of METIS" "") - message(STATUS "METIS_ROOT is " ${METIS_ROOT}) +find_package(metis CONFIG) - find_path(METIS_PATH - NAMES "metis.h" +if(metis_FOUND) + message(STATUS "metis CMake config path: ${metis_DIR}") +else() + find_path(METIS_PATH + NAMES "metis.h" REQUIRED - HINTS "${METIS_ROOT}/include") + PATHS "${METIS_ROOT}/include" + NO_DEFAULT_PATH) message("Found Metis header at ${METIS_PATH}") - find_library(METIS_LIB - NAMES metis + find_library(METIS_LIB + NAMES metis libmetis REQUIRED - HINTS "${METIS_ROOT}/lib") + PATHS "${METIS_ROOT}/lib" "${METIS_ROOT}/bin" + NO_DEFAULT_PATH) + message("Found Metis library at ${METIS_LIB}") +endif() - # GKlib - option(GKLIB_ROOT "Root directory of GKlib" "") +# GKlib optional for newer versions on ubuntu and macos +set(GKLIB_ROOT "" CACHE STRING "Root directory of GKlib") +if (NOT (GKLIB_ROOT STREQUAL "")) message(STATUS "GKLIB_ROOT is " ${GKLIB_ROOT}) - find_path(GKLIB_PATH - NAMES "GKlib.h" REQUIRED - HINTS "${GKLIB_ROOT}/include") - - message("Found GKlib header at ${GKLIB_PATH}") - - find_library(GKLIB_LIB - NAMES GKlib - REQUIRED - HINTS "${GKLIB_ROOT}/lib") - - message("Found GKlib library at ${GKLIB_LIB}") + find_package(GKlib CONFIG) + + if(GKlib_FOUND) + message(STATUS "gklib CMake config path: ${GKlib_DIR}") + + # get_cmake_property(_vars VARIABLES) + # foreach(_v IN LISTS _vars) + # if(_v MATCHES "GKlib") + # message(STATUS "${_v} = ${${_v}}") + # endif() + # endforeach() + + # get_property(_targets DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY IMPORTED_TARGETS) + # foreach(_t IN LISTS _targets) + # if(_t MATCHES "GKlib") + # message(STATUS "GKlib exported target: ${_t}") + # endif() + # endforeach() + + else() + find_path(GKLIB_PATH + NAMES "gklib.h" + REQUIRED + PATHS "${GKLIB_ROOT}/include" + NO_DEFAULT_PATH) + + message("Found GKlib header at ${GKLIB_PATH}") + + find_library(GKLIB_LIB + NAMES GKlib libGKlib + REQUIRED + PATHS "${GKLIB_ROOT}/lib" + NO_DEFAULT_PATH) + + message("Found GKlib library at ${GKLIB_LIB}") + endif() endif() \ No newline at end of file diff --git a/highs/CMakeLists.txt b/highs/CMakeLists.txt index 6e922a0467d..a7dd54400ec 100644 --- a/highs/CMakeLists.txt +++ b/highs/CMakeLists.txt @@ -191,8 +191,7 @@ else() target_compile_definitions(highs PRIVATE HIPO_USES_APPLE_BLAS) elseif(WIN32) target_link_libraries(highs OpenBLAS::OpenBLAS) - target_link_libraries(highs metis) - # target_link_libraries(highs gklib) + target_compile_definitions(highs PRIVATE HIPO_USES_OPENBLAS) else() # LINUX if(BLAS_LIB) @@ -205,21 +204,23 @@ else() endif(BLAS_LIB) endif(APPLE) - if (NOT WIN32) - # Find_package works if deps are installed with vcpkg. - - # Metis + if(metis_FOUND) + target_link_libraries(highs metis) + else() target_include_directories(highs PRIVATE "${METIS_PATH}") target_link_libraries(highs "${METIS_LIB}") - - # GKlib - target_include_directories(highs PRIVATE "${GKLIB_PATH}") - target_link_libraries(highs "${GKLIB_LIB}") endif() + if (NOT (GKLIB_ROOT STREQUAL "")) + if(GKlib_FOUND) + target_link_libraries(highs GKlib::GKlib) + else() + target_include_directories(highs PRIVATE "${GKLIB_PATH}") + target_link_libraries(highs "${GKLIB_LIB}") + endif() + endif() endif() - if(MSVC) list(APPEND highs_compile_opts "/bigobj" # Allow big object