From fd66072f35723a821429b621f8d011653c1bdacd Mon Sep 17 00:00:00 2001 From: Jesper Friis Date: Sun, 20 Aug 2023 22:27:46 +0200 Subject: [PATCH 1/2] Updated ci_tests to install cmake from pip instead of building from source --- .github/workflows/ci_tests.yml | 57 ++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 031fe6098..e193ff045 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -13,23 +13,6 @@ jobs: run: | sudo apt-get update --fix-missing - - name: Workaround - install CMake 3.25.2 since 3.26.0 doesn't work - run: | - sudo apt remove cmake - sudo apt purge --auto-remove cmake - wget http://www.cmake.org/files/v3.25/cmake-3.25.2.tar.gz - tar xf cmake-3.25.2.tar.gz - cd cmake-3.25.2 - ./configure - make - sudo make install - hash -r - cd - - - - name: Show CMake version - run: | - cmake --version - - name: Install dependencies run: | sudo apt-get install \ @@ -45,15 +28,36 @@ jobs: - name: Install Python dependencies run: | - pip install --upgrade pip -r requirements.txt - pip install -r requirements_dev.txt - pip install -r requirements_doc.txt + python3 -m pip install --upgrade pip -r requirements.txt + python3 -m pip install -r requirements_dev.txt + python3 -m pip install -r requirements_doc.txt + - name: check numpy run: | which python3 python3 --version - pip3 --version + python3 -m pip --version python3 -c 'import numpy as np; print(np.get_include())' + + - name: Workaround - install CMake 3.25.2 since 3.26.0 doesn't work + run: | + python3 -m pip install cmake==3.25.2 + #run: | + # sudo apt remove cmake + # sudo apt purge --auto-remove cmake + # wget http://www.cmake.org/files/v3.25/cmake-3.25.2.tar.gz + # tar xf cmake-3.25.2.tar.gz + # cd cmake-3.25.2 + # ./configure + # make + # sudo make install + # hash -r + # cd - + + - name: Show CMake version + run: | + cmake --version + - name: configure run: | mkdir build @@ -62,27 +66,32 @@ jobs: CFLAGS='-Wno-missing-field-initializers' \ cmake .. -DFORCE_EXAMPLES=ON -DWITH_FORTRAN=YES cd - + - name: make run: | cd build - make + cmake --build . cd - + - name: install run: | cd build - make install + cmake --install . cd - + - name: make test run: | cd build ctest || ctest --rerun-failed --output-on-failure -V cd - + - name: build Linux wheel run: | cd python - pip install numpy wheel + python3 -m pip install numpy wheel python3 setup.py bdist_wheel cd - + - name: Install python package via setup.py and test the installation run: | cd python From ac2ca2be1d633bf13eed05905b87e2fba171c9b4 Mon Sep 17 00:00:00 2001 From: Jesper Friis Date: Sun, 20 Aug 2023 22:50:39 +0200 Subject: [PATCH 2/2] Cleaned up workflow file --- .github/workflows/ci_tests.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index e193ff045..f8610f9eb 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -40,22 +40,11 @@ jobs: python3 -c 'import numpy as np; print(np.get_include())' - name: Workaround - install CMake 3.25.2 since 3.26.0 doesn't work + # Normally we would install cmake with the package manager, but + # ubuntu 20.04 doesn't seems to keep older versions of cmake around... + # Fortunately, there exists a pip package run: | python3 -m pip install cmake==3.25.2 - #run: | - # sudo apt remove cmake - # sudo apt purge --auto-remove cmake - # wget http://www.cmake.org/files/v3.25/cmake-3.25.2.tar.gz - # tar xf cmake-3.25.2.tar.gz - # cd cmake-3.25.2 - # ./configure - # make - # sudo make install - # hash -r - # cd - - - - name: Show CMake version - run: | cmake --version - name: configure