Skip to content

Commit

Permalink
add build tests and rpath
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Oct 25, 2021
1 parent 9098853 commit 60a6db0
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 3 deletions.
58 changes: 55 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: ci

env:
CMAKE_BUILD_PARALLEL_LEVEL: 3
CTEST_PARALLEL_LEVEL: 3
CMAKE_BUILD_TYPE: Release

Expand Down Expand Up @@ -42,7 +41,33 @@ jobs:
- name: build examples
run: cmake --build Examples/build --parallel
- name: Test examples
run: ctest --test-dir Examples/build --output-on-failure
run: ctest --test-dir Examples/build -V


linux-build:
needs: linux
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- uses: actions/checkout@v2

- name: install libs
run: |
sudo apt update -yq
sudo apt install -yq --no-install-recommends libhdf5-dev
- run: cmake --preset build -B build --install-prefix=${HOME}
- run: cmake --build build
- run: ctest --test-dir build --preset default
- run: cmake --install build

- name: configure examples
run: cmake -S Examples -B Examples/build -Dnc4fortran_ROOT=${HOME}
- name: build examples
run: cmake --build Examples/build --parallel
- name: Test examples
run: ctest --test-dir Examples/build -V


mac:
Expand Down Expand Up @@ -70,4 +95,31 @@ jobs:

- run: cmake -S Examples -B Examples/build -Dnc4fortran_ROOT=${HOME}
- run: cmake --build Examples/build --parallel
- run: ctest --test-dir Examples/build --output-on-failure
- run: ctest --test-dir Examples/build -V


mac-build:
needs: mac
runs-on: macos-latest
timeout-minutes: 30
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
FC: gfortran-11

steps:
- uses: actions/checkout@v2

- name: install libs
run: brew install hdf5

- run: cmake --preset build -B build --install-prefix=${HOME}
- run: cmake --build build
- run: ctest --test-dir build --preset default
- run: cmake --install build

- name: configure examples
run: cmake -S Examples -B Examples/build -Dnc4fortran_ROOT=${HOME}
- name: build examples
run: cmake --build Examples/build --parallel
- name: Test examples
run: ctest --test-dir Examples/build -V
7 changes: 7 additions & 0 deletions cmake/netcdf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,10 @@ add_library(NetCDF::NetCDF_Fortran INTERFACE IMPORTED GLOBAL)
target_include_directories(NetCDF::NetCDF_Fortran INTERFACE "${NetCDF_INCLUDE_DIRS}")
target_link_libraries(NetCDF::NetCDF_Fortran INTERFACE "${NetCDF_Fortran_LIBRARIES}")
add_dependencies(NetCDF::NetCDF_Fortran NETCDF_FORTRAN)

# --- dynamic shared library

if(UNIX)
set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib)
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
endif()

0 comments on commit 60a6db0

Please sign in to comment.