Skip to content

Commit ec0cc79

Browse files
Merge pull request #11 from jchristopherson/v1.4.3
2 parents 20b7405 + 3e30aa2 commit ec0cc79

167 files changed

Lines changed: 16730 additions & 13604 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/cmake.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CMake
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: [ "master" ]
66
pull_request:
7-
branches: [ "main" ]
7+
branches: [ "master" ]
88

99
env:
1010
BUILD_TYPE: Release
@@ -38,11 +38,21 @@ jobs:
3838
- uses: actions/checkout@v3
3939

4040
- name: Configure CMake
41-
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_Fortran_COMPILER=${{ env.FC }} -DBUILD_TESTING=TRUE
41+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_Fortran_COMPILER=${{ env.FC }} -DBUILD_TESTING=TRUE -DBUILD_FERROR_C_API=TRUE
4242

4343
- name: Build with CMake
4444
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
4545

4646
- name: Test with CMake
47+
working-directory: ${{github.workspace}}/build
48+
run: ctest -C ${{env.BUILD_TYPE}}
49+
50+
- name: Configure CMake - Shared Library
51+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_Fortran_COMPILER=${{ env.FC }} -DBUILD_TESTING=TRUE -DBUILD_FERROR_C_API=TRUE -DBUILD_SHARED_LIBS=TRUE
52+
53+
- name: Build with CMake - Shared Library
54+
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
55+
56+
- name: Test with CMake - Shared Library
4757
working-directory: ${{github.workspace}}/build
4858
run: ctest -C ${{env.BUILD_TYPE}}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: doc-deployment
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build-and-deploy:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: actions/setup-python@v1
11+
with:
12+
python-version: '3.x'
13+
14+
- name: Install dependencies
15+
run: pip install -v ford==6.1.17
16+
17+
- name: Build Documentation
18+
run: ford docs.md
19+
20+
- uses: JamesIves/github-pages-deploy-action@3.7.1
21+
if: github.event_name == 'push' && github.repository == 'jchristopherson/ferror' && ( startsWith( github.ref, 'refs/tags/' ) || github.ref == 'refs/heads/master' )
22+
with:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
BRANCH: gh-pages
25+
FOLDER: doc
26+
CLEAN: true

.github/workflows/doxygen-gh-pages.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/fpm.yml

Lines changed: 6 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
os: [ubuntu-latest, macos-11]
12-
gcc_v: [10] # Version of GFortran we want to use.
11+
os: [ubuntu-latest]
12+
gcc_v: [12] # Version of GFortran we want to use.
1313
include:
1414
- os: ubuntu-latest
1515
os-arch: linux-x86_64
1616

17-
- os: macos-11
18-
os-arch: macos-x86_64
19-
2017
env:
2118
FC: gfortran
2219
GCC_V: ${{ matrix.gcc_v }}
@@ -25,24 +22,17 @@ jobs:
2522
- name: Checkout code
2623
uses: actions/checkout@v1
2724

28-
- name: Install GFortran macOS
29-
if: contains(matrix.os, 'macos')
30-
run: |
31-
ln -s /usr/local/bin/gfortran-${GCC_V} /usr/local/bin/gfortran
32-
which gfortran-${GCC_V}
33-
which gfortran
34-
3525
- name: Install GFortran Linux
3626
if: contains(matrix.os, 'ubuntu')
3727
run: |
3828
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
3929
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
4030
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
41-
31+
4232
- name: Install fpm
43-
uses: fortran-lang/setup-fpm@v3
33+
uses: fortran-lang/setup-fpm@v5
4434
with:
45-
fpm-version: 'v0.8.2'
35+
fpm-version: 'v0.10.1'
4636

4737
- name: Build FERROR
4838
run: |
@@ -52,76 +42,4 @@ jobs:
5242
- name: Run tests
5343
run: |
5444
gfortran --version
55-
fpm test
56-
57-
msys2-build:
58-
runs-on: windows-latest
59-
defaults:
60-
run:
61-
shell: msys2 {0}
62-
63-
steps:
64-
- uses: actions/checkout@v2
65-
- uses: msys2/setup-msys2@v2
66-
with:
67-
msystem: MINGW64
68-
update: true
69-
path-type: inherit
70-
install: |
71-
mingw-w64-x86_64-gcc-fortran
72-
mingw-w64-x86_64-fpm
73-
74-
- name: fpm build
75-
run: |
76-
gfortran --version
77-
fpm --version
78-
fpm build
79-
80-
- name: fpm test
81-
run: |
82-
fpm test
83-
84-
intel-build:
85-
runs-on: ubuntu-latest
86-
strategy:
87-
fail-fast: false
88-
89-
env:
90-
FPM_FC: ifort
91-
FC: ifort
92-
93-
steps:
94-
- name: Checkout code
95-
uses: actions/checkout@v3
96-
97-
- name: Add Intel repository (Linux)
98-
run: |
99-
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
100-
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
101-
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
102-
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
103-
sudo apt-get update
104-
105-
- name: Install Intel oneAPI compiler (Linux)
106-
run: |
107-
sudo apt-get install intel-oneapi-compiler-fortran
108-
109-
- name: Setup Intel oneAPI environment
110-
run: |
111-
source /opt/intel/oneapi/setvars.sh
112-
printenv >> $GITHUB_ENV
113-
114-
- name: Install fpm
115-
uses: fortran-lang/setup-fpm@v3
116-
with:
117-
fpm-version: 'v0.8.2'
118-
119-
- name: fpm build
120-
run: |
121-
ifort --version
122-
fpm --version
123-
fpm build --profile debug --flag "-warn nointerfaces"
124-
125-
- name: fpm test
126-
run: |
127-
fpm test --profile debug --flag "-warn nointerfaces"
45+
fpm test

CMakeLists.txt

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ project(
55
LANGUAGES
66
C
77
Fortran
8-
VERSION "1.4.2"
8+
VERSION "1.4.3"
99
)
10-
11-
# Get the macros and functions we'll need
12-
include("${PROJECT_SOURCE_DIR}/cmake/helper.cmake")
10+
set(CMAKE_Fortran_STANDARD 2018)
11+
set(CMAKE_Fortran_STANDARD_REQUIRED TRUE)
1312

1413
# Build the C API?
15-
option(BUILD_C_API "Build C API?" OFF)
14+
option(BUILD_FERROR_C_API "Build FERROR C API?" OFF)
1615

1716
# Configure everything
1817
add_subdirectory(configure)
@@ -28,17 +27,13 @@ endif()
2827

2928
# Build the library
3029
add_subdirectory(src)
31-
add_fortran_library(
32-
${PROJECT_NAME}
33-
${PROJECT_INCLUDE_DIR}
34-
${CMAKE_INSTALL_INCLUDEDIR}
35-
${PROJECT_VERSION}
36-
${PROJECT_VERSION_MAJOR}
37-
${FERROR_SOURCES}
38-
)
3930

40-
# Install the library
41-
add_subdirectory(install)
31+
# Installation Instructions
32+
install(
33+
EXPORT ${PROJECT_NAME}-targets
34+
NAMESPACE ${PROJECT_NAME}::
35+
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
36+
)
4237

4338
# ------------------------------------------------------------------------------
4439
# EXAMPLES
@@ -55,8 +50,7 @@ endif()
5550
# ------------------------------------------------------------------------------
5651
# TESTS
5752
# ------------------------------------------------------------------------------
58-
# C Based Testing
59-
option(BUILD_TESTING "Build tests")
53+
option(BUILD_TESTING "Build FERROR tests")
6054
if (BUILD_TESTING)
6155
# Inform the user we're building the tests
6256
message(STATUS "Building FERROR tests.")

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,32 @@ The error code is: 200
113113
```
114114

115115
## Compiling
116-
[CMake](https://cmake.org/) is the preferred build system for this library. See [Running CMake](https://cmake.org/runningcmake/) for instructions on how to build using CMake.
116+
[CMake](https://cmake.org/) is the preferred build system for this library.
117+
To configure, first navigate to the project directory and then issue the following command.
118+
```txt
119+
cmake -B build -DCMAKE_BUILD_TYPE=Release
120+
```
121+
To build the C API:
122+
```txt
123+
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_FERROR_C_API=TRUE
124+
```
125+
If testing is to be included then:
126+
```txt
127+
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=TRUE
128+
```
129+
or
130+
```txt
131+
cmake -B "build" -DCMAKE_BUILD_TYPE=Release -DBUILD_FERROR_C_API=TRUE -DBUILD_TESTING=TRUE
132+
```
133+
To build:
134+
```txt
135+
cmake --build build
136+
```
137+
Finally, to run the tests:
138+
```txt
139+
ctest --test-dir build/test
140+
```
141+
117142

118143
[Meson](https://mesonbuild.com/index.html) can also be used to build this library. See [this](https://mesonbuild.com/Quick-guide.html) quick start guid on how to use Meson.
119144

cmake/helper.cmake

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)