Skip to content

Commit

Permalink
Merge pull request #203 from timcallow/libxc_change_install
Browse files Browse the repository at this point in the history
Change the way `libxc` is installed
  • Loading branch information
timcallow authored Oct 9, 2023
2 parents d8e5ed4 + cca21b2 commit 8e80f1c
Show file tree
Hide file tree
Showing 6 changed files with 426 additions and 346 deletions.
58 changes: 52 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,80 @@ on:
jobs:
run-test-suite:
runs-on: ubuntu-22.04
timeout-minutes: 15
timeout-minutes: 60
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.10'

- name: Upgrade pip
run: python3 -m pip install --upgrade pip
run: python -m pip install --upgrade pip

- name : Install pipenv
run : python3 -m pip install --upgrade pipenv
run : python -m pip install --upgrade pipenv

- id: cache-pipenv
uses: actions/cache@v3
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}_v2

- name: Get latest commit SHA of libxc master branch
id: get-sha
run: |
echo "::set-output name=sha::$(git ls-remote https://github.com/ElectronicStructureLibrary/libxc.git refs/heads/master | cut -f 1)"
- name: Cache external library
id: cache-libxc
uses: actions/cache@v3
with:
path: ~/libxc/sharedlib/
key: libxc-${{ runner.os }}-${{ steps.get-sha.outputs.sha }}

- name: Build and install libxc
if: steps.cache-libxc.outputs.cache-hit != 'true'
run: |
install_path=~/libxc/sharedlib/
cd ~
git clone https://github.com/ElectronicStructureLibrary/libxc.git
cd ~/libxc
mkdir -p $install_path
cmake -H. -Bobjdir -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=$install_path -DENABLE_PYTHON=ON
cd objdir && make
make test
make install
- name: Set LD_LIBRARY_PATH
run: echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/libxc/sharedlib/" >> $GITHUB_ENV

- name: Cache Python bindings
id: cache-bindings
uses: actions/cache@v3
with:
path: ~/libxc
key: bindings-${{ runner.os }}-${{ steps.get-libxc-sha.outputs.sha }}

- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: pipenv --python 3.8 install --dev
run: |
cd ${{ github.workspace }}
pipenv install --dev
- name: Install Python bindings
if: steps.cache-bindings.outputs.cache-hit != 'true'
run: |
pipenv run pip install ~/libxc/
- name: Install atoMEC
run: pipenv run python3 -m pip install -e .
run: |
cd ${{ github.workspace }}
pipenv run pip install -e .
- name: Run test suite
run: pipenv run pytest --cov=atoMEC --cov-report=xml --random-order tests/
Expand Down
1 change: 0 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ numpy = ">=1.20.3"
scipy = ">=1.6.3"
mendeleev = ">=0.7.0"
tabulate = ">=0.8.9"
pylibxc2 = ">=6.0.0"
joblib = ">=1.0.1"

[requires]
Expand Down
Loading

0 comments on commit 8e80f1c

Please sign in to comment.