From 59961520589991e83bdac044ebecab1aff84b116 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Mon, 15 Jul 2024 10:33:02 +0000 Subject: [PATCH] Try and not build Boost after https://github.com/MICS-Lab/lincs/actions/runs/9937729967/job/27448692404#step:5:3681 --- .github/workflows/build-test-gha-branches.yml | 268 ++++++++++-------- 1 file changed, 150 insertions(+), 118 deletions(-) diff --git a/.github/workflows/build-test-gha-branches.yml b/.github/workflows/build-test-gha-branches.yml index deb3ba51..0ee09588 100644 --- a/.github/workflows/build-test-gha-branches.yml +++ b/.github/workflows/build-test-gha-branches.yml @@ -30,12 +30,7 @@ jobs: tar xf boost_*.tar.gz rm boost_*.tar.gz cd boost_* - echo "using python : ${{ matrix.python_version }} ;" >tools/build/src/user-config.jam - ./bootstrap.sh - ./b2 --with-python python=${{ matrix.python_version }} link=shared variant=release stage sudo cp -r boost /usr/local/include - sudo cp -r stage/lib/* /usr/local/lib - sudo ldconfig - name: Install OR-Tools run: | cd /home/runner/work @@ -68,129 +63,166 @@ jobs: - name: Check the wheel run: twine check dist/*.whl - build-for-windows: - runs-on: windows-2019 - strategy: - matrix: - python_version: ['3.8', '3.12'] - steps: - - name: Install Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python_version }} - - name: Install Python packages - run: pip install build delvewheel twine - - name: Install CUDA - uses: Jimver/cuda-toolkit@v0.2.14 - id: cuda-toolkit - with: - cuda: '12.1.0' - use-github-cache: false - use-local-cache: false - method: network - # Package names from https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html#id2 - sub-packages: '["nvcc", "cudart"]' - - name: Install MSys2 - uses: msys2/setup-msys2@v2 - with: - update: true - msystem: UCRT64 - install: >- - gzip - tar - unzip - wget - - name: Install boost - shell: msys2 {0} - run: | - cd /d/a - wget https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.tar.gz - tar xf boost_*.tar.gz - rm boost_*.tar.gz - mv boost_* boost - cd boost - echo "using python : ${{ matrix.python_version }} ;" >tools/build/src/user-config.jam - ./bootstrap.bat - ./b2 --with-python python=${{ matrix.python_version }} link=shared variant=release stage || true - mkdir -p /d/lincs-deps/include /d/lincs-deps/lib - cp -r boost /d/lincs-deps/include - cp -r stage/lib/* /d/lincs-deps/lib - - name: Install OR-Tools - shell: msys2 {0} - run: | - cd /d/a - wget https://github.com/google/or-tools/releases/download/v8.2/or-tools_VisualStudio2019-64bit_v8.2.8710.zip - unzip or-tools_*.zip - rm or-tools_*.zip - cd or-tools_* - cp -r include/* /d/lincs-deps/include - cp -r lib/* /d/lincs-deps/lib + # build-for-windows: + # runs-on: windows-2019 + # strategy: + # matrix: + # python_version: ['3.8', '3.12'] + # steps: + # - name: Install Python + # uses: actions/setup-python@v5 + # with: + # python-version: ${{ matrix.python_version }} + # - name: Install Python packages + # run: pip install build delvewheel twine + # - name: Install CUDA + # uses: Jimver/cuda-toolkit@v0.2.14 + # id: cuda-toolkit + # with: + # cuda: '12.1.0' + # use-github-cache: false + # use-local-cache: false + # method: network + # # Package names from https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html#id2 + # sub-packages: '["nvcc", "cudart"]' + # - name: Install MSys2 + # uses: msys2/setup-msys2@v2 + # with: + # update: true + # msystem: UCRT64 + # install: >- + # gzip + # tar + # unzip + # wget + # - name: Install boost + # shell: msys2 {0} + # run: | + # cd /d/a + # wget https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.tar.gz + # tar xf boost_*.tar.gz + # rm boost_*.tar.gz + # mv boost_* boost + # cd boost + # echo "using python : ${{ matrix.python_version }} ;" >tools/build/src/user-config.jam + # ./bootstrap.bat + # ./b2 --with-python python=${{ matrix.python_version }} link=shared variant=release stage || true + # mkdir -p /d/lincs-deps/include /d/lincs-deps/lib + # cp -r boost /d/lincs-deps/include + # cp -r stage/lib/* /d/lincs-deps/lib + # - name: Install OR-Tools + # shell: msys2 {0} + # run: | + # cd /d/a + # wget https://github.com/google/or-tools/releases/download/v8.2/or-tools_VisualStudio2019-64bit_v8.2.8710.zip + # unzip or-tools_*.zip + # rm or-tools_*.zip + # cd or-tools_* + # cp -r include/* /d/lincs-deps/include + # cp -r lib/* /d/lincs-deps/lib - - name: Get the code - uses: actions/checkout@v4 + # - name: Get the code + # uses: actions/checkout@v4 - - name: Build the wheel - run: python -m build --wheel --outdir local-dist - env: - LINCS_DEV_FORCE_NVCC: "true" - LINCS_DEV_DEPENDENCIES: d:\lincs-deps - LINCS_DEV_VC_VERSION: 142 - - name: Make the wheel machine-independent - run: delvewheel repair --strip (get-item local-dist\*.whl) --wheel-dir dist --add-path d:\lincs-deps\lib - - name: Check the wheel - run: twine check (get-item dist\*.whl) + # - name: Build the wheel + # run: python -m build --wheel --outdir local-dist + # env: + # LINCS_DEV_FORCE_NVCC: "true" + # LINCS_DEV_DEPENDENCIES: d:\lincs-deps + # LINCS_DEV_VC_VERSION: 142 + # - name: Make the wheel machine-independent + # run: delvewheel repair --strip (get-item local-dist\*.whl) --wheel-dir dist --add-path d:\lincs-deps\lib + # - name: Check the wheel + # run: twine check (get-item dist\*.whl) + + # build-for-macos: + # runs-on: macos-11 + # strategy: + # matrix: + # python_version: ['3.8', '3.12'] + # env: + # MACOSX_DEPLOYMENT_TARGET: 11.0 + # steps: + # - name: Install Python + # uses: actions/setup-python@v5 + # with: + # python-version: ${{ matrix.python_version }} + # - name: Install Python packages + # run: pip3 install build delocate twine + # - name: Install OpenMP + # run: | + # cd /Users/runner/work + # mkdir openmp + # cd openmp + # wget https://mac.r-project.org/openmp/openmp-10.0.0-darwin17-Release.tar.gz + # tar xf *.tar.gz + # sudo cp usr/local/lib/* /usr/local/lib + # sudo cp usr/local/include/* /usr/local/include + # - name: Install Boost + # run: | + # cd /Users/runner/work + # wget https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.tar.gz + # tar xf boost_*.tar.gz + # rm boost_*.tar.gz + # cd boost_* + # echo "using python : ${{ matrix.python_version }} ;" >tools/build/src/user-config.jam + # ./bootstrap.sh + # ./b2 --with-python python=${{ matrix.python_version }} link=shared variant=release stage + # sudo cp -r boost /usr/local/include + # sudo cp -r stage/lib/* /usr/local/lib + # - name: Install OR-Tools + # run: | + # cd /Users/runner/work + # wget https://github.com/google/or-tools/releases/download/v8.2/or-tools_MacOsX-11.2.1_v8.2.8710.tar.gz + # tar xf or-tools_*.tar.gz + # rm or-tools_*.tar.gz + # cd or-tools_* + # sudo cp -r include/* /usr/local/include + # sudo cp -r lib/* /usr/local/lib - build-for-macos: - runs-on: macos-11 + # - name: Get the code + # uses: actions/checkout@v4 + + # - name: Build the wheel + # run: python3 -m build --wheel --outdir local-dist + # - name: Make the wheel machine-independent + # run: delocate-wheel --wheel-dir dist local-dist/*.whl + # - name: Check the wheel + # run: twine check dist/*.whl + + check: + runs-on: ${{ matrix.os }} + needs: + - build-for-linux + # - build-for-windows + # - build-for-macos strategy: matrix: + os: + - ubuntu-22.04 + # - windows-2022 + # - macos-13 python_version: ['3.8', '3.12'] - env: - MACOSX_DEPLOYMENT_TARGET: 11.0 steps: - name: Install Python uses: actions/setup-python@v5 with: python-version: ${{ matrix.python_version }} - - name: Install Python packages - run: pip3 install build delocate twine - - name: Install OpenMP - run: | - cd /Users/runner/work - mkdir openmp - cd openmp - wget https://mac.r-project.org/openmp/openmp-10.0.0-darwin17-Release.tar.gz - tar xf *.tar.gz - sudo cp usr/local/lib/* /usr/local/lib - sudo cp usr/local/include/* /usr/local/include - - name: Install Boost - run: | - cd /Users/runner/work - wget https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.tar.gz - tar xf boost_*.tar.gz - rm boost_*.tar.gz - cd boost_* - echo "using python : ${{ matrix.python_version }} ;" >tools/build/src/user-config.jam - ./bootstrap.sh - ./b2 --with-python python=${{ matrix.python_version }} link=shared variant=release stage - sudo cp -r boost /usr/local/include - sudo cp -r stage/lib/* /usr/local/lib - - name: Install OR-Tools - run: | - cd /Users/runner/work - wget https://github.com/google/or-tools/releases/download/v8.2/or-tools_MacOsX-11.2.1_v8.2.8710.tar.gz - tar xf or-tools_*.tar.gz - rm or-tools_*.tar.gz - cd or-tools_* - sudo cp -r include/* /usr/local/include - sudo cp -r lib/* /usr/local/lib + # DO NOT install any other dependencies, to test that the wheels are self-contained - - name: Get the code - uses: actions/checkout@v4 + - name: Dowload the wheels from GitHub Actions artifacts + uses: actions/download-artifact@v4 + with: + pattern: wheel-dist-${{ matrix.python_version }}-* + merge-multiple: true - - name: Build the wheel - run: python3 -m build --wheel --outdir local-dist - - name: Make the wheel machine-independent - run: delocate-wheel --wheel-dir dist local-dist/*.whl - - name: Check the wheel - run: twine check dist/*.whl + - name: Install the wheel + run: pip${{ matrix.python_version }} install --find-links . --pre lincs + + - name: Run lincs + run: lincs --help + - run: lincs generate classification-problem 3 2 --output-problem problem.yml + - run: lincs generate classification-model problem.yml --output-model model.yml + - run: lincs generate classified-alternatives problem.yml model.yml 100 --output-alternatives learning-set.csv + - run: lincs learn classification-model problem.yml learning-set.csv --output-model learned-model.yml + - run: lincs classification-accuracy problem.yml learned-model.yml learning-set.csv