Skip to content

[CI] Split workflow CI into two (Ubuntu and macOS) #3

[CI] Split workflow CI into two (Ubuntu and macOS)

[CI] Split workflow CI into two (Ubuntu and macOS) #3

name: Build and test (macOS)
on:
push:
branches:
- master
- ci
pull_request:
branches:
- master
schedule:
- cron: '0 0 * * 0'
jobs:
build-and-test:
runs-on: macos-12
strategy:
fail-fast: false
matrix:
compiler:
- {name: gcc-12, cc: gcc-12, cxx: g++-12}
- {name: clang-17, cc: /usr/local/opt/llvm@17/bin/clang,
cxx: /usr/local/opt/llvm@17/bin/clang++}
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install llvm@17 eigen fftw hdf5 open-mpi
pip3 install mako numpy scipy mpi4py
- name: Set environment for Clang
if: startsWith(matrix.compiler.name, 'clang')
run: |
echo "LDFLAGS=\"-L/usr/local/opt/llvm@17/lib\"" >> $GITHUB_ENV
echo "CXXFLAGS=\"-Xpreprocessor -fopenmp -I/usr/local/opt/llvm@17/include\"" >> $GITHUB_ENV
- name: Cache Boost (a C++20 compatible version)
id: cache-boost
uses: actions/cache@v4
with:
path: ~/boost
key: boost-1.82
- name: Download Boost (a C++20 compatible version)
if: ${{ steps.cache-boost.outputs.cache-hit != 'true' }}
run: |
wget -q https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.tar.bz2
tar -xf boost_1_82_0.tar.bz2
mv boost_1_82_0 $HOME/boost
#To use the bundled libc++ please add the following LDFLAGS:
#LDFLAGS="-L/usr/local/opt/llvm@17/lib/c++ -Wl,-rpath,/usr/local/opt/llvm@17/lib/c++"
#llvm@17 is keg-only, which means it was not symlinked into /usr/local,
#because this is an alternate version of another formula.
#If you need to have llvm@17 first in your PATH, run:
#echo 'export PATH="/usr/local/opt/llvm@17/bin:$PATH"' >> /Users/runner/.bash_profile
#For compilers to find llvm@17 you may need to set:
#export LDFLAGS="-L/usr/local/opt/llvm@17/lib"
#export CPPFLAGS="-I/usr/local/opt/llvm@17/include"
- name: Install libcommute
env:
CXX: ${{ matrix.compiler.cxx }}
run: |
git clone https://github.com/krivenko/libcommute libcommute
mkdir libcommute/build && pushd libcommute/build
cmake .. \
-DCMAKE_INSTALL_PREFIX=$HOME/install \
-DTESTS=OFF \
-DEXAMPLES=OFF
make install
popd
- name: Build & install Pomerol
env:
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
run: |
git clone https://github.com/pomerol-ed/pomerol
mkdir pomerol/build && pushd pomerol/build
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=$HOME/install \
-DBoost_INCLUDE_DIR=$HOME/boost \
-Dlibcommute_DIR=$HOME/install/lib/cmake \
-DTesting=OFF \
-DDocumentation=OFF
make -j2 install VERBOSE=1
popd
- name: Build & install TRIQS
env:
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
run: |
git clone https://github.com/TRIQS/triqs --branch 3.2.x
mkdir triqs/build && pushd triqs/build
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=$HOME/install \
-DBoost_INCLUDE_DIR=$HOME/boost \
-DBuild_Tests=OFF
make -j2 install VERBOSE=1
popd
- name: Build pomerol2triqs
env:
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
run: |
source $HOME/install/share/triqs/triqsvars.sh
mkdir build && pushd build
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=$HOME/install \
-DBoost_INCLUDE_DIR=$HOME/boost
make -j2 install VERBOSE=1
popd
- name: Test pomerol2triqs
env:
TMPDIR: "/tmp"
run: |
mkdir -p $HOME/.prte
echo -e "\nrmaps_default_mapping_policy = :oversubscribe" >> \
$HOME/.prte/mca-params.conf
source $HOME/install/share/triqs/triqsvars.sh
cd build
ctest --output-on-failure