Skip to content

Commit

Permalink
CI: Add Ubuntu Clang 19 to build matrix (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles authored Feb 26, 2025
1 parent 068beb2 commit 5942211
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 19 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/ci-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,13 @@ jobs:
{name: gcc, ver: 12},
{name: gcc, ver: 13},
{name: gcc, ver: 14},
{name: clang, ver: 19},
{name: nvc++, ver: '25.1'},
]
fail-fast: false

runs-on: ubuntu-24.04
name: ${{ matrix.compiler.name }} ${{ matrix.compiler.ver }}
name: Ubuntu ${{ matrix.compiler.name }} ${{ matrix.compiler.ver }}
steps:
- uses: actions/checkout@v4

Expand All @@ -92,10 +93,21 @@ jobs:
- name: Install GCC
if: matrix.compiler.name == 'gcc'
uses: fortran-lang/setup-fortran@v1
with:
compiler: gcc
version: ${{ matrix.compiler.ver }}
run: |
echo "CXX=g++-${{ matrix.compiler.ver }}" >> $GITHUB_ENV
echo "OMPI_CXX=g++-${{ matrix.compiler.ver }}" >> $GITHUB_ENV
- name: Install Clang
if: matrix.compiler.name == 'clang'
run: |
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y lld-${{ matrix.compiler.ver }} clang-${{ matrix.compiler.ver }} libomp-${{ matrix.compiler.ver }}-dev libomp5-${{ matrix.compiler.ver }}
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${{ matrix.compiler.ver }} 100
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${{ matrix.compiler.ver }} 100
echo "CXX=clang++-${{ matrix.compiler.ver }}" >> $GITHUB_ENV
echo "OMPI_CXX=clang++-${{ matrix.compiler.ver }}" >> $GITHUB_ENV
echo "LDFLAGS=-L/usr/lib/llvm-${{ matrix.compiler.ver }}/lib" >> $GITHUB_ENV
- name: Install nvc++
if: matrix.compiler.name == 'nvc++'
Expand Down Expand Up @@ -123,10 +135,6 @@ jobs:
run: |
sudo apt install -y openmpi-bin libopenmpi-dev
- name: Install OpenMP
run: |
sudo apt-get install -y libomp5 libomp-dev
- name: Compile classic mode
run: |
cp -v -p artisoptions_classic.h artisoptions.h
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,10 @@ jobs:
with:
fetch-depth: 0

- name: Install gcc-14
if: always()
uses: fortran-lang/setup-fortran@v1
with:
compiler: gcc
version: 14

- name: Install GSL and OpenMPI
run: |
echo "CXX=g++-14" >> $GITHUB_ENV
echo "OMPI_CXX=g++-14" >> $GITHUB_ENV
sudo apt-get update
sudo apt install -y libgsl-dev
sudo apt install -y openmpi-bin libopenmpi-dev
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ $(info $(COMPILER_VERSION))
ifneq '' '$(findstring clang,$(COMPILER_VERSION))'
COMPILER_NAME := CLANG
CXXFLAGS += -flto=thin
ifeq ($(if $(shell command -v lld),'true','false'), 'true')
LDFLAGS += -fuse-ld=lld
endif
else ifneq '' '$(findstring g++,$(COMPILER_VERSION))'
COMPILER_NAME := GCC
CXXFLAGS += -flto=auto
Expand Down
7 changes: 4 additions & 3 deletions radfield.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,20 +211,21 @@ void update_bfestimators(const int nonemptymgi, const double distance_e_cmf, con
// I think the nu_cmf slightly differs from when the phixslist was calculated
// so the nu condition on this nu_cmf can truncate the list further compared to what was used in the calculation
// of phixslist.gamma_contr
const auto bfestimcount = globals::bfestimcount;

assert_testmodeonly(phixslist.bfestimend <= bfestimcount);
const auto bfestimend = std::upper_bound(globals::bfestim_nu_edge.data(),
globals::bfestim_nu_edge.data() + phixslist.bfestimend, nu_cmf) -
globals::bfestim_nu_edge.data();

assert_testmodeonly(bfestimend <= bfestimcount);
assert_testmodeonly(phixslist.bfestimbegin >= 0);
const auto bfestimbegin = std::lower_bound(globals::bfestim_nu_edge.data() + phixslist.bfestimbegin,
globals::bfestim_nu_edge.data() + bfestimend, nu_cmf,
[](const double nu_edge, const double find_nu_cmf) {
return nu_edge * last_phixs_nuovernuedge < find_nu_cmf;
}) -
globals::bfestim_nu_edge.data();

const auto bfestimcount = globals::bfestimcount;

for (auto bfestimindex = bfestimbegin; bfestimindex < bfestimend; bfestimindex++) {
atomicadd(bfrate_raw[(nonemptymgi * bfestimcount) + bfestimindex],
phixslist.gamma_contr[bfestimindex] * distance_e_cmf_over_nu);
Expand Down

0 comments on commit 5942211

Please sign in to comment.