forked from dftbplus/skprogs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install gcc and libxc from conda-forge
- Loading branch information
Showing
1 changed file
with
127 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,189 +12,186 @@ jobs: | |
|
||
runs-on: ${{ matrix.os }} | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
mpi: [nompi, openmpi] | ||
config: [Debug] | ||
version: [13] | ||
|
||
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 | ||
auto-activate-base: true | ||
activate-environment: "" | ||
|
||
# - 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 }} | ||
run: mamba install c-compiler cxx-compiler fortran-compiler | ||
|
||
- name: Enable MPI build | ||
if: contains(matrix.mpi, 'openmpi') || contains(matrix.mpi, 'mpich') | ||
run: echo "WITH_MPI=true" >> $GITHUB_ENV | ||
run: echo "WITH_MPI=false" >> $GITHUB_ENV | ||
|
||
- name: Disable MPI build | ||
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: | | ||
# # eval "$(conda shell.bash hook)" | ||
# echo "FC=${CONDA_PREFIX}/bin/gfortran" >> $GITHUB_ENV | ||
# echo "CC=${CONDA_PREFIX}/bin/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 ../../ | ||
- name: Set libXC search path | ||
run: | | ||
echo "CMAKE_PREFIX_PATH=./libxc/${BUILD_DIR}/${INSTALL_DIR}/" >> $GITHUB_ENV | ||
- name: Install BLAS | ||
run: mamba install libopenblas libopenblas-ilp64 openblas openblas-ilp64 | ||
|
||
- name: Install libxc | ||
run: mamba install libxc=6.2.2 | ||
|
||
- name: Install requirements (pip) | ||
- name: Set libxc search path | ||
run: | | ||
pip3 install --upgrade pip | ||
pip3 install wheel | ||
pip3 install cmake fypp numpy scipy | ||
# eval "$(conda shell.bash hook)" | ||
echo "CMAKE_PREFIX_PATH=${CONDA_PREFIX}/" >> $GITHUB_ENV | ||
- name: Install requirements (conda) | ||
run: mamba install cmake fypp numpy scipy | ||
|
||
- name: Configure build | ||
run: >- | ||
cmake -B ${BUILD_DIR} -DWITH_MPI=${WITH_MPI} | ||
-DCMAKE_INSTALL_PREFIX=${PWD}/${BUILD_DIR}/${INSTALL_DIR} | ||
run: | | ||
# eval "$(conda shell.bash hook)" | ||
which gfortran | ||
FC=gfortran cmake -B ${BUILD_DIR} -DWITH_MPI=${WITH_MPI} \ | ||
-DCMAKE_INSTALL_PREFIX=${PWD}/${BUILD_DIR}/${INSTALL_DIR} \ | ||
-DCMAKE_BUILD_TYPE=${{ matrix.config }} . | ||
- name: Build project | ||
run: cmake --build ${BUILD_DIR} | ||
|
||
- name: Run regression tests | ||
run: | | ||
# eval "$(conda shell.bash hook)" | ||
pushd ${BUILD_DIR} | ||
ctest -j2 --output-on-failure | ||
popd | ||
- name: Configure build (TEST_MPI_PROCS=2) | ||
if: contains(matrix.mpi, 'openmpi') || contains(matrix.mpi, 'mpich') | ||
run: | | ||
# eval "$(conda shell.bash hook)" | ||
cmake -B ${BUILD_DIR} -DTEST_MPI_PROCS=2 . | ||
- name: Run regression tests (TEST_MPI_PROCS=2) | ||
if: contains(matrix.mpi, 'openmpi') || contains(matrix.mpi, 'mpich') | ||
run: | | ||
# eval "$(conda shell.bash hook)" | ||
pushd ${BUILD_DIR} | ||
ctest -j1 --output-on-failure | ||
popd | ||
- name: Install project | ||
run: | | ||
cmake --install ${BUILD_DIR} | ||
intel-build: | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
config: [RelWithDebInfo] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
env: | ||
FC: ifx | ||
CC: icx | ||
CMAKE_OPTIONS: >- | ||
-DCMAKE_BUILD_TYPE=${{ matrix.config }} | ||
-DFYPP_FLAGS='-DTRAVIS' | ||
-DWITH_MPI=false | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Setup Intel compiler | ||
uses: rscohn2/setup-oneapi@v0 | ||
with: | ||
components: | | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
- name: Setup Intel environment | ||
run: | | ||
source /opt/intel/oneapi/setvars.sh | ||
printenv >> ${GITHUB_ENV} | ||
echo "FC=ifx" >> ${GITHUB_ENV} | ||
echo "CC=icx" >> ${GITHUB_ENV} | ||
- 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 ../../ | ||
- name: Set libXC search path | ||
run: | | ||
echo "CMAKE_PREFIX_PATH=./libxc/${BUILD_DIR}/${INSTALL_DIR}/" >> $GITHUB_ENV | ||
- name: Install requirements (pip) | ||
run: | | ||
pip3 install --upgrade pip | ||
pip3 install wheel | ||
pip3 install cmake fypp numpy scipy | ||
- name: Set extra CMake flags (Linux) | ||
run: | | ||
echo "CMAKE_OPTIONS=${CMAKE_OPTIONS}" >> $GITHUB_ENV | ||
- name: Configure build | ||
run: | | ||
cmake -DCMAKE_INSTALL_PREFIX=${PWD}/${BUILD_DIR}/${INSTALL_DIR} -B ${BUILD_DIR} . | ||
- name: Build project | ||
run: cmake --build ${BUILD_DIR} | ||
|
||
- name: Run regression tests | ||
run: | | ||
pushd ${BUILD_DIR} | ||
ctest -j2 --output-on-failure | ||
popd | ||
- name: Install project | ||
run: | | ||
cmake --install ${BUILD_DIR} | ||
run: cmake --install ${BUILD_DIR} | ||
|
||
# intel-build: | ||
|
||
# strategy: | ||
# matrix: | ||
# os: [ubuntu-latest] | ||
# config: [RelWithDebInfo] | ||
|
||
# runs-on: ${{ matrix.os }} | ||
|
||
# env: | ||
# FC: ifx | ||
# CC: icx | ||
# CMAKE_OPTIONS: >- | ||
# -DCMAKE_BUILD_TYPE=${{ matrix.config }} | ||
# -DFYPP_FLAGS='-DTRAVIS' | ||
# -DWITH_MPI=false | ||
|
||
# steps: | ||
# - name: Checkout code | ||
# uses: actions/checkout@v4 | ||
|
||
# - name: Setup Python | ||
# uses: actions/setup-python@v4 | ||
# with: | ||
# python-version: 3.x | ||
|
||
# - name: Setup Intel compiler | ||
# uses: rscohn2/setup-oneapi@v0 | ||
# with: | ||
# components: | | ||
# [email protected] | ||
# [email protected] | ||
# [email protected] | ||
|
||
# - name: Setup Intel environment | ||
# run: | | ||
# source /opt/intel/oneapi/setvars.sh | ||
# printenv >> ${GITHUB_ENV} | ||
# echo "FC=ifx" >> ${GITHUB_ENV} | ||
# echo "CC=icx" >> ${GITHUB_ENV} | ||
|
||
# - 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 ../../ | ||
|
||
# - name: Set libxc search path | ||
# run: | | ||
# echo "CMAKE_PREFIX_PATH=./libxc/${BUILD_DIR}/${INSTALL_DIR}/" >> $GITHUB_ENV | ||
|
||
# - name: Install requirements (pip) | ||
# run: | | ||
# pip3 install --upgrade pip | ||
# pip3 install wheel | ||
# pip3 install cmake fypp numpy scipy | ||
|
||
# - name: Set extra CMake flags (Linux) | ||
# run: | | ||
# echo "CMAKE_OPTIONS=${CMAKE_OPTIONS}" >> $GITHUB_ENV | ||
|
||
# - name: Configure build | ||
# run: | | ||
# cmake -DCMAKE_INSTALL_PREFIX=${PWD}/${BUILD_DIR}/${INSTALL_DIR} -B ${BUILD_DIR} . | ||
|
||
# - name: Build project | ||
# run: cmake --build ${BUILD_DIR} | ||
|
||
# - name: Run regression tests | ||
# run: | | ||
# pushd ${BUILD_DIR} | ||
# ctest -j2 --output-on-failure | ||
# popd | ||
|
||
# - name: Install project | ||
# run: | | ||
# cmake --install ${BUILD_DIR} |