Skip to content

Commit

Permalink
Install cmake with pip (#608)
Browse files Browse the repository at this point in the history
# Description
Updated ci_tests to install cmake from pip instead of building from
source

Closes #518 

## Type of change
- [x] Bug fix & code cleanup
- [ ] New feature
- [ ] Documentation update
- [ ] Test update

## Checklist for the reviewer
This checklist should be used as a help for the reviewer.

- [ ] Is the change limited to one issue?
- [ ] Does this PR close the issue?
- [ ] Is the code easy to read and understand?
- [ ] Do all new feature have an accompanying new test?
- [ ] Has the documentation been updated as necessary?
  • Loading branch information
jesper-friis authored Aug 20, 2023
2 parents fc07876 + ac2ca2b commit 86e38c4
Showing 1 changed file with 22 additions and 24 deletions.
46 changes: 22 additions & 24 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -45,15 +28,25 @@ 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
# 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
cmake --version
- name: configure
run: |
mkdir build
Expand All @@ -62,27 +55,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
Expand Down

0 comments on commit 86e38c4

Please sign in to comment.