Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 48 additions & 59 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:

defaults:
run:
shell: bash
shell: bash --noprofile --norc -e -x -o pipefail {0}

jobs:
setup: # This job currently just exists to reduce cancelled job spam in PRs
Expand Down Expand Up @@ -95,32 +95,27 @@ jobs:
- os: ubuntu-24.04
compiler: ifx
version: latest
error_stop_code: 128
container: intel/oneapi-toolkit:latest

- os: ubuntu-24.04
compiler: ifx
version: 2026.0.0
error_stop_code: 128
container: intel/oneapi-toolkit:2026.0.0-devel-ubuntu24.04

# https://hub.docker.com/r/intel/fortran-essentials/tags
- os: ubuntu-24.04
compiler: ifx
version: 2025.3.0
error_stop_code: 128
container: intel/fortran-essentials:2025.3.0-0-devel-ubuntu24.04

- os: ubuntu-24.04
compiler: ifx
version: 2025.2.2
error_stop_code: 128
container: intel/fortran-essentials:2025.2.2-0-devel-ubuntu24.04

- os: ubuntu-24.04
compiler: ifx
version: 2025.2.0
error_stop_code: 128
container: intel/fortran-essentials:2025.2.0-0-devel-ubuntu24.04

# --- LFortran coverage ---
Expand Down Expand Up @@ -158,53 +153,49 @@ jobs:
- name: Install Ubuntu Native Dependencies
if: ${{ contains(matrix.os, 'ubuntu') && matrix.container == '' && matrix.compiler == 'gfortran' }}
run: |
set -x
sudo apt-get update
sudo apt list -a 'gfortran-*'
sudo apt install -y build-essential
if [[ ${COMPILER_VERSION} < 15 ]] ; then \
sudo apt install -y gfortran-${COMPILER_VERSION} ; \
else \
curl -L https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -o install-homebrew.sh ; \
chmod +x install-homebrew.sh ; \
env CI=1 ./install-homebrew.sh ; \
HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew" ; \
${HOMEBREW_PREFIX}/bin/brew install -v gcc@${COMPILER_VERSION} binutils ; \
ls -al ${HOMEBREW_PREFIX}/bin ; \
echo "PATH=${HOMEBREW_PREFIX}/bin:${PATH}" >> "$GITHUB_ENV" ; \
: Homebrew GCC@15 needs binutils 2.44+ ; \
HOMEBREW_BINUTILS=$(ls -d ${HOMEBREW_PREFIX}/Cellar/binutils/2.*/bin ) ; \
ls -al ${HOMEBREW_BINUTILS} ; \
echo "FFLAGS=$FFLAGS -B ${HOMEBREW_BINUTILS}" >> "$GITHUB_ENV" ; \
echo "CFLAGS=$CFLAGS -B ${HOMEBREW_BINUTILS}" >> "$GITHUB_ENV" ; \
echo "CXXFLAGS=$CXXFLAGS -B ${HOMEBREW_BINUTILS}" >> "$GITHUB_ENV" ; \
if [[ ${COMPILER_VERSION} < 15 ]] ; then
sudo apt install -y gfortran-${COMPILER_VERSION}
else
curl -L https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -o install-homebrew.sh
chmod +x install-homebrew.sh
env CI=1 ./install-homebrew.sh
HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew"
${HOMEBREW_PREFIX}/bin/brew install -v gcc@${COMPILER_VERSION} binutils
ls -al ${HOMEBREW_PREFIX}/bin
echo "PATH=${HOMEBREW_PREFIX}/bin:${PATH}" >> "$GITHUB_ENV"
: Homebrew GCC@15 needs binutils 2.44+
HOMEBREW_BINUTILS=$(ls -d ${HOMEBREW_PREFIX}/Cellar/binutils/2.*/bin )
ls -al ${HOMEBREW_BINUTILS}
echo "FFLAGS=$FFLAGS -B ${HOMEBREW_BINUTILS}" >> "$GITHUB_ENV"
echo "CFLAGS=$CFLAGS -B ${HOMEBREW_BINUTILS}" >> "$GITHUB_ENV"
echo "CXXFLAGS=$CXXFLAGS -B ${HOMEBREW_BINUTILS}" >> "$GITHUB_ENV"
fi

- name: Install Ubuntu Container Dependencies
if: ${{ contains(matrix.os, 'ubuntu') && matrix.container != '' && !contains(matrix.container, 'phhargrove') }}
run: |
set -x
apt update
apt install -y build-essential pkg-config make git curl
# Add container lfortran to PATH:
if test "$FC" = "lfortran"; then \
echo "/app/bin" >> "$GITHUB_PATH" ; \
ls -alh /app/bin ; \
ls -alh /app/share/lfortran/lib/ ; \
if test "$FC" = "lfortran"; then
echo "/app/bin" >> "$GITHUB_PATH"
ls -alh /app/bin
ls -alh /app/share/lfortran/lib/
fi

- name: Install macOS Dependencies
if: contains(matrix.os, 'macos')
run: |
set -x
brew update
# fpm binary distribution for macOS requires gfortran shared libraries from gcc@12
brew install gcc@12

- name: Install LLVM flang on macOS
if: contains(matrix.os, 'macos') && matrix.compiler == 'flang'
run: |
set -x
brew install llvm@${COMPILER_VERSION} flang
# workaround issue #228: clang cannot find homebrew flang's C header
for p in /opt/homebrew /usr/local $(brew --prefix) ; do find $p/Cellar/flang -name ISO_Fortran_binding.h 2>/dev/null || true ; done
Expand All @@ -214,30 +205,29 @@ jobs:

- name: Setup Compilers
run: |
set -x
if test "$FC" = "flang" ; then \
echo "FPM_FC=flang-new" >> "$GITHUB_ENV" ; \
elif [[ "$FC" =~ "ifx" ]] ; then \
echo "FPM_FC=ifx" >> "$GITHUB_ENV" ; \
echo "FFLAGS=-fpp -coarray -coarray-num-images=1 $FFLAGS" >> "$GITHUB_ENV" ; \
: ls -al /opt/intel/oneapi/compiler/2025.*/bin/ ; \
if type -p icpx ; then \
echo "FPM_CC=icx" >> "$GITHUB_ENV" ; \
echo "FPM_CXX=icpx" >> "$GITHUB_ENV" ; \
else \
echo "FPM_CC=gcc" >> "$GITHUB_ENV" ; \
echo "FPM_CXX=g++" >> "$GITHUB_ENV" ; \
fi ; \
elif test "$FC" = "lfortran" ; then \
echo "FPM_FC=lfortran" >> "$GITHUB_ENV" ; \
echo "FFLAGS=--cpp --separate-compilation --realloc-lhs-arrays $FFLAGS" >> "$GITHUB_ENV" ; \
echo "FPM_FLAGS=--profile debug --verbose" >> "$GITHUB_ENV" ; : fpm 0.13 workaround ; \
else \
echo "FPM_FC=gfortran-${COMPILER_VERSION}" >> "$GITHUB_ENV" ; \
echo "FFLAGS=-ffree-line-length-0 $FFLAGS" >> "$GITHUB_ENV" ; \
if test "$FC" = "flang" ; then
echo "FPM_FC=flang-new" >> "$GITHUB_ENV"
elif [[ "$FC" =~ "ifx" ]] ; then
echo "FPM_FC=ifx" >> "$GITHUB_ENV"
echo "FFLAGS=-fpp -coarray -coarray-num-images=1 $FFLAGS" >> "$GITHUB_ENV"
: ls -al /opt/intel/oneapi/compiler/2025.*/bin/
if type -p icpx ; then
echo "FPM_CC=icx" >> "$GITHUB_ENV"
echo "FPM_CXX=icpx" >> "$GITHUB_ENV"
else
echo "FPM_CC=gcc" >> "$GITHUB_ENV"
echo "FPM_CXX=g++" >> "$GITHUB_ENV"
fi
elif test "$FC" = "lfortran" ; then
echo "FPM_FC=lfortran" >> "$GITHUB_ENV"
echo "FFLAGS=--cpp --separate-compilation --realloc-lhs-arrays $FFLAGS" >> "$GITHUB_ENV"
echo "FPM_FLAGS=--profile debug --verbose" >> "$GITHUB_ENV" ; : fpm 0.13 workaround
else
echo "FPM_FC=gfortran-${COMPILER_VERSION}" >> "$GITHUB_ENV"
echo "FFLAGS=-ffree-line-length-0 $FFLAGS" >> "$GITHUB_ENV"
fi
if [[ "${{ matrix.container }}" =~ "snowstep/llvm" ]] ; then \
echo "LD_LIBRARY_PATH=/usr/lib/llvm-22/lib:$LD_LIBRARY_PATH" >> "$GITHUB_ENV" ; \
if [[ "${{ matrix.container }}" =~ "snowstep/llvm" ]] ; then
echo "LD_LIBRARY_PATH=/usr/lib/llvm-22/lib:$LD_LIBRARY_PATH" >> "$GITHUB_ENV"
fi

- name: Setup FPM
Expand All @@ -249,18 +239,18 @@ jobs:
- name: Build FPM
if: false
run: |
set -x
curl --retry 5 -LOsS https://github.com/fortran-lang/fpm/releases/download/v0.11.0/fpm-0.11.0.F90
mkdir fpm-temp
gfortran-14 -o fpm-temp/fpm fpm-0.11.0.F90
echo "PATH=`pwd`/fpm-temp:${PATH}" >> "$GITHUB_ENV"

- name: Version info
run: |
if test -d .git && type -p git > /dev/null ; then \
git config --global --add safe.directory `pwd` ; \
echo == Commit Info == ; \
git log -n 1 ; echo ; echo ; \
set +x
if test -d .git && type -p git > /dev/null ; then
git config --global --add safe.directory `pwd`
echo == Commit Info ==
git log -n 1 ; echo ; echo
fi
echo == Platform version info ==
uname -a
Expand All @@ -275,7 +265,6 @@ jobs:

- name: Build and Test
run: |
set -x
echo "FPM_FLAGS=${FPM_FLAGS}"
echo "FFLAGS=$FFLAGS"
ls -lt
Expand Down
Loading