diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0470d18..3fc8369 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,6 @@ name: ci env: - CMAKE_BUILD_PARALLEL_LEVEL: 3 CTEST_PARALLEL_LEVEL: 3 CMAKE_BUILD_TYPE: Release @@ -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: @@ -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 diff --git a/cmake/netcdf.cmake b/cmake/netcdf.cmake index 15b2760..3eb9f4b 100644 --- a/cmake/netcdf.cmake +++ b/cmake/netcdf.cmake @@ -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()