Skip to content

Commit 1559032

Browse files
Merge pull request #7 from jchristopherson/v1.5.2
Bug Fix - Build Script
2 parents 72a027d + 7ca22cf commit 1559032

199 files changed

Lines changed: 10054 additions & 8378 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: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,39 @@ env:
1010
BUILD_TYPE: Release
1111

1212
jobs:
13-
build:
13+
test:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
fortran_compiler: [gfortran, ifort]
19-
os: [ubuntu-latest, macos-latest] # issue with windows-latest & CMake with CMake not recognizing defined compilers
18+
os: [ubuntu-latest, macos-latest]
19+
toolchain:
20+
- {compiler: gcc, version: 11}
21+
- {compiler: intel-classic, version: '2021.9'}
22+
include:
23+
- os: ubuntu-latest
24+
toolchain: {compiler: intel, version: '2023.2'}
2025

2126
steps:
22-
23-
- name: Setup IFORT
24-
if: contains( matrix.fortran_compiler, 'ifort' )
25-
uses: modflowpy/install-intelfortran-action@v1
26-
27-
- name: Setup GFORTRAN
28-
if: contains( matrix.fortran_compiler, 'gfortran')
29-
uses: awvwgk/setup-fortran@main
30-
id: setup-fortran
31-
with:
32-
compiler: gcc
33-
version: 12
34-
35-
env:
36-
FC: ${{ steps.setup-fortran.outputs.fc }}
37-
CC: ${{ steps.setup-fortran.outputs.cc }}
38-
39-
- uses: actions/checkout@v3
40-
41-
- name: Configure CMake
42-
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=${{ env.CC }} -DCMAKE_Fortran_COMPILER=${{ env.FC }} -DBUILD_TESTING=TRUE
27+
- uses: awvwgk/setup-fortran@v1
28+
id: setup-fortran
29+
with:
30+
compiler: ${{ matrix.toolchain.compiler }}
31+
version: ${{ matrix.toolchain.version }}
32+
33+
- run: ${{ env.FC }} --version
34+
env:
35+
FC: ${{ steps.setup-fortran.outputs.fc }}
36+
CC: ${{ steps.setup-fortran.outputs.cc }}
37+
38+
- uses: actions/checkout@v3
4339

44-
- name: Build with CMake
45-
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
40+
- name: Configure CMake
41+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_Fortran_COMPILER=${{ env.FC }} -DBUILD_TESTING=TRUE
42+
43+
- name: Build with CMake
44+
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
4645

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

CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.24)
33
project(
44
nonlin
55
LANGUAGES Fortran
6-
VERSION 1.5.0
6+
VERSION 1.5.2
77
)
88

99
# Get helper macros and functions
@@ -35,9 +35,6 @@ target_link_libraries(
3535
link_library(${PROJECT_NAME} ${ferror_LIBRARY} ${ferror_INCLUDE_DIR})
3636
link_library(${PROJECT_NAME} ${linalg_LIBRARY} ${linalg_INCLUDE_DIR})
3737

38-
# Installation
39-
add_subdirectory(install)
40-
4138
# Testing
4239
option(BUILD_TESTING "Build tests")
4340
include(CTest)

dependencies/BLAS/CMakeLists.txt

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

dependencies/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
# Get the macros and functions we'll need
2-
include("${PROJECT_SOURCE_DIR}/cmake/helper.cmake")
3-
include(FetchContent)
4-
5-
# Get BLAS
6-
add_subdirectory(BLAS)
7-
8-
# Get LAPACK
9-
add_subdirectory(LAPACK)
10-
111
# Get FERROR
122
add_subdirectory(ferror)
133
set(ferror_LIBRARY ${ferror_LIBRARY} PARENT_SCOPE)

dependencies/LAPACK/CMakeLists.txt

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

dependencies/ferror/CMakeLists.txt

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,18 @@
1-
# Get the macros and functions we'll need
2-
include("${PROJECT_SOURCE_DIR}/cmake/helper.cmake")
31
include(FetchContent)
42

53
# Fetch the proper content
64
FetchContent_Declare(
75
ferror
86
GIT_REPOSITORY "https://github.com/jchristopherson/ferror"
97
)
10-
118
FetchContent_MakeAvailable(ferror)
129

13-
if (WIN32)
14-
if (BUILD_SHARED_LIBS)
15-
add_custom_command(
16-
TARGET ${PROJECT_NAME} POST_BUILD
17-
COMMAND ${CMAKE_COMMAND} -E copy_if_different
18-
$<TARGET_FILE:ferror>
19-
$<TARGET_FILE_DIR:${PROJECT_NAME}
20-
)
21-
endif()
22-
endif()
23-
2410
set(ferror_INCLUDE_DIR ${ferror_BINARY_DIR}/include)
25-
set(ferror_INCLUDE_DIR ${ferror_INCLUDE_DIR} PARENT_SCOPE)
2611
configure_file(
2712
"${ferror_SOURCE_DIR}/include/ferror.h"
2813
"${ferror_INCLUDE_DIR}/ferror.h"
2914
COPYONLY
3015
)
31-
32-
# Make a parent-scope variable for the library
3316
set(ferror_LIBRARY ferror)
17+
set(ferror_INCLUDE_DIR ${ferror_INCLUDE_DIR} PARENT_SCOPE)
3418
set(ferror_LIBRARY ${ferror_LIBRARY} PARENT_SCOPE)

dependencies/linalg/CMakeLists.txt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Get the macros and functions we'll need
2-
include("${PROJECT_SOURCE_DIR}/cmake/helper.cmake")
31
include(FetchContent)
42

53
# Fetch the proper content
@@ -10,25 +8,12 @@ FetchContent_Declare(
108

119
FetchContent_MakeAvailable(linalg)
1210

13-
if (WIN32)
14-
if (BUILD_SHARED_LIBS)
15-
add_custom_command(
16-
TARGET ${PROJECT_NAME} POST_BUILD
17-
COMMAND ${CMAKE_COMMAND} -E copy_if_different
18-
$<TARGET_FILE:linalg>
19-
$<TARGET_FILE_DIR:${PROJECT_NAME}
20-
)
21-
endif()
22-
endif()
23-
2411
set(linalg_INCLUDE_DIR ${linalg_BINARY_DIR}/include)
2512
set(linalg_INCLUDE_DIR ${linalg_INCLUDE_DIR} PARENT_SCOPE)
2613
configure_file(
2714
"${linalg_SOURCE_DIR}/include/linalg.h"
2815
"${linalg_INCLUDE_DIR}/linalg.h"
2916
COPYONLY
3017
)
31-
32-
# Make a parent-scope variable for the library
3318
set(linalg_LIBRARY linalg)
3419
set(linalg_LIBRARY ${linalg_LIBRARY} PARENT_SCOPE)

0 commit comments

Comments
 (0)