Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metapackages #859

Merged
merged 218 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
218 commits
Select commit Hold shift + click to select a range
a578504
Create `metapackage_t` base structure
perazz Mar 23, 2023
ba28423
build config: introduce "openmp" flag and metapackages variable
perazz Mar 23, 2023
0c4cf38
generate metapackages on new_build_config
perazz Mar 23, 2023
0082446
remove unused circular dependency from fpm_compiler.f90
perazz Mar 23, 2023
24ced5a
add default openmp flags; return human-readable compiler name
perazz Mar 23, 2023
222aa2a
remove built metapackages from the build config
perazz Mar 23, 2023
9854e2d
compiler name: make it `character(:), allocatable`
perazz Mar 23, 2023
59a9d73
code openmp compiler flags
perazz Mar 23, 2023
53799ab
basic metapackage resolution
perazz Mar 23, 2023
0292363
openmp metapackage is now resolved
perazz Mar 23, 2023
7312a99
add openmp example program
perazz Mar 23, 2023
62bc573
add openmp test to CI
perazz Mar 23, 2023
19dd707
add `stdlib` support flag
perazz Mar 30, 2023
0bcad12
metapackage_t: add support for dependencies/dev-dependencies
perazz Mar 30, 2023
2f377b1
fix use
perazz Mar 30, 2023
3cf0000
metapackage dependencies are all dev-dependencies
perazz Mar 30, 2023
58dff6c
add stdlib metapackage dependencies
perazz Mar 30, 2023
1ee338e
compiler flags: refactor into a subroutine
perazz Mar 30, 2023
ebc8156
package dependencies: reorganize code so they're done at the same time
perazz Mar 30, 2023
53d4ae7
fix: move down .gitignore
perazz Mar 30, 2023
bdfd25a
move all metapackages resolution to `fpm_meta.f90`, cleanup `fpm.f90`
perazz Mar 30, 2023
029fee3
warn users for simultaneous openMP+stdlib dependencies
perazz Mar 30, 2023
b504db8
add test and CI
perazz Mar 30, 2023
c8a7ce8
restore CI
perazz Mar 30, 2023
250c2fb
Merge branch 'fortran-lang:main' into metapackages
perazz Apr 3, 2023
db0e470
create metapackages config
perazz Apr 3, 2023
c09f16b
introduce MPI keyword
perazz Apr 3, 2023
ce02cbe
write MPI Fortran test program
perazz Apr 3, 2023
de84fe8
C MPI test program
perazz Apr 3, 2023
29be62f
add C++ test program; cleanup
perazz Apr 3, 2023
a77504b
add MPI option; inactive
perazz Apr 3, 2023
6049c64
fix exe name
perazz Apr 3, 2023
39cdeeb
attempt several MPI wrappers and filter out the invalid ones
perazz Apr 3, 2023
0fd030d
remove [metapackages]; move meta to [dependencies]
perazz Apr 4, 2023
66477b1
update example packages
perazz Apr 4, 2023
6d74267
generalize MPI wrapper test
perazz Apr 6, 2023
b099461
identify OpenMPI wrappers
perazz Apr 6, 2023
e2792d9
get libraries, include directories, linking directories from OpenMPI …
perazz Apr 6, 2023
1a39ade
simplify to build/link flags (link dirs not supported by fpm)
perazz Apr 6, 2023
9a56db6
remove new line characters from the wrapper flags
perazz Apr 6, 2023
ff2744c
remove link directories (not supported by fpm)
perazz Apr 6, 2023
8ae464e
add fortran-regex dependency
perazz Apr 6, 2023
e456509
query OpenMPI version and save in metapackage_t
perazz Apr 6, 2023
f8a7efd
Merge branch 'main' into metapackages
perazz Apr 20, 2023
39ae27d
fix merged CI Script
perazz Apr 20, 2023
82e268d
MS-MPI: search for paths, resolve paths with spaces to DOS
perazz Apr 20, 2023
d5ef9d6
fix MS-MPI paths
perazz Apr 20, 2023
f5125e9
allow invalid BOZ in mpif.h with gfortran
perazz Apr 20, 2023
b354bc3
typo
perazz Apr 20, 2023
c3bc23c
allow implicit typing in example package
perazz Apr 20, 2023
9eaf1c8
split in MSYS2 / non-MSYS2 cases
perazz Apr 20, 2023
4ce83a7
MS-MPI build via MSYS2 completed
perazz Apr 20, 2023
4f450f8
fix truncated line
perazz Apr 20, 2023
376e3b8
Check MS-MPI runtime present; add run command
perazz Apr 20, 2023
b95c9f4
add MPI runner to settings%runner
perazz Apr 20, 2023
b0ca7f8
add runner wrapper for `mpiexec -np *`: works!
perazz Apr 20, 2023
a40bda0
fix openmpi compiler wrapper
perazz Apr 21, 2023
e5ceb06
update regex dependency
perazz Apr 21, 2023
7dc2b94
implement OpenMPI runner command
perazz Apr 21, 2023
e8576a0
make flags language-specific (Fortran, C, C++)
perazz Apr 21, 2023
82d03c5
fix: language flags
perazz Apr 21, 2023
7076f9f
improve verbose outout
perazz Apr 21, 2023
92507c3
identify MPICH wrappers
perazz Apr 21, 2023
01e3a7f
implement MPICH commands
perazz Apr 21, 2023
c625cf1
pass flags to c++ on mixed compilers
perazz Apr 21, 2023
079a197
create metapackage workflow
perazz Apr 21, 2023
f8ee6f8
remove non-mac tests
perazz Apr 21, 2023
40139ba
setup homebrew
perazz Apr 21, 2023
3d49f46
indent
perazz Apr 21, 2023
4dbf006
install gcc
perazz Apr 21, 2023
611a6d7
Update meta.yml
perazz Apr 21, 2023
aea4ef0
Update meta.yml
perazz Apr 21, 2023
fbd312b
check gfortran gfortran-10
perazz Apr 21, 2023
3d967b7
Update meta.yml
perazz Apr 21, 2023
5a22980
install mpich
perazz Apr 21, 2023
5e6f3b6
add homebrew OpenMPI case
perazz Apr 21, 2023
1406197
add windows image
perazz Apr 21, 2023
9e6d0ec
add MSMPI type
perazz Apr 21, 2023
5785c3d
duplicate ifs
perazz Apr 21, 2023
bf22172
reduce matrix
perazz Apr 21, 2023
7bff6fa
Revert "reduce matrix"
perazz Apr 21, 2023
53a2096
reduce matrix
perazz Apr 21, 2023
aaa5195
improve windows CI
perazz Apr 21, 2023
1309f50
Update meta.yml
perazz Apr 21, 2023
b7879bf
use windows-latest
perazz Apr 21, 2023
391b405
Update meta.yml
perazz Apr 21, 2023
20c6cba
change order
perazz Apr 21, 2023
85e3565
install msmpi
perazz Apr 21, 2023
7518c81
fix $PATH
perazz Apr 21, 2023
3e5de37
fix path
perazz Apr 21, 2023
87ed9c6
search in Windows %PATH%
perazz Apr 21, 2023
6d1a6ec
do not look for msmpi.dll
perazz Apr 21, 2023
918336d
fix bindir
perazz Apr 21, 2023
a3184ad
output path in case it is not a dir
perazz Apr 21, 2023
847765d
do not use `canon_path`: returns inverse slashes on WSL!
perazz Apr 21, 2023
1e6f8bc
fix WSL paths
perazz Apr 21, 2023
e9a4ceb
Only launch job if any metapackage source files have changed
perazz Apr 21, 2023
43b670e
remove unnecessary verbosity
perazz Apr 21, 2023
8d6cc28
Revert "remove unnecessary verbosity"
perazz Apr 21, 2023
53719bf
fix run api
perazz Apr 21, 2023
b7c71e3
add ubuntu
perazz Apr 27, 2023
3632e1d
unix -fpp macro fix
perazz Apr 27, 2023
831f284
base ifort implementation
perazz Apr 27, 2023
ecc2916
bump fortran-regex to 1.1.2 due to ifort issue
perazz Apr 27, 2023
f738753
add 'runner' task
perazz Apr 27, 2023
60a33a2
simplify compiler path search
perazz Apr 27, 2023
c2d444b
remove compiler prefix for C, C++
perazz Apr 27, 2023
1cad824
fix linker flags for ifort with c/c++ main program
perazz Apr 27, 2023
929d9cf
Merge branch 'main' into metapackages
perazz Apr 27, 2023
f6e93ec
introduce ubuntu+intelmpi
perazz Apr 27, 2023
13850e6
install mpi sdk
perazz Apr 27, 2023
f2aec4b
install as sudo
perazz Apr 27, 2023
9b87b08
use Intel Classic action
perazz May 2, 2023
a319e80
use ifort compiler
perazz May 2, 2023
557b5f7
export custom compiler via `FPM_FC`
perazz May 2, 2023
0eb4f7f
Update meta.yml
perazz May 2, 2023
0499185
Update meta.yml
perazz May 2, 2023
cd3dd01
local env
perazz May 2, 2023
9feec04
Update meta.yml
perazz May 2, 2023
c17c3ff
Update meta.yml
perazz May 2, 2023
a5ba917
Update meta.yml
perazz May 2, 2023
0e24c34
use $FC
perazz May 2, 2023
1269d72
Update meta.yml
perazz May 2, 2023
20a3416
export all intel vars
perazz May 2, 2023
b426f34
IntelMPI: enable search via `I_MPI_ROOT`
perazz May 2, 2023
1330d84
use standard Intel compiler
perazz May 2, 2023
20d0b30
intel-classic 2023.0
perazz May 2, 2023
b403264
2022.0.2
perazz May 2, 2023
3d539e1
2021.1.1
perazz May 2, 2023
ef57e4f
install mpi
perazz May 2, 2023
eb02be5
install mpi as sudo
perazz May 2, 2023
9c8ff2f
download latest api
perazz May 2, 2023
ec2d800
ifort: export FPM compiler flags
perazz May 2, 2023
83bb67b
ifort compiler fixes: test_manifest.f90
perazz May 2, 2023
f7ee4fa
do not bootstrap FPM with Ifort
perazz May 2, 2023
0ce5e08
do not override $FPM_FC
perazz May 2, 2023
0c584cb
test ubuntu+openmpi
perazz May 2, 2023
c7e5a51
add verbosity
perazz May 2, 2023
f739665
request implicit typing
perazz May 2, 2023
9c2bc68
Update meta.yml
perazz May 2, 2023
c39ef5a
add feature flags to the linker
perazz May 2, 2023
a85c3bd
Revert "add feature flags to the linker"
perazz May 2, 2023
8efb375
restore mac builds
perazz May 2, 2023
82b992b
GCC: do not care about linker order
perazz May 2, 2023
8b992dc
intel crash fix
perazz May 2, 2023
ee3fb61
restore ubuntu openmpi
perazz May 2, 2023
83f6a79
C, C++ examples: add implicit features
perazz May 2, 2023
812edce
ubuntu MPICH
perazz May 2, 2023
cf986e3
print version line
perazz May 2, 2023
caf0dc1
wrap version string extractor
perazz May 2, 2023
25ac71f
fix linker library order for mac
perazz May 2, 2023
59c5dbd
start-group
perazz May 2, 2023
04a7024
activate windows + msmpi
perazz May 2, 2023
c958e37
cleanup debugging messages
perazz May 2, 2023
f724a26
test msmpi
perazz May 2, 2023
c608c96
cleanup
perazz May 2, 2023
4ca8e8d
try both which, where on WSL
perazz May 2, 2023
0ff6be9
fix verbose
perazz May 2, 2023
3feaae3
cleanup MPI wrapper function
perazz May 3, 2023
08ed7e6
regex version: move to `fpm_versioning`
perazz May 3, 2023
cd2a02f
remove_newline_characters: move to `fpm_strings`
perazz May 3, 2023
da1a585
test macOS only
perazz May 3, 2023
a0f0f59
env syntax
perazz May 3, 2023
fc580e3
restore MPICH+macOS, set gcc for C/C++
perazz May 3, 2023
d9aa848
remove link gfortran-10
perazz May 3, 2023
8a273e7
print version
perazz May 3, 2023
c1cfbd5
use all gcc-13 compilers
perazz May 3, 2023
c966c3d
missing $
perazz May 3, 2023
4766e1b
get_dos_path: move to `fpm_filesystem`
perazz May 3, 2023
9184cbf
dummy links to gcc-9 for bootstrapping
perazz May 3, 2023
0611616
fpm bootstrap needs gcc-10
perazz May 3, 2023
3d2f242
remove metapackages from the standard tests
perazz May 3, 2023
36770e5
restore other os/MPI configs
perazz May 3, 2023
8a3e375
gcc-13 not available on Ubuntu-latest
perazz May 3, 2023
beab356
switch GCC_V
perazz May 3, 2023
b695b70
Windows: also check in the default Microsoft MPI folder
perazz May 3, 2023
750f0d2
Implement wildcard `"*"`
perazz May 3, 2023
3ad4222
set MSMPI_BIN
perazz May 3, 2023
a707c00
remove return
perazz May 3, 2023
40f2522
fix MS-MPI 10.1.2 link
perazz May 3, 2023
2212c66
windows Intel CI init
perazz May 4, 2023
84202de
Update meta.yml
perazz May 4, 2023
6540d56
use intel action
perazz May 4, 2023
19e4c02
Update meta.yml
perazz May 4, 2023
a4ac1db
Download Intel OneAPI installer
perazz May 5, 2023
ace990e
finish installing, delete temp
perazz May 5, 2023
fc12ee9
Update meta.yml
perazz May 5, 2023
c75d990
install
perazz May 5, 2023
fb0ad93
add environment variables
perazz May 5, 2023
ebd2331
set Intel environment
perazz May 5, 2023
dd90f55
turn off Intel + Windows action for now
perazz May 6, 2023
fadc272
do not run fpm tests with Intel compiler here
perazz May 6, 2023
5cbc90a
Update meta.yml
perazz May 6, 2023
76b34ea
metapackage manifests shortened
perazz May 7, 2023
c350228
Address reviews
perazz May 11, 2023
aa96545
Merge branch 'main' into metapackages
perazz May 11, 2023
0b4ad66
merging fix
perazz May 11, 2023
2ebb568
(macOS) only install gfortran if not already available
perazz May 11, 2023
69f0650
use libgcc_s.1.1.dylib if libgcc_s.1.dylib not available (gcc>=13)
perazz May 11, 2023
f3b76a4
Update meta.yml
perazz May 11, 2023
2f497aa
macOS test
perazz May 11, 2023
4855192
Update meta.yml
perazz May 11, 2023
5d664a4
Update meta.yml
perazz May 11, 2023
2f1e3a9
fix link to gfortran
perazz May 11, 2023
02adf0f
restore all environments
perazz May 11, 2023
ce8334a
test windows only
perazz May 11, 2023
1db2549
increase line buffer length to Windows max
perazz May 11, 2023
9977834
restore all environments
perazz May 11, 2023
79373b9
MS_MPI: make DOS path
perazz May 11, 2023
7dca2e8
add many checks
perazz May 11, 2023
0fcca0e
echo runner folder
perazz May 11, 2023
1a948be
refactor windows search
perazz May 11, 2023
bad1556
Update fpm_meta.f90
perazz May 11, 2023
f8e13ee
cleanup debugging prints
perazz May 11, 2023
69d26bf
fortran-lang `minpack`
perazz May 25, 2023
f3f4d41
Merge branch 'main' into metapackages
perazz May 25, 2023
6d6411c
always search `.exe` runner versions
perazz May 25, 2023
24bdea2
Merge branch 'metapackages' of https://github.com/perazz/fpm into met…
perazz May 25, 2023
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
310 changes: 310 additions & 0 deletions .github/workflows/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,310 @@
name: metapackage-tests

on:
push:
paths:
- 'src/*meta*.f90' # On push, only launch job if something has changed in the metapackages
- 'src/fpm/*meta*.f90'
- 'src/fpm/manifest/*meta*.f90'
- 'src/ci/meta_tests.sh'
- 'src/.github/workflows/meta.yml'
pull_request:
release:
types: [published]

env:
CI: "ON" # We can detect this in the build system and other vendors implement it
HOMEBREW_NO_ANALYTICS: "ON" # Make Homebrew installation a little quicker
HOMEBREW_NO_AUTO_UPDATE: "ON"
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: "ON"
HOMEBREW_NO_GITHUB_API: "ON"
HOMEBREW_NO_INSTALL_CLEANUP: "ON"

jobs:

build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
mpi: intel
- os: ubuntu-latest
mpi: openmpi
- os: ubuntu-latest
mpi: mpich
- os: windows-latest
mpi: msmpi
- os: macos-latest
mpi: openmpi
- os: macos-latest
mpi: mpich


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

- 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: (Windows) Install MSYS2
uses: msys2/setup-msys2@v2
if: contains(matrix.os,'windows') && contains(matrix.mpi,'msmpi')
with:
msystem: MINGW64
update: true
install: >-
git
base-devel
wget
unzip
curl
gcc-fortran

- name: (Windows) Setup VS Build environment
if: contains(matrix.os,'windows') && contains(matrix.mpi,'intel')
uses: seanmiddleditch/gha-setup-vsdevenv@master

- name: (Windows) Retrieve Intel toolchain
if: contains(matrix.os,'windows') && contains(matrix.mpi,'intel')
shell: pwsh
working-directory: C:\TEMP
run: |
curl.exe --output webimage.exe --url https://registrationcenter-download.intel.com/akdlm/irc_nas/19085/w_HPCKit_p_2023.0.0.25931_offline.exe --retry 5 --retry-delay 5
Start-Process -FilePath "webimage.exe" -ArgumentList "-s -x -f oneAPI --log extract.log" -Wait
Remove-Item "webimage.exe" -Force
Start-Process -FilePath "oneAPI\bootstrapper.exe" -ArgumentList "-s --action install --eula=accept --components=""intel.oneapi.win.cpp-compiler:intel.oneapi.win.ifort-compiler:intel.oneapi.win.mpi.devel"" -p=NEED_VS2017_INTEGRATION=0 -p=NEED_VS2019_INTEGRATION=0 -p=NEED_VS2022_INTEGRATION=0 --log-dir=." -Wait
Remove-Item "oneAPI" -Force -Recurse

- name: (Ubuntu) Install gfortran
if: contains(matrix.os,'ubuntu') && (!contains(matrix.mpi,'intel'))
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: (Ubuntu) Install OpenMPI
if: contains(matrix.os,'ubuntu') && contains(matrix.mpi,'openmpi')
run: |
sudo apt install -y -q openmpi-bin libopenmpi-dev

- name: (Ubuntu) Install MPICH
if: contains(matrix.os,'ubuntu') && contains(matrix.mpi,'mpich')
run: |
sudo apt install -y -q mpich

- name: (Ubuntu) Retrieve Intel toolchain
if: contains(matrix.os,'ubuntu') && contains(matrix.mpi,'intel')
timeout-minutes: 1
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: (Ubuntu) Install Intel oneAPI
if: contains(matrix.os,'ubuntu') && contains(matrix.mpi,'intel')
timeout-minutes: 5
run: sudo apt-get install intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-mpi intel-oneapi-mpi-devel intel-oneapi-mkl ninja-build

- name: (Ubuntu) Setup Intel oneAPI environment
if: contains(matrix.os,'ubuntu') && contains(matrix.mpi,'intel')
run: |
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV

- name: (Windows) Put MSYS2_MinGW64 on PATH
if: contains(matrix.os,'windows') && (!contains(matrix.mpi,'intel'))
# there is not yet an environment variable for this path from msys2/setup-msys2
run: echo "${{ runner.temp }}/msys64/mingw64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: (Windows) download MS-MPI setup (SDK is from MSYS2)
if: contains(matrix.os,'windows') && contains(matrix.mpi,'msmpi')
# run: curl -L -O https://github.com/microsoft/Microsoft-MPI/releases/download/v10.1.2/msmpisetup.exe 10.1.1
run: curl -L -O https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623/msmpisetup.exe # 10.1.2

- name: (Windows) Install mpiexec.exe (-force needed to bypass GUI on headless)
if: contains(matrix.os,'windows') && contains(matrix.mpi,'msmpi')
run: .\msmpisetup.exe -unattend -force

- name: (Windows) test that mpiexec.exe exists
if: contains(matrix.os,'windows') && contains(matrix.mpi,'msmpi')
# can't use MSMPI_BIN as Actions doesn't update PATH from msmpisetup.exe
run: Test-Path "C:\Program Files\Microsoft MPI\Bin\mpiexec.exe" -PathType leaf

- name: (Windows) test that OneAPI is installed
if: contains(matrix.os,'windows') && contains(matrix.mpi,'intel')
run: |
Test-Path -Path "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" -PathType leaf
Test-Path -Path "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\env\vars.bat" -PathType leaf

- name: (Windows) put MSMPI_BIN on PATH (where mpiexec is)
if: contains(matrix.os,'windows') && contains(matrix.mpi,'msmpi')
run: |
echo "C:\Program Files\Microsoft MPI\Bin\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "MSMPI_BIN=C:\Program Files\Microsoft MPI\Bin\" | Out-File -FilePath $env:GITHUB_ENV -Append

- name: (Windows) load OneAPI environment variables
if: contains(matrix.os,'windows') && contains(matrix.mpi,'intel')
shell: cmd
run: |
"C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
"C:\Program Files (x86)\Intel\oneAPI\compiler\latest\env\vars.bat"

- name: (Windows) Install MSYS2 msmpi package
if: contains(matrix.os,'windows') && contains(matrix.mpi,'msmpi')
shell: msys2 {0}
run: pacman --noconfirm -S mingw-w64-x86_64-msmpi

- name: (macOS) Set up Homebrew
if: contains(matrix.os,'macos')
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: (macOS) Install Homebrew gfortran
if: contains(matrix.os, 'macos')
run: |
# Only install gcc if not already available
which gfortran-${{ env.GCC_V }} || brew install gcc@${{ env.GCC_V }}
which gfortran-${{ env.GCC_V }}
which gfortran || ln -s /usr/local/bin/gfortran-${{ env.GCC_V }} /usr/local/bin/gfortran
# Backport gfortran shared libraries to version 10 folder. This is necessary because all macOS releases of fpm
# have these paths hardcoded in the executable (no PIC?). Current bootstrap version 0.8.0 has gcc-10
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@${{ env.GCC_V }}/lib/gcc/${{ env.GCC_V }}/libquadmath.0.dylib /usr/local/opt/gcc@10/lib/gcc/10/libquadmath.0.dylib
ln -fs /usr/local/opt/gcc@${{ env.GCC_V }}/lib/gcc/${{ env.GCC_V }}/libgfortran.5.dylib /usr/local/opt/gcc@10/lib/gcc/10/libgfortran.5.dylib
# Newer gcc versions use libgcc_s.1.1.dylib
ln -fs /usr/local/lib/gcc/${{ env.GCC_V }}/libgcc_s.1.dylib /usr/local/lib/gcc/10/libgcc_s.1.dylib || ln -fs /usr/local/lib/gcc/${{ env.GCC_V }}/libgcc_s.1.1.dylib /usr/local/lib/gcc/10/libgcc_s.1.dylib

- name: (macOS) Install homebrew MPICH
if: contains(matrix.mpi,'mpich') && contains(matrix.os,'macos')
run: |
brew install mpich

- name: (macOS) Install homebrew OpenMPI
if: contains(matrix.mpi,'openmpi') && contains(matrix.os,'macos')
run: |
brew install --cc=gcc-${{ env.GCC_V }} openmpi

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

- name: Remove fpm from path
shell: bash
run: |
mv $(which fpm) fpm-bootstrap${{ matrix.exe }}
echo "BOOTSTRAP=$PWD/fpm-bootstrap" >> $GITHUB_ENV

- name: Use Intel compiler for the metapackage tests
if: contains(matrix.mpi,'intel')
shell: bash
run: |
echo "FPM_FC=ifort" >> $GITHUB_ENV
echo "FPM_CC=icc" >> $GITHUB_ENV
echo "FPM_CXX=icpc" >> $GITHUB_ENV

- name: (macOS) Use gcc/g++ instead of Clang for C/C++
if: contains(matrix.os,'macOS')
shell: bash
run: |
echo "FPM_FC=gfortran-${{ env.GCC_V }}" >> $GITHUB_ENV
echo "FPM_CC=gcc-${{ env.GCC_V }}" >> $GITHUB_ENV
echo "FPM_CXX=g++-${{ env.GCC_V }}" >> $GITHUB_ENV

- name: Build Fortran fpm (bootstrap)
shell: bash
run: |
${{ env.BOOTSTRAP }} build

- name: Run Fortran fpm (bootstrap)
shell: bash
run: |
${{ env.BOOTSTRAP }} run
${{ env.BOOTSTRAP }} run -- --version
${{ env.BOOTSTRAP }} run -- --help

- name: Test Fortran fpm (bootstrap)
if: (!contains(matrix.mpi,'intel'))
shell: bash
run: |
${{ env.BOOTSTRAP }} test

- name: Install Fortran fpm (bootstrap)
shell: bash
run: |
${{ env.BOOTSTRAP }} install

# Phase 2: Bootstrap fpm with itself
- name: Replace bootstrapping version
shell: bash
run: |
${{ env.BOOTSTRAP }} run --runner cp -- fpm-debug${{ matrix.exe }}
rm -v ${{ env.BOOTSTRAP }}
echo "FPM=$PWD/fpm-debug" >> $GITHUB_ENV

- name: Get version (normal)
if: github.event_name != 'release'
shell: bash
run: |
VERSION=$(git rev-parse --short HEAD)
echo "VERSION=$VERSION" >> $GITHUB_ENV

- name: Get version (release)
if: github.event_name == 'release'
shell: bash
run: |
VERSION=$(echo ${{ github.ref }} | cut -dv -f2)
echo "VERSION=$VERSION" >> $GITHUB_ENV
FPM_VERSION=$(${{ env.FPM }} --version | grep -o '${{ env.REGEX }}')
[ "$VERSION" = "$FPM_VERSION" ]
env:
REGEX: '[0-9]\{1,4\}\.[0-9]\{1,4\}\.[0-9]\{1,4\}'

- name: Build Fortran fpm
shell: bash
run: |
${{ env.FPM }} build ${{ matrix.release-flags }}

- name: Run Fortran fpm
shell: bash
run: |
${{ env.FPM }} run ${{ matrix.release-flags }}
${{ env.FPM }} run ${{ matrix.release-flags }} -- --version
${{ env.FPM }} run ${{ matrix.release-flags }} -- --help

- name: Install Fortran fpm
shell: bash
run: |
${{ env.FPM }} install ${{ matrix.release-flags }}

- name: Package release version
shell: bash
run: |
${{ env.FPM }} run ${{ matrix.release-flags }} --runner cp -- ${{ env.EXE }}
rm -v ${{ env.FPM }}
echo "FPM_RELEASE=${{ env.EXE }}" >> $GITHUB_ENV
env:
EXE: fpm-${{ env.VERSION }}-${{ matrix.os-arch }}${{ matrix.exe }}

- name: Run metapackage tests using the release version
shell: bash
run: |
ci/meta_tests.sh "$PWD/${{ env.FPM_RELEASE }}"

46 changes: 46 additions & 0 deletions ci/meta_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env bash
set -ex

# ***********************
# This script tests all example packages using any metapackage/system dependencies
# ***********************

cd "$(dirname $0)/.."

if [ "$1" ]; then
fpm="$1"
else
fpm=fpm
fi

# Build example packages
pushd example_packages/
rm -rf ./*/build

pushd metapackage_openmp
"$fpm" build --verbose
"$fpm" run --verbose
popd

pushd metapackage_stdlib
"$fpm" build --verbose
"$fpm" run --verbose
popd

pushd metapackage_minpack
"$fpm" build --verbose
"$fpm" run --verbose
popd

pushd metapackage_mpi
"$fpm" build --verbose
"$fpm" run --verbose
popd

pushd metapackage_mpi_c
"$fpm" build --verbose
"$fpm" run --verbose
popd

# Cleanup
rm -rf ./*/build
7 changes: 7 additions & 0 deletions example_packages/metapackage_minpack/app/main.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
program main
use metapackage_minpack, only: simple_test
implicit none
logical :: success
call simple_test(success)
stop merge(0,1,success)
end program main
2 changes: 2 additions & 0 deletions example_packages/metapackage_minpack/fpm.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name = "metapackage_minpack"
dependencies.minpack="*"
14 changes: 14 additions & 0 deletions example_packages/metapackage_minpack/src/metapackage_minpack.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module metapackage_minpack
use minpack_module, only: wp
use iso_fortran_env, only: real64
implicit none
private

public :: simple_test
contains
subroutine simple_test(success)
logical, intent(out) :: success
! Success! can read minpack module
success = wp == real64
end subroutine simple_test
end module metapackage_minpack
7 changes: 7 additions & 0 deletions example_packages/metapackage_mpi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# test_mpi
This test program prints the running thread ID using MPI.
PLEASE NOTE:
- Test app uses 'mpif.h' and not 'use mpi' or 'use mpi_f08' because the latter are compiler-dependent,
and the MPI implementation on the local machine may not offer an implementation for them with the same
compiler that fpm is using.
- Using mpif.h will be the most backward compatible and platform agnostic
Loading