-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from jchristopherson/fpm
Add FPM support
- Loading branch information
Showing
9 changed files
with
215 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
name: fpm | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
gcc-build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-11] | ||
gcc_v: [10] # 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 }} | ||
|
||
steps: | ||
- 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 | ||
with: | ||
fpm-version: 'v0.8.2' | ||
|
||
- name: Build FERROR | ||
run: | | ||
gfortran --version | ||
fpm build | ||
- 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name = "ferror" | ||
version = "1.4.2" | ||
license = "GPL-3.0" | ||
author = "Jason Christopherson" | ||
maintainer = "Jason Christopherson" | ||
copyright = "Copyright 2017-2023, Jason Christopherson" | ||
description = "A library to assist with error handling in Fortran projects." | ||
homepage = "https://github.com/jchristopherson/ferror" | ||
|
||
[library] | ||
source-dir = "src" | ||
|
||
[[test]] | ||
name = "ferror_test" | ||
source-dir = "test" | ||
main = "ferror_test.f90" | ||
|
||
[install] | ||
library = true | ||
|
||
[build] | ||
auto-executables = false | ||
auto-examples = false | ||
auto-tests = false | ||
|
||
[preprocess] | ||
[preprocess.cpp] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,23 @@ | ||
macro(create_test testname codename) | ||
add_executable(${testname} ${codename}) | ||
target_link_libraries(${testname} ferror) | ||
target_include_directories(${testname} PUBLIC ${PROJECT_BINARY_DIR}/include) | ||
add_test( | ||
NAME ${testname} | ||
WORKING_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} | ||
COMMAND $<TARGET_FILE:${testname}> | ||
) | ||
endmacro() | ||
|
||
macro(create_c_test testname codename) | ||
add_executable(${testname} ${codename}) | ||
target_link_libraries(${testname} ferror) | ||
add_test( | ||
NAME ${testname} | ||
WORKING_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} | ||
COMMAND $<TARGET_FILE:${testname}> | ||
) | ||
endmacro() | ||
include("${PROJECT_SOURCE_DIR}/cmake/helper.cmake") | ||
|
||
include_directories( | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include> | ||
add_executable(ferror_test ferror_test.f90) | ||
link_library(ferror_test ${PROJECT_NAME} ${PROJECT_INCLUDE_DIR}) | ||
add_test( | ||
NAME ferror_test | ||
WORKING_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} | ||
COMMAND $<TARGET_FILE:ferror_test> | ||
) | ||
|
||
create_test(ferror_test ferror_test.f90) | ||
|
||
if (${BUILD_C_API}) | ||
create_test(ferror_test_c ferror_test_c.c) | ||
endif() | ||
include_directories( | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include> | ||
) | ||
add_executable(ferror_test_c C/ferror_test_c.c) | ||
link_library(ferror_test_c ${PROJECT_NAME} ${PROJECT_INCLUDE_DIR}) | ||
add_test( | ||
NAME ferror_test_c | ||
WORKING_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} | ||
COMMAND $<TARGET_FILE:ferror_test_c> | ||
) | ||
endif() |