Skip to content

Commit 60a6db0

Browse files
committed
add build tests and rpath
1 parent 9098853 commit 60a6db0

File tree

2 files changed

+62
-3
lines changed

2 files changed

+62
-3
lines changed

.github/workflows/ci.yml

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: ci
22

33
env:
4-
CMAKE_BUILD_PARALLEL_LEVEL: 3
54
CTEST_PARALLEL_LEVEL: 3
65
CMAKE_BUILD_TYPE: Release
76

@@ -42,7 +41,33 @@ jobs:
4241
- name: build examples
4342
run: cmake --build Examples/build --parallel
4443
- name: Test examples
45-
run: ctest --test-dir Examples/build --output-on-failure
44+
run: ctest --test-dir Examples/build -V
45+
46+
47+
linux-build:
48+
needs: linux
49+
runs-on: ubuntu-latest
50+
timeout-minutes: 15
51+
52+
steps:
53+
- uses: actions/checkout@v2
54+
55+
- name: install libs
56+
run: |
57+
sudo apt update -yq
58+
sudo apt install -yq --no-install-recommends libhdf5-dev
59+
60+
- run: cmake --preset build -B build --install-prefix=${HOME}
61+
- run: cmake --build build
62+
- run: ctest --test-dir build --preset default
63+
- run: cmake --install build
64+
65+
- name: configure examples
66+
run: cmake -S Examples -B Examples/build -Dnc4fortran_ROOT=${HOME}
67+
- name: build examples
68+
run: cmake --build Examples/build --parallel
69+
- name: Test examples
70+
run: ctest --test-dir Examples/build -V
4671

4772

4873
mac:
@@ -70,4 +95,31 @@ jobs:
7095

7196
- run: cmake -S Examples -B Examples/build -Dnc4fortran_ROOT=${HOME}
7297
- run: cmake --build Examples/build --parallel
73-
- run: ctest --test-dir Examples/build --output-on-failure
98+
- run: ctest --test-dir Examples/build -V
99+
100+
101+
mac-build:
102+
needs: mac
103+
runs-on: macos-latest
104+
timeout-minutes: 30
105+
env:
106+
HOMEBREW_NO_INSTALL_CLEANUP: 1
107+
FC: gfortran-11
108+
109+
steps:
110+
- uses: actions/checkout@v2
111+
112+
- name: install libs
113+
run: brew install hdf5
114+
115+
- run: cmake --preset build -B build --install-prefix=${HOME}
116+
- run: cmake --build build
117+
- run: ctest --test-dir build --preset default
118+
- run: cmake --install build
119+
120+
- name: configure examples
121+
run: cmake -S Examples -B Examples/build -Dnc4fortran_ROOT=${HOME}
122+
- name: build examples
123+
run: cmake --build Examples/build --parallel
124+
- name: Test examples
125+
run: ctest --test-dir Examples/build -V

cmake/netcdf.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,10 @@ add_library(NetCDF::NetCDF_Fortran INTERFACE IMPORTED GLOBAL)
100100
target_include_directories(NetCDF::NetCDF_Fortran INTERFACE "${NetCDF_INCLUDE_DIRS}")
101101
target_link_libraries(NetCDF::NetCDF_Fortran INTERFACE "${NetCDF_Fortran_LIBRARIES}")
102102
add_dependencies(NetCDF::NetCDF_Fortran NETCDF_FORTRAN)
103+
104+
# --- dynamic shared library
105+
106+
if(UNIX)
107+
set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib)
108+
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
109+
endif()

0 commit comments

Comments
 (0)