From 9b46b90e16a1e4761a966035113ac0b02eb6f0ec Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Mon, 10 Aug 2020 05:35:12 -0600 Subject: [PATCH] now trying caching for cmake build --- .github/workflows/cmake.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index fa04163683c..d483408d80d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -15,6 +15,8 @@ jobs: CC: mpicc FC: mpifort CPPFLAGS: "-I/usr/include -I/usr/local/include" + CPPFLAGS: "-I/usr/include -I/usr/local/include -I/home/runner/pnetcdf/include" + LDFLAGS: "-L/home/runner/pnetcdf/lib" steps: - uses: actions/checkout@v2 @@ -22,23 +24,31 @@ jobs: run: | sudo apt-get install netcdf-bin libnetcdf-dev doxygen graphviz wget gfortran libjpeg-dev libz-dev openmpi-bin libopenmpi-dev - - name: pnetcdf build + - 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: | - wget https://parallel-netcdf.github.io/Release/pnetcdf-1.12.1.tar.gz + 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 - ls -l pushd pnetcdf-1.12.1 - ./configure --prefix=/usr --enable-shared --disable-cxx + ./configure --prefix=/home/runner/pnetcdf --enable-shared --disable-cxx make sudo make install popd - name: cmake build run: | - find /usr -name libnetcdf.so + set -x mkdir build cd build - cmake -Wno-dev -DNetCDF_C_LIBRARY=/usr/lib/x86_64-linux-gnu/libnetcdf.so -DNetCDF_C_INCLUDE_DIR=/usr/include -DCMAKE_PREFIX_PATH=/usr -DPIO_HDF5_LOGGING=On -DPIO_USE_MALLOC=On -DPIO_ENABLE_LOGGING=On -DPIO_ENABLE_TIMING=Off .. + cmake -Wno-dev -DNetCDF_C_LIBRARY=/usr/lib/x86_64-linux-gnu/libnetcdf.so -DNetCDF_C_INCLUDE_DIR=/usr/include -DCMAKE_PREFIX_PATH='/usr;/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