-
Notifications
You must be signed in to change notification settings - Fork 207
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 #1715 from NCAR/ejh_ncint
Getting CMake build to understand netCDF integration
- Loading branch information
Showing
7 changed files
with
132 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# This is the GitHub workflow file to build and test the PIO library with CMake, and netCDF integration. | ||
|
||
# Ed Hartnett 8/19/20 | ||
|
||
name: cmake_ncint | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
env: | ||
CC: mpicc | ||
FC: mpifort | ||
CPPFLAGS: "-I/usr/include -I/usr/local/include -I/home/runner/pnetcdf/include" | ||
LDFLAGS: "-L/home/runner/pnetcdf/lib" | ||
LD_LIBRARY_PATH: "/home/runner/pnetcdf/lib" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Installs | ||
run: | | ||
sudo apt-get install netcdf-bin libnetcdf-dev doxygen graphviz wget gfortran libjpeg-dev libz-dev openmpi-bin libopenmpi-dev | ||
- name: cache-pnetcdf | ||
id: cache-pnetcdf | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/pnetcdf | ||
key: pnetcdf-${{ runner.os }}-1.12.1 | ||
|
||
- name: build-pnetcdf | ||
if: steps.cache-pnetcdf.outputs.cache-hit != 'true' | ||
run: | | ||
set -x | ||
wget https://parallel-netcdf.github.io/Release/pnetcdf-1.12.1.tar.gz &> /dev/null | ||
tar -xzvf pnetcdf-1.12.1.tar.gz | ||
pushd pnetcdf-1.12.1 | ||
./configure --prefix=/home/runner/pnetcdf --enable-shared --disable-cxx | ||
make | ||
sudo make install | ||
popd | ||
- name: cmake build | ||
run: | | ||
set -x | ||
mkdir build | ||
cd build | ||
cmake -Wno-dev -DPIO_ENABLE_NETCDF_INTEGRATION=On -DNetCDF_C_LIBRARY=/usr/lib/x86_64-linux-gnu/libnetcdf.so -DNetCDF_C_INCLUDE_DIR=/usr/include -DPnetCDF_PATH='/home/runner/pnetcdf' -DPIO_HDF5_LOGGING=On -DPIO_USE_MALLOC=On -DPIO_ENABLE_LOGGING=On -DPIO_ENABLE_TIMING=Off .. | ||
make VERBOSE=1 | ||
make tests VERBOSE=1 | ||
ctest -VV |
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
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,31 @@ | ||
# This is part of the PIO library. | ||
# | ||
# This is the cmake file to build the test directory for netCDF integration. | ||
# | ||
# Ed Hartnett 8/19/20 | ||
|
||
include (LibMPI) | ||
|
||
include_directories("${CMAKE_SOURCE_DIR}/tests/ncint") | ||
include_directories("${CMAKE_BINARY_DIR}") | ||
|
||
set (my_tests tst_async_multi tst_ncint_async_perf | ||
tst_ncint_perf tst_pio_async tst_pio_udf) | ||
|
||
# Test Timeout in seconds. | ||
if (PIO_VALGRIND_CHECK) | ||
set (DEFAULT_TEST_TIMEOUT 480) | ||
else () | ||
set (DEFAULT_TEST_TIMEOUT 240) | ||
endif () | ||
|
||
FOREACH(tst ${my_tests}) | ||
add_executable (${tst} EXCLUDE_FROM_ALL ${tst}.c) | ||
add_dependencies (tests ${tst}) | ||
target_link_libraries (${tst} pioc) | ||
add_mpi_test(${tst} | ||
EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/${tst} | ||
NUMPROCS 4 | ||
TIMEOUT ${DEFAULT_TEST_TIMEOUT}) | ||
ENDFOREACH() | ||
|