Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 13 additions & 3 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CMake

on:
push:
branches: [ "main" ]
branches: [ "master" ]
pull_request:
branches: [ "main" ]
branches: [ "master" ]

env:
BUILD_TYPE: Release
Expand Down Expand Up @@ -38,11 +38,21 @@ jobs:
- uses: actions/checkout@v3

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_Fortran_COMPILER=${{ env.FC }} -DBUILD_TESTING=TRUE
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

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

- name: Test with CMake
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}

- name: Configure CMake - Shared Library
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

- name: Build with CMake - Shared Library
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test with CMake - Shared Library
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
26 changes: 26 additions & 0 deletions .github/workflows/doc-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: doc-deployment

on: [push, pull_request]

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.x'

- name: Install dependencies
run: pip install -v ford==6.1.17

- name: Build Documentation
run: ford docs.md

- uses: JamesIves/github-pages-deploy-action@3.7.1
if: github.event_name == 'push' && github.repository == 'jchristopherson/ferror' && ( startsWith( github.ref, 'refs/tags/' ) || github.ref == 'refs/heads/master' )
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: doc
CLEAN: true
17 changes: 0 additions & 17 deletions .github/workflows/doxygen-gh-pages.yml

This file was deleted.

94 changes: 6 additions & 88 deletions .github/workflows/fpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-11]
gcc_v: [10] # Version of GFortran we want to use.
os: [ubuntu-latest]
gcc_v: [12] # Version of GFortran we want to use.
include:
- os: ubuntu-latest
os-arch: linux-x86_64

- os: macos-11
os-arch: macos-x86_64

env:
FC: gfortran
GCC_V: ${{ matrix.gcc_v }}
Expand All @@ -25,24 +22,17 @@ jobs:
- name: Checkout code
uses: actions/checkout@v1

- 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

- 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 fpm
uses: fortran-lang/setup-fpm@v3
uses: fortran-lang/setup-fpm@v5
with:
fpm-version: 'v0.8.2'
fpm-version: 'v0.10.1'

- name: Build FERROR
run: |
Expand All @@ -52,76 +42,4 @@ jobs:
- name: Run tests
run: |
gfortran --version
fpm test

msys2-build:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}

steps:
- uses: actions/checkout@v2
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
path-type: inherit
install: |
mingw-w64-x86_64-gcc-fortran
mingw-w64-x86_64-fpm

- name: fpm build
run: |
gfortran --version
fpm --version
fpm build

- name: fpm test
run: |
fpm test

intel-build:
runs-on: ubuntu-latest
strategy:
fail-fast: false

env:
FPM_FC: ifort
FC: ifort

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

- name: Add Intel repository (Linux)
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)
run: |
sudo apt-get install intel-oneapi-compiler-fortran

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

- name: Install fpm
uses: fortran-lang/setup-fpm@v3
with:
fpm-version: 'v0.8.2'

- name: fpm build
run: |
ifort --version
fpm --version
fpm build --profile debug --flag "-warn nointerfaces"

- name: fpm test
run: |
fpm test --profile debug --flag "-warn nointerfaces"
fpm test
28 changes: 11 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ project(
LANGUAGES
C
Fortran
VERSION "1.4.2"
VERSION "1.4.3"
)

# Get the macros and functions we'll need
include("${PROJECT_SOURCE_DIR}/cmake/helper.cmake")
set(CMAKE_Fortran_STANDARD 2018)
set(CMAKE_Fortran_STANDARD_REQUIRED TRUE)

# Build the C API?
option(BUILD_C_API "Build C API?" OFF)
option(BUILD_FERROR_C_API "Build FERROR C API?" OFF)

# Configure everything
add_subdirectory(configure)
Expand All @@ -28,17 +27,13 @@ endif()

# Build the library
add_subdirectory(src)
add_fortran_library(
${PROJECT_NAME}
${PROJECT_INCLUDE_DIR}
${CMAKE_INSTALL_INCLUDEDIR}
${PROJECT_VERSION}
${PROJECT_VERSION_MAJOR}
${FERROR_SOURCES}
)

# Install the library
add_subdirectory(install)
# Installation Instructions
install(
EXPORT ${PROJECT_NAME}-targets
NAMESPACE ${PROJECT_NAME}::
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
)

# ------------------------------------------------------------------------------
# EXAMPLES
Expand All @@ -55,8 +50,7 @@ endif()
# ------------------------------------------------------------------------------
# TESTS
# ------------------------------------------------------------------------------
# C Based Testing
option(BUILD_TESTING "Build tests")
option(BUILD_TESTING "Build FERROR tests")
if (BUILD_TESTING)
# Inform the user we're building the tests
message(STATUS "Building FERROR tests.")
Expand Down
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,32 @@ The error code is: 200
```

## Compiling
[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.
[CMake](https://cmake.org/) is the preferred build system for this library.
To configure, first navigate to the project directory and then issue the following command.
```txt
cmake -B build -DCMAKE_BUILD_TYPE=Release
```
To build the C API:
```txt
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_FERROR_C_API=TRUE
```
If testing is to be included then:
```txt
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=TRUE
```
or
```txt
cmake -B "build" -DCMAKE_BUILD_TYPE=Release -DBUILD_FERROR_C_API=TRUE -DBUILD_TESTING=TRUE
```
To build:
```txt
cmake --build build
```
Finally, to run the tests:
```txt
ctest --test-dir build/test
```


[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.

Expand Down
75 changes: 0 additions & 75 deletions cmake/helper.cmake

This file was deleted.

Loading
Loading