Skip to content

Commit

Permalink
Install gcc and libxc from conda-forge
Browse files Browse the repository at this point in the history
  • Loading branch information
vanderhe committed Dec 3, 2024
1 parent 0571c45 commit 6a71d22
Showing 1 changed file with 21 additions and 32 deletions.
53 changes: 21 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,21 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v4
- name: Set up miniforge
uses: conda-incubator/setup-miniconda@v3
with:
python-version: '3.x'
miniforge-version: latest

# - name: Set up python
# uses: actions/setup-python@v4
# with:
# python-version: '3.x'

- name: Install GCC (Linux)
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-${{ matrix.version}} gfortran-${{ matrix.version }}
sudo update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.version }} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${{ matrix.version }} \
--slave /usr/bin/gcov gcov /usr/bin/gcov-${{ matrix.version }}
mamba install c-compiler cxx-compiler fortran-compiler
- name: Enable MPI build
if: contains(matrix.mpi, 'openmpi') || contains(matrix.mpi, 'mpich')
Expand All @@ -47,37 +46,27 @@ jobs:
if: contains(matrix.mpi, 'nompi')
run: echo "WITH_MPI=false" >> $GITHUB_ENV

- name: Set Compiler
run: |
echo "FC=gfortran" >> $GITHUB_ENV
echo "CC=gcc" >> $GITHUB_ENV
# - name: Set Compiler
# run: |
# echo "FC=gfortran" >> $GITHUB_ENV
# echo "CC=gcc" >> $GITHUB_ENV

- name: Install OpenMPI
if: contains(matrix.mpi, 'openmpi')
run: |
sudo apt-get update
sudo apt-get install libopenmpi-dev
run: mamba install openmpi openmpi-mpicc openmpi-mpicxx openmpi-mpifort

- name: Install MPICH
if: contains(matrix.mpi, 'mpich')
run: |
sudo apt-get update
sudo apt-get install mpich
run: mamba install mpich mpich-mpicc mpich-mpicxx mpich-mpifort

- name: Compile and Install libXC
run: |
git clone https://gitlab.com/libxc/libxc.git
cd libxc/
git checkout 6.2.2
cmake -DCMAKE_INSTALL_PREFIX=${PWD}/${BUILD_DIR}/${INSTALL_DIR} -DENABLE_FORTRAN=True -B ${BUILD_DIR} .
cd ${BUILD_DIR}
make -j2
make install
cd ../../
run: mamba install libxc=6.2.2

- name: Set libXC search path
run: |
echo "CMAKE_PREFIX_PATH=./libxc/${BUILD_DIR}/${INSTALL_DIR}/" >> $GITHUB_ENV
mamba activate
echo "${CONDA_PREFIX}"
echo "CMAKE_PREFIX_PATH=${CONDA_PREFIX}/" >> $GITHUB_ENV
- name: Install requirements (pip)
run: |
Expand Down Expand Up @@ -135,7 +124,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
Expand Down

0 comments on commit 6a71d22

Please sign in to comment.