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/fpm
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.10.1
Choose a base ref
...
head repository: fortran-lang/fpm
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.11.0
Choose a head ref
Loading
Showing with 2,002 additions and 428 deletions.
  1. +76 −74 .github/workflows/CI.yml
  2. +41 −21 .github/workflows/meta.yml
  3. +10 −11 .github/workflows/release.yml
  4. +5 −0 ci/meta_tests.sh
  5. +59 −0 ci/run_tests.sh
  6. +2 −0 example_packages/auto_with_nondefault_main/.gitignore
  7. +3 −0 example_packages/auto_with_nondefault_main/README.md
  8. +3 −0 example_packages/auto_with_nondefault_main/app/non_default_name.f90
  9. +5 −0 example_packages/auto_with_nondefault_main/fpm.toml
  10. +1 −0 example_packages/many_examples/.gitignore
  11. +3 −0 example_packages/many_examples/app/demo-prog.f90
  12. +7 −0 example_packages/many_examples/demo1/prog.f90
  13. +7 −0 example_packages/many_examples/demo2/prog.f90
  14. +12 −0 example_packages/many_examples/fpm.toml
  15. +1 −0 example_packages/many_targets/.gitignore
  16. +6 −0 example_packages/many_targets/app/run1.f90
  17. +6 −0 example_packages/many_targets/app/run2.f90
  18. +6 −0 example_packages/many_targets/app/run3.f90
  19. +6 −0 example_packages/many_targets/example/example1.f90
  20. +6 −0 example_packages/many_targets/example/example2.f90
  21. +6 −0 example_packages/many_targets/example/example3.f90
  22. +1 −0 example_packages/many_targets/fpm.toml
  23. +17 −0 example_packages/many_targets/src/file_mod.f90
  24. +6 −0 example_packages/many_targets/test/test1.f90
  25. +6 −0 example_packages/many_targets/test/test2.f90
  26. +6 −0 example_packages/many_targets/test/test3.f90
  27. +15 −0 example_packages/metapackage_hdf5/app/main.f90
  28. +2 −0 example_packages/metapackage_hdf5/fpm.toml
  29. +2 −2 fpm.toml
  30. +3 −8 install.sh
  31. +107 −51 src/fpm.f90
  32. +51 −29 src/fpm/cmd/install.f90
  33. +1 −1 src/fpm/cmd/publish.f90
  34. +1 −2 src/fpm/dependency.f90
  35. +1 −1 src/fpm/fpm_release.F90
  36. +20 −22 src/fpm/git.f90
  37. +38 −1 src/fpm/installer.f90
  38. +1 −1 src/fpm/manifest/dependency.f90
  39. +15 −4 src/fpm/manifest/install.f90
  40. +6 −1 src/fpm/manifest/library.f90
  41. +7 −1 src/fpm/manifest/meta.f90
  42. +0 −5 src/fpm/manifest/preprocess.f90
  43. +9 −9 src/fpm/manifest/profiles.f90
  44. +36 −13 src/fpm/toml.f90
  45. +37 −4 src/fpm_command_line.f90
  46. +92 −21 src/fpm_compiler.F90
  47. +38 −0 src/fpm_environment.c
  48. +99 −0 src/fpm_environment.f90
  49. +57 −19 src/fpm_filesystem.F90
  50. +241 −106 src/fpm_meta.f90
  51. +1 −1 src/fpm_model.f90
  52. +4 −0 src/fpm_os.c
  53. +348 −0 src/fpm_pkg_config.f90
  54. +9 −9 src/fpm_source_parsing.f90
  55. +71 −2 src/fpm_strings.f90
  56. +5 −2 src/fpm_targets.f90
  57. +4 −2 test/fpm_test/main.f90
  58. +56 −0 test/fpm_test/test_compiler.f90
  59. +37 −1 test/fpm_test/test_installer.f90
  60. +44 −2 test/fpm_test/test_manifest.f90
  61. +53 −1 test/fpm_test/test_os.f90
  62. +184 −1 test/fpm_test/test_source_parsing.f90
150 changes: 76 additions & 74 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -21,70 +21,72 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-11, windows-latest]
gcc_v: [10,11,12,13] # Version of GFortran we want to use.
os: [ubuntu-latest, macos-13, windows-latest]
toolchain:
- {compiler: gcc, version: 10}
- {compiler: gcc, version: 11}
- {compiler: gcc, version: 12}
- {compiler: gcc, version: 13}
- {compiler: gcc, version: 14}
exclude:
# Not yet supported by setup-fortran
- os: windows-latest
toolchain: {compiler: gcc, version: 14}
include:
- os: ubuntu-latest
os-arch: linux-x86_64
release-flags: --flag '--static -g -fbacktrace -O3'

- os: macos-11
os-arch: macos-x86_64
release-flags: --flag '-g -fbacktrace -O3'

- os: windows-latest
os-arch: windows-x86_64
release-flags: --flag '--static -g -fbacktrace -O3'
exe: .exe

env:
FC: gfortran
GCC_V: ${{ matrix.gcc_v }}
- os: ubuntu-latest
os-arch: linux-x86_64
release-flags: --flag '--static -g -fbacktrace -O3'
- os: macos-13
os-arch: macos-x86_64
release-flags: --flag '-g -fbacktrace -O3'
- os: windows-latest
os-arch: windows-x86_64
release-flags: --flag '--static -g -fbacktrace -O3'
exe: .exe

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

- name: Install GFortran macOS
if: contains(matrix.os, 'macos')
run: |
ln -s /usr/local/bin/gfortran-${GCC_V} /usr/local/bin/gfortran
which gfortran-${GCC_V}
which gfortran
# Backport gfortran shared libraries to version 9 folder. This is necessary because all macOS releases of fpm
# have these paths hardcoded in the executable (no PIC?). As the gcc ABIs have not changed from 9 to 10, we
# can just create symbolic links for now. This can be removed when an updated fpm release is built with gcc-10
mkdir /usr/local/opt/gcc@9
mkdir /usr/local/opt/gcc@9/lib
mkdir /usr/local/opt/gcc@9/lib/gcc
mkdir /usr/local/opt/gcc@9/lib/gcc/9
mkdir /usr/local/lib/gcc/9
ln -fs /usr/local/opt/gcc@${GCC_V}/lib/gcc/${GCC_V}/libquadmath.0.dylib /usr/local/opt/gcc@9/lib/gcc/9/libquadmath.0.dylib
ln -fs /usr/local/opt/gcc@${GCC_V}/lib/gcc/${GCC_V}/libgfortran.5.dylib /usr/local/opt/gcc@9/lib/gcc/9/libgfortran.5.dylib
ln -fs /usr/local/lib/gcc/${GCC_V}/libgcc_s.1.dylib /usr/local/lib/gcc/9/libgcc_s.1.dylib
- name: Install GFortran Linux
if: contains(matrix.os, 'ubuntu')
run: |
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/gcov gcov /usr/bin/gcov-${GCC_V}
- name: Install GFortran Windows
if: contains(matrix.os, 'windows')
run: |
Invoke-WebRequest -Uri $Env:GCC_DOWNLOAD -OutFile mingw-w64.zip
Expand-Archive mingw-w64.zip
echo "$pwd\mingw-w64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
env:
GCC_DOWNLOAD: "https://github.com/brechtsanders/winlibs_mingw/releases/download/10.4.0-10.0.0-msvcrt-r1/winlibs-x86_64-posix-seh-gcc-10.4.0-mingw-w64msvcrt-10.0.0-r1.zip"
- name: Setup Fortran compiler
uses: fortran-lang/setup-fortran@v1.6.1
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}

# Phase 1: Bootstrap fpm with existing version
- name: Install fpm
uses: fortran-lang/setup-fpm@v5
with:
fpm-version: 'v0.8.0'

# Backport gfortran shared libraries to version 10 folder. This is necessary because the macOS release of fpm
# 0.10.0 used for bootstrapping has these paths hardcoded in the executable.
- name: MacOS patch libgfortran
if: contains(matrix.os, 'macos') && !contains(matrix.toolchain.version, '10')
run: |
which gfortran-${{ matrix.toolchain.version }}
which gfortran
mkdir /usr/local/opt/gcc@10
mkdir /usr/local/opt/gcc@10/lib
mkdir /usr/local/opt/gcc@10/lib/gcc
mkdir /usr/local/opt/gcc@10/lib/gcc/10
mkdir /usr/local/lib/gcc/10
ln -fs /usr/local/opt/gcc@${{ matrix.toolchain.version }}/lib/gcc/${{ matrix.toolchain.version }}/libquadmath.0.dylib /usr/local/opt/gcc@10/lib/gcc/10/libquadmath.0.dylib
ln -fs /usr/local/opt/gcc@${{ matrix.toolchain.version }}/lib/gcc/${{ matrix.toolchain.version }}/libgfortran.5.dylib /usr/local/opt/gcc@10/lib/gcc/10/libgfortran.5.dylib
ln -fs /usr/local/lib/gcc/${{ matrix.toolchain.version }}/libgcc_s.1.dylib /usr/local/lib/gcc/10/libgcc_s.1.dylib
# gcc and g++ will point to clang/clang++: use versioned alias for fpm
- name: MacOS patch C and C++ compilers
if: contains(matrix.os, 'macos')
run: |
echo "CC=gcc-${{ matrix.toolchain.version }}" >> $GITHUB_ENV
echo "FPM_CC=gcc-${{ matrix.toolchain.version }}" >> $GITHUB_ENV
echo "CXX=g++-${{ matrix.toolchain.version }}" >> $GITHUB_ENV
echo "FPM_CXX=g++-${{ matrix.toolchain.version }}" >> $GITHUB_ENV
echo "FPM_LDFLAGS=-lstdc++" >> $GITHUB_ENV
- name: Remove fpm from path
shell: bash
run: |
@@ -139,11 +141,6 @@ jobs:
env:
REGEX: '[0-9]\{1,4\}\.[0-9]\{1,4\}\.[0-9]\{1,4\}'

- name: Build example packages
shell: bash
run: |
ci/run_tests.sh "${{ env.FPM }}"
- name: Build Fortran fpm
shell: bash
run: |
@@ -173,15 +170,15 @@ jobs:
rm -v ${{ env.FPM }}
echo "FPM_RELEASE=${{ env.EXE }}" >> $GITHUB_ENV
env:
EXE: fpm-${{ env.VERSION }}-${{ matrix.os-arch }}${{ matrix.exe }}
EXE: fpm-${{ env.VERSION }}-${{ matrix.os-arch }}-gcc-${{ matrix.toolchain.version }}${{ matrix.exe }}

- name: Run release version
shell: bash
run: |
ci/run_tests.sh "$PWD/${{ env.FPM_RELEASE }}"
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ env.FPM_RELEASE }}
path: ${{ env.FPM_RELEASE }}
@@ -192,14 +189,19 @@ jobs:
runs-on: windows-latest
needs:
- build
strategy:
fail-fast: false
matrix:
gcc_v: [11,12,13]

steps:
- uses: actions/checkout@v4

- name: Download Artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
path: ${{ github.workspace }} # This will download all files
path: ${{ github.workspace }}
pattern: fpm-*-windows-*-gcc-${{ matrix.gcc_v }}.exe

- name: Get version (normal)
if: github.event_name != 'release'
@@ -229,7 +231,7 @@ jobs:
- name: Fetch Windows executable
shell: msys2 {0}
run: |
cp fpm-*/fpm*.exe ./ci/fpm.exe
cp fpm-*/fpm-*-windows-*-gcc-${{ matrix.gcc_v }}.exe ./ci/fpm.exe
- name: Fetch Git for Windows
shell: msys2 {0}
@@ -254,13 +256,13 @@ jobs:
run: |
cd ./ci
makensis fpm-installer.nsi
move fpm-installer.exe fpm-installer-${{ env.VERSION }}.exe
move fpm-installer.exe fpm-installer-${{ env.VERSION }}-gcc-${{ matrix.gcc_v }}.exe
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: fpm-installer
path: ci/fpm-installer-${{ env.VERSION }}.exe
name: fpm-installer-gcc-${{ matrix.gcc_v }}
path: ci/fpm-installer-${{ env.VERSION }}-gcc-${{ matrix.gcc_v }}.exe

upload-artifacts:
if: ${{ github.event_name == 'release' && contains(github.ref, 'v') || github.event_name == 'push' }}
@@ -281,27 +283,27 @@ jobs:
if: ${{ github.event_name == 'push' }}

- name: Download Artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
path: ${{ github.workspace }} # This will download all files
path: fpm-cd-artifacts
pattern: 'fpm-*-gcc-12*'
merge-multiple: true

- name: Normalize file names for continuous delivery
if: ${{ github.event_name == 'push' }}
run: |
for output in fpm-*/fpm*; do
pushd $(dirname "$output")
cd fpm-cd-artifacts
for output in fpm-*; do
mv -v $(basename $output) $(basename $output | sed -E '${{ env.replace }}')
popd
done
env:
replace: 's/-([0-9]+\.[0-9]+\.[0-9]+-[0-9]+-g)?[0-9a-f]+//'

- name: Create SHA256 checksums
run: |
for output in fpm-*/fpm*; do
pushd $(dirname "$output")
cd fpm-cd-artifacts
for output in fpm-*; do
sha256sum $(basename "$output") | tee $(basename "$output").sha256
popd
done
- name: Move/Create continuous tag
@@ -315,7 +317,7 @@ jobs:
if: ${{ github.event_name == 'release' || steps.deploy-on-push.outputs.result != 0 }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: fpm-*/fpm*
file: fpm-cd-artifacts/*
file_glob: true
tag: ${{ github.event_name == 'release' && github.ref || 'current'}}
overwrite: true
62 changes: 41 additions & 21 deletions .github/workflows/meta.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
name: metapackage-tests

on:
# On push, only run if any of the metapackage files has changed
push:
paths:
- 'src/*meta*.f90' # On push, only launch job if something has changed in the metapackages
- 'src/*meta*.f90'
- 'src/fpm/*meta*.f90'
- 'src/fpm/manifest/*meta*.f90'
- 'src/ci/meta_tests.sh'
- 'src/.github/workflows/meta.yml'
# Always run on PR or release
pull_request:
release:
types: [published]
# Allow manual triggering
workflow_dispatch:

env:
CI: "ON" # We can detect this in the build system and other vendors implement it
@@ -35,25 +39,20 @@ jobs:
mpi: openmpi
- os: ubuntu-latest
mpi: mpich
- os: macos-latest
- os: macos-13
mpi: openmpi
- os: macos-latest
- os: macos-13
mpi: mpich


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

- name: (Ubuntu) setup gcc version
if: contains(matrix.os,'ubuntu')
run: |
echo "GCC_V=10" >> $GITHUB_ENV
- name: (macOS) setup gcc version
if: contains(matrix.os,'macos')
run: |
echo "GCC_V=13" >> $GITHUB_ENV
- name: (Ubuntu/macOS) setup gcc version
if: contains(matrix.os,'ubuntu') || contains(matrix.os,'macos')
run: |
echo "GCC_V=14" >> $GITHUB_ENV
- name: (Windows) Install MSYS2
uses: msys2/setup-msys2@v2
@@ -67,6 +66,7 @@ jobs:
wget
unzip
curl
hdf5
- name: (Windows) Setup VS Build environment
if: contains(matrix.os,'windows') && contains(matrix.mpi,'intel')
@@ -93,12 +93,14 @@ jobs:
- name: (Ubuntu) Install OpenMPI
if: contains(matrix.os,'ubuntu') && contains(matrix.mpi,'openmpi')
run: |
sudo apt install -y -q openmpi-bin libopenmpi-dev
sudo apt-get update
sudo apt install -y -q openmpi-bin libopenmpi-dev hwloc fabric libhdf5-dev libhdf5-fortran-102
- name: (Ubuntu) Install MPICH
if: contains(matrix.os,'ubuntu') && contains(matrix.mpi,'mpich')
run: |
sudo apt install -y -q mpich
sudo apt-get update
sudo apt install -y -q mpich hwloc fabric libhdf5-dev libhdf5-fortran-102
- name: (Ubuntu) Retrieve Intel toolchain
if: contains(matrix.os,'ubuntu') && contains(matrix.mpi,'intel')
@@ -110,14 +112,27 @@ jobs:
- name: (Ubuntu) Install Intel oneAPI
if: contains(matrix.os,'ubuntu') && contains(matrix.mpi,'intel')
timeout-minutes: 15
run: sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-2023.1.0 intel-oneapi-compiler-fortran-2023.1.0 intel-oneapi-mpi-devel ninja-build
uses: fortran-lang/setup-fortran@v1.6.1
id: setup-fortran
with:
compiler: intel
version: 2024.1.0

- name: (Ubuntu) Setup Intel oneAPI environment
- name: (Ubuntu) finalize oneAPI environment
if: contains(matrix.os,'ubuntu') && contains(matrix.mpi,'intel')
run: |
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
# Install MPI
sudo apt-get install -y -q intel-oneapi-mpi-devel ninja-build cmake
source /opt/intel/oneapi/setvars.sh --force
printenv >> $GITHUB_ENV
# To run HDF5 with oneAPI, we need to build it from source. Use CMake to generate pkg-config info
curl -O -L https://github.com/HDFGroup/hdf5/archive/refs/tags/snapshot-1.14.tar.gz
tar zxf snapshot-1.14.tar.gz
cd hdf5-snapshot-1.14
cmake -B build -DCMAKE_Fortran_COMPILER=ifx -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DHDF5_BUILD_FORTRAN=ON -DCMAKE_INSTALL_PREFIX=/usr
cd build
make -j
sudo make install
- name: (Windows) Put MSYS2_MinGW64 on PATH
if: contains(matrix.os,'windows') && (!contains(matrix.mpi,'intel'))
@@ -197,6 +212,11 @@ jobs:
run: |
brew install openmpi #--cc=gcc-${{ env.GCC_V }} openmpi
- name: (macOS) Install homebrew HDF5
if: contains(matrix.os,'macos')
run: |
brew install hdf5
# Phase 1: Bootstrap fpm with existing version
- name: Install fpm
uses: fortran-lang/setup-fpm@v5
@@ -209,8 +229,8 @@ jobs:
mv $(which fpm) fpm-bootstrap${{ matrix.exe }}
echo "BOOTSTRAP=$PWD/fpm-bootstrap" >> $GITHUB_ENV
- name: (macOS) Use gcc/g++ instead of Clang for C/C++
if: contains(matrix.os,'macOS')
- name: (macOS/Ubuntu) Use gcc/g++ instead of Clang for C/C++ / ifx to build fpm
if: contains(matrix.os,'macOS') || contains(matrix.os,'ubuntu')
shell: bash
run: |
echo "FPM_FC=gfortran-${{ env.GCC_V }}" >> $GITHUB_ENV
Loading