Skip to content

Commit 699e64b

Browse files
Add FPM support
1 parent e2bb5ee commit 699e64b

File tree

2 files changed

+159
-0
lines changed

2 files changed

+159
-0
lines changed

.github/workflows/fpm.yml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: fpm
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
gcc-build:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
os: [ubuntu-latest]
12+
gcc_v: [10] # Version of GFortran we want to use.
13+
include:
14+
- os: ubuntu-latest
15+
os-arch: linux-x86_64
16+
17+
env:
18+
FC: gfortran
19+
GCC_V: ${{ matrix.gcc_v }}
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v1
24+
25+
- name: Install GFortran macOS
26+
if: contains(matrix.os, 'macos')
27+
run: |
28+
ln -s /usr/local/bin/gfortran-${GCC_V} /usr/local/bin/gfortran
29+
which gfortran-${GCC_V}
30+
which gfortran
31+
32+
- name: Install GFortran Linux
33+
if: contains(matrix.os, 'ubuntu')
34+
run: |
35+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
36+
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
37+
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
38+
39+
- name: Install fpm
40+
uses: fortran-lang/setup-fpm@v3
41+
with:
42+
fpm-version: 'v0.10.0'
43+
44+
- name: Build the library
45+
run: |
46+
gfortran --version
47+
fpm build
48+
49+
- name: Run tests
50+
run: |
51+
gfortran --version
52+
fpm test
53+
54+
msys2-build:
55+
runs-on: windows-latest
56+
defaults:
57+
run:
58+
shell: msys2 {0}
59+
60+
steps:
61+
- uses: actions/checkout@v2
62+
- uses: msys2/setup-msys2@v2
63+
with:
64+
msystem: MINGW64
65+
update: true
66+
path-type: inherit
67+
install: |
68+
mingw-w64-x86_64-gcc-fortran
69+
mingw-w64-x86_64-fpm
70+
mingw-w64-x86_64-openblas
71+
mingw-w64-x86_64-lapack
72+
73+
- name: fpm build
74+
run: |
75+
gfortran --version
76+
fpm --version
77+
fpm build
78+
79+
- name: fpm test
80+
run: |
81+
fpm test
82+
83+
intel-build:
84+
runs-on: ubuntu-latest
85+
strategy:
86+
fail-fast: false
87+
88+
env:
89+
FPM_FC: ifx
90+
FC: ifx
91+
92+
steps:
93+
- name: Checkout code
94+
uses: actions/checkout@v3
95+
96+
- name: Add Intel repository (Linux)
97+
run: |
98+
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
99+
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
100+
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
101+
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
102+
sudo apt-get update
103+
104+
- name: Install Intel oneAPI compiler (Linux)
105+
run: |
106+
sudo apt-get install intel-oneapi-compiler-fortran
107+
108+
- name: Setup Intel oneAPI environment
109+
run: |
110+
source /opt/intel/oneapi/setvars.sh
111+
printenv >> $GITHUB_ENV
112+
113+
- name: Install fpm
114+
uses: fortran-lang/setup-fpm@v3
115+
with:
116+
fpm-version: 'v0.10.0'
117+
118+
- name: fpm build
119+
run: |
120+
ifx --version
121+
fpm --version
122+
fpm build --profile debug --flag "-warn nointerfaces"
123+
124+
- name: fpm test
125+
run: |
126+
fpm test --profile debug --flag "-warn nointerfaces"

fpm.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name = "friction"
2+
version = "1.0.0"
3+
license = "GPL-3.0"
4+
author = "Jason Christopherson"
5+
maintainer = "Jason Christopherson"
6+
copyright = "Copyright 2024, Jason Christopherson"
7+
description = "A library containing routines for calculating the frictional response of contacting bodies."
8+
homepage = "https://github.com/jchristopherson/friction"
9+
10+
[library]
11+
source-dir = "src"
12+
13+
[dependencies]
14+
ferror = { git = "https://github.com/jchristopherson/ferror" }
15+
diffeq = { git = "https://github.com/jchristopherson/diffeq" }
16+
fitpack = { git = "https://github.com/jchristopherson/fitpack" }
17+
fstats = { git = "https://github.com/jchristopherson/fstats" }
18+
19+
[dev-dependencies]
20+
fortran_test_helper = { git = "https://github.com/jchristopherson/fortran_test_helper" }
21+
22+
[install]
23+
library = true
24+
25+
[build]
26+
auto-executables = false
27+
auto-examples = false
28+
auto-tests = false
29+
30+
[[test]]
31+
name = "friction_tests"
32+
source-dir = "test"
33+
main = "friction_test.f90"

0 commit comments

Comments
 (0)