Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: fortran-lang/stdlib
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.2.0
Choose a base ref
...
head repository: fortran-lang/stdlib
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 687 changed files with 641,934 additions and 7,930 deletions.
31 changes: 31 additions & 0 deletions .github/collab.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

echo "📦 GitHub Fork Collaboration Setup Script"

# Prompt for User's GitHub username

read -p "Enter the GitHub username of the fork owner (e.g., alice): " USER

# Prompt for the branch name

read -p "Enter the PR branch name (e.g., feature-branch): " BRANCH

# Add remotes

echo "🔗 Adding remotes..."

git remote add $USER https://github.com/$USER/stdlib.git

# Fetch and checkout the PR branch

echo "📥 Fetching branch '$BRANCH'..."

git fetch $USER

git checkout -b $BRANCH $USER/$BRANCH

# Done

echo "✅ Repo set up. You're now on '$BRANCH'."

echo "You can now make changes and push directly to $USER/stdlib:$BRANCH"
174 changes: 30 additions & 144 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -19,68 +19,66 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
gcc_v: [9, 10, 11] # Version of GFortran we want to use.
build: [cmake]
os: [ubuntu-latest, macos-13]
toolchain:
- {compiler: gcc, version: 10}
- {compiler: gcc, version: 11}
- {compiler: gcc, version: 12}
- {compiler: gcc, version: 13}
- {compiler: intel, version: '2024.1'}
build: [cmake]
include:
- os: ubuntu-22.04
build: cmake
toolchain: {compiler: intel-classic, version: '2021.10'}
- os: ubuntu-latest
gcc_v: 10
build: cmake-inline
- os: ubuntu-latest
gcc_v: 10
build: make
toolchain: {compiler: gcc, version: 10}
exclude:
- os: macos-13
toolchain: {compiler: intel, version: '2024.1'}
- os: macos-13
toolchain: {compiler: gcc, version: 13}
env:
FC: gfortran-${{ matrix.gcc_v }}
CC: gcc-${{ matrix.gcc_v }}
CXX: g++-${{ matrix.gcc_v }}
GCC_V: ${{ matrix.gcc_v }}
BUILD_DIR: ${{ matrix.build == 'cmake' && 'build' || '.' }}

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

- name: Set up Python 3.x
uses: actions/setup-python@v1 # Use pip to install latest CMake, & FORD/Jin2For, etc.
uses: actions/setup-python@v5 # Use pip to install latest CMake, & FORD/Jin2For, etc.
with:
python-version: 3.x

- name: Install fypp
run: pip install --upgrade fypp

- name: Install GCC compilers Linux
if: contains( matrix.os, 'ubuntu')
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-${GCC_V} g++-${GCC_V} gfortran-${GCC_V}
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
--slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_V} \
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
run: pip install --upgrade fypp ninja

- name: Install GCC compilers macOS
if: contains( matrix.os, 'macos')
run: |
brew install gcc@${GCC_V} || brew upgrade gcc@${GCC_V} || true
brew link gcc@${GCC_V}
- name: Setup Fortran compiler
uses: fortran-lang/setup-fortran@v1.6.2
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}

# Build and test with built-in BLAS and LAPACK
- name: Configure with CMake
if: ${{ contains(matrix.build, 'cmake') }}
run: >-
cmake -Wdev
cmake -Wdev -G Ninja
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_MAXIMUM_RANK:String=4
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
-DFIND_BLAS:STRING=FALSE
-S . -B ${{ env.BUILD_DIR }}
- name: Build and compile
if: ${{ contains(matrix.build, 'cmake') }}
run: cmake --build ${{ env.BUILD_DIR }} --parallel

- name: catch build fail
run: cmake --build ${{ env.BUILD_DIR }} --verbose --parallel 1
if: ${{ failure() && contains(matrix.build, 'cmake') }}
run: cmake --build ${{ env.BUILD_DIR }} --verbose --parallel 1

- name: test
if: ${{ contains(matrix.build, 'cmake') }}
@@ -94,115 +92,3 @@ jobs:
- name: Install project
if: ${{ contains(matrix.build, 'cmake') }}
run: cmake --install ${{ env.BUILD_DIR }}

- name: Test manual makefiles
if: ${{ matrix.build == 'make' }}
run: |
make -f Makefile.manual -j
make -f Makefile.manual test
make -f Makefile.manual clean
env:
ADD_FYPPFLAGS: "-DMAXRANK=4"

intel-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
fc: [ifort]
cc: [icc]
cxx: [icpc]
env:
MACOS_HPCKIT_URL: >-
https://registrationcenter-download.intel.com/akdlm/irc_nas/18242/m_HPCKit_p_2021.4.0.3389_offline.dmg
MACOS_FORTRAN_COMPONENTS: all
FC: ${{ matrix.fc }}
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python 3.x
uses: actions/setup-python@v1
with:
python-version: 3.x

- name: Prepare for cache restore (OSX)
if: contains(matrix.os, 'macos')
run: |
sudo mkdir -p /opt/intel
sudo chown $USER /opt/intel
- name: Cache Intel install (OSX)
if: contains(matrix.os, 'macos')
id: cache-install
uses: actions/cache@v2
with:
path: /opt/intel/oneapi
key: install-${{ env.MACOS_HPCKIT_URL }}-${{ env.MACOS_FORTRAN_COMPONENTS }}

- name: Add Intel repository (Linux)
if: contains(matrix.os, 'ubuntu')
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
- name: Install Intel oneAPI compiler (Linux)
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get install intel-oneapi-compiler-fortran
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
- name: Install Intel oneAPI compiler (OSX)
if: contains(matrix.os, 'macos') && steps.cache-install.outputs.cache-hit != 'true'
run: |
curl --output webimage.dmg --url "$URL" --retry 5 --retry-delay 5
hdiutil attach webimage.dmg
if [ -z "$COMPONENTS" ]; then
sudo /Volumes/"$(basename "$URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --eula=accept --continue-with-optional-error=yes --log-dir=.
installer_exit_code=$?
else
sudo /Volumes/"$(basename "$URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --components="$COMPONENTS" --eula=accept --continue-with-optional-error=yes --log-dir=.
installer_exit_code=$?
fi
hdiutil detach /Volumes/"$(basename "$URL" .dmg)" -quiet
exit $installer_exit_code
env:
URL: ${{ env.MACOS_HPCKIT_URL }}
COMPONENTS: ${{ env.MACOS_FORTRAN_COMPONENTS }}

- name: Setup Intel oneAPI environment
run: |
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
- name: Install fypp
run: pip install --upgrade fypp

- name: Configure with CMake
run: >-
cmake -Wdev
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_MAXIMUM_RANK:String=4
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
-S . -B build
- name: Build and compile
run: cmake --build build

- name: catch build fail
run: cmake --build build --verbose --parallel 1
if: failure()

- name: test
run: ctest --parallel --output-on-failure --no-tests=error
working-directory: build

- name: Install project
run: cmake --install build
136 changes: 136 additions & 0 deletions .github/workflows/ci_BLAS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: CI_BLAS

on: [push, pull_request]

env:
CTEST_TIME_TIMEOUT: "5" # some failures hang forever
CMAKE_GENERATOR: Ninja

jobs:
msys2-build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include: [{ msystem: UCRT64, arch: x86_64 }]
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v2

- name: Setup MinGW native environment
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: false
install: >-
git
mingw-w64-ucrt-${{ matrix.arch }}-gcc
mingw-w64-ucrt-${{ matrix.arch }}-gcc-fortran
mingw-w64-ucrt-${{ matrix.arch }}-python
mingw-w64-ucrt-${{ matrix.arch }}-python-fypp
mingw-w64-ucrt-${{ matrix.arch }}-cmake
mingw-w64-ucrt-${{ matrix.arch }}-ninja
mingw-w64-ucrt-${{ matrix.arch }}-openblas
# Build and test with external BLAS and LAPACK (OpenBLAS on UCRT64)
- name: Configure with CMake and OpenBLAS
run: >-
PATH=$PATH:/ucrt64/bin/ cmake
-Wdev
-B build
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_Fortran_FLAGS_DEBUG="-Wall -Wextra -Wimplicit-interface -fPIC -g -fcheck=all -fbacktrace"
-DCMAKE_MAXIMUM_RANK:String=4
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
-DFIND_BLAS:STRING=TRUE
env:
FC: gfortran
CC: gcc
CXX: g++

- name: CMake build with OpenBLAS
run: PATH=$PATH:/ucrt64/bin/ cmake --build build --parallel

- name: catch build fail
if: failure()
run: PATH=$PATH:/ucrt64/bin/ cmake --build build --verbose --parallel 1

- name: CTest with OpenBLAS
run: PATH=$PATH:/ucrt64/bin/ ctest --test-dir build --output-on-failure --parallel -V -LE quadruple_precision

- uses: actions/upload-artifact@v4
if: failure()
with:
name: WindowsCMakeTestlog_openblas
path: build/Testing/Temporary/LastTest.log

- name: Install project with OpenBLAS
run: PATH=$PATH:/ucrt64/bin/ cmake --install build

Build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain:
- { compiler: intel, version: "2024.1" }
build: [cmake]
env:
BUILD_DIR: ${{ matrix.build == 'cmake' && 'build' || '.' }}
APT_PACKAGES: >-
intel-oneapi-mkl
intel-oneapi-mkl-devel
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python 3.x
uses: actions/setup-python@v5 # Use pip to install latest CMake, & FORD/Jin2For, etc.
with:
python-version: 3.x

- name: Install fypp
run: pip install --upgrade fypp ninja

- name: Setup Fortran compiler
uses: fortran-lang/setup-fortran@v1.6.1
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}

- name: Install Intel oneAPI MKL
run: |
sudo apt-get install ${APT_PACKAGES}
source /opt/intel/oneapi/mkl/latest/env/vars.sh
printenv >> $GITHUB_ENV
# Build and test with external BLAS and LAPACK (MKL on Ubuntu with Intel compilers)
- name: Configure with CMake and MKL
run: >-
cmake -Wdev -G Ninja
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_MAXIMUM_RANK:String=4
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
-DFIND_BLAS:STRING=TRUE
-S . -B ${{ env.BUILD_DIR }}
- name: Build and compile with MKL
run: cmake --build ${{ env.BUILD_DIR }} --parallel

- name: catch build fail with MKL
if: failure()
run: cmake --build ${{ env.BUILD_DIR }} --verbose --parallel 1

- name: test with MKL
run: >-
ctest
--test-dir ${{ env.BUILD_DIR }}
--parallel
--output-on-failure
--no-tests=error
- name: Install project with MKL
run: cmake --install ${{ env.BUILD_DIR }}
Loading