mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-30 16:10:44 +08:00
Merge pull request #2437 from WardF/gh2435.wif
Fix pnetcdf tests in cmake
This commit is contained in:
commit
5794ae4dd3
84
.github/workflows/run_tests_ubuntu.yml
vendored
84
.github/workflows/run_tests_ubuntu.yml
vendored
@ -351,9 +351,89 @@ jobs:
|
||||
LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ctest -j 12 --rerun-failed --output-on-failure -VV
|
||||
if: ${{ failure() }}
|
||||
|
||||
##
|
||||
# Parallel
|
||||
##
|
||||
nc-cmake-tests-oneoff-parallel:
|
||||
|
||||
needs: build-deps-parallel
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
hdf5: [ 1.12.1 ]
|
||||
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install System dependencies
|
||||
shell: bash -l {0}
|
||||
run: sudo apt update && sudo apt install -y libaec-dev zlib1g-dev automake autoconf libcurl4-openssl-dev libjpeg-dev wget curl bzip2 m4 flex bison cmake libzip-dev doxygen mpich libmpich-dev
|
||||
|
||||
###
|
||||
# Set Environmental Variables
|
||||
###
|
||||
|
||||
- run: echo "CMAKE_PREFIX_PATH=${HOME}/environments/${{ matrix.hdf5 }}/" >> $GITHUB_ENV
|
||||
- run: echo "LD_LIBRARY_PATH=${HOME}/environments/${{ matrix.hdf5 }}/lib" >> $GITHUB_ENV
|
||||
|
||||
###
|
||||
# Fetch Cache
|
||||
###
|
||||
|
||||
- name: Fetch HDF Cache
|
||||
id: cache-hdf5
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/environments/${{ matrix.hdf5 }}
|
||||
key: hdf5-parallel-${{ runner.os }}-${{ matrix.hdf5 }}
|
||||
|
||||
- name: Check Cache
|
||||
shell: bash -l {0}
|
||||
run: ls ${HOME}/environments && ls ${HOME}/environments/${{ matrix.hdf5 }} && ls ${HOME}/environments/${{ matrix.hdf5}}/lib
|
||||
|
||||
###
|
||||
# Configure and build
|
||||
###
|
||||
|
||||
- name: Perform out-of-directory build
|
||||
shell: bash -l {0}
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_C_COMPILER=mpicc -DENABLE_HDF4=TRUE -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DENABLE_DAP=TRUE -DENABLE_HDF5=TRUE -DENABLE_NCZARR=TRUE -D ENABLE_DAP_LONG_TESTS=TRUE -DENABLE_PNETCDF=TRUE
|
||||
|
||||
- name: Print Summary
|
||||
shell: bash -l {0}
|
||||
run: |
|
||||
cd build
|
||||
cat libnetcdf.settings
|
||||
|
||||
- name: Build All
|
||||
shell: bash -l {0}
|
||||
run: |
|
||||
cd build
|
||||
LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make -j 12
|
||||
if: ${{ success() }}
|
||||
|
||||
- name: Run Tests
|
||||
shell: bash -l {0}
|
||||
run: |
|
||||
cd build
|
||||
LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ctest --output-on-failure -j 12 .
|
||||
if: ${{ success() }}
|
||||
|
||||
- name: Verbose Output if CTest Failure
|
||||
shell: bash -l {0}
|
||||
run: |
|
||||
cd build
|
||||
LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ctest -j 12 --rerun-failed --output-on-failure -VV
|
||||
if: ${{ failure() }}
|
||||
|
||||
nc-autotools:
|
||||
|
||||
needs: [ nc-cmake-tests-oneoff-serial, nc-ac-tests-oneoff-serial ]
|
||||
needs: [ nc-cmake-tests-oneoff-serial, nc-ac-tests-oneoff-serial, nc-cmake-tests-oneoff-parallel, nc-ac-tests-oneoff-parallel ]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
@ -460,7 +540,7 @@ jobs:
|
||||
|
||||
nc-cmake:
|
||||
|
||||
needs: [ nc-cmake-tests-oneoff-serial, nc-ac-tests-oneoff-serial ]
|
||||
needs: [ nc-cmake-tests-oneoff-serial, nc-ac-tests-oneoff-serial, nc-cmake-tests-oneoff-parallel, nc-ac-tests-oneoff-parallel ]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
|
@ -1479,6 +1479,12 @@ IF(ENABLE_PNETCDF)
|
||||
ELSE()
|
||||
MESSAGE(WARNING "ENABLE_PNETCDF requires version 1.6.1 or later; found version ${pnetcdf_version}. PnetCDF is disabled")
|
||||
ENDIF()
|
||||
|
||||
###
|
||||
# Generate pnetcdf test.
|
||||
###
|
||||
CONFIGURE_FILE("${netCDF_SOURCE_DIR}/nc_test/run_pnetcdf_tests.sh.in"
|
||||
"${netCDF_BINARY_DIR}/nc_test/run_pnetcdf_tests.sh")
|
||||
ENDIF(NOT PNETCDF)
|
||||
ENDIF()
|
||||
|
||||
|
@ -1634,7 +1634,7 @@ posixio_create(const char *path, int ioflags,
|
||||
#endif
|
||||
if(fd < 0)
|
||||
{
|
||||
status = errno;
|
||||
status = errno ? errno : ENOENT;
|
||||
goto unwind_new;
|
||||
}
|
||||
*((int *)&nciop->fd) = fd; /* cast away const */
|
||||
|
@ -50,9 +50,17 @@ IF(USE_PNETCDF)
|
||||
build_bin_test_no_prefix(tst_pnetcdf)
|
||||
build_bin_test_no_prefix(tst_parallel2)
|
||||
build_bin_test_no_prefix(tst_addvar)
|
||||
add_sh_test(nc_test run_pnetcdf_test)
|
||||
build_bin_test_no_prefix(t_nc)
|
||||
build_bin_test_no_prefix(tst_atts3)
|
||||
build_bin_test_no_prefix(tst_default_format_pnetcdf)
|
||||
build_bin_test_no_prefix(tst_small)
|
||||
build_bin_test_no_prefix(tst_formatx_pnetcdf)
|
||||
build_bin_test_no_prefix(tst_cdf5format)
|
||||
build_bin_test_no_prefix(tst_nofill)
|
||||
add_bin_test(nc_test tst_formatx_pnetcdf)
|
||||
add_bin_test(nc_test tst_default_format_pnetcdf)
|
||||
add_sh_test(nc_test run_pnetcdf_tests)
|
||||
SET_TESTS_PROPERTIES(nc_test_run_pnetcdf_tests PROPERTIES RUN_SERIAL TRUE)
|
||||
ENDIF()
|
||||
|
||||
IF(LARGE_FILE_TESTS)
|
||||
|
Loading…
Reference in New Issue
Block a user