Skip to content

Commit

Permalink
Merge pull request ESMCI#1737 from NCAR/ejh_flags_next
Browse files Browse the repository at this point in the history
fixing MPIEXEC in library summary for CMake builds
  • Loading branch information
edwardhartnett authored Aug 28, 2020
2 parents 22d1160 + 5f8e9fa commit f6feb76
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 7 deletions.
129 changes: 129 additions & 0 deletions .github/workflows/a4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: netcdf-4.7.4_pnetcdf-12.1_ncint_mpich-3.3

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

env:
CPPFLAGS: "-I/home/runner/mpich/include -I/home/runner/hdf5/include -I/home/runner/netcdf-c/include -I/home/runner/netcdf-fortran/include -I/home/runner/pnetcdf/include"
LDFLAGS: "-L/home/runner/mpich/lib -L/home/runner/hdf5/lib -L/home/runner/netcdf-c/lib -L/home/runner/netcdf-fortran/lib -L/home/runner/pnetcdf/lib"

steps:
- uses: actions/checkout@v2
- name: Installs
run: |
sudo apt-get install doxygen graphviz wget gfortran libjpeg-dev libz-dev
- name: cache-mpich
id: cache-mpich
uses: actions/cache@v2
with:
path: ~/mpich
key: mpich-${{ runner.os }}-3.3.2

- name: build-mpich
if: steps.cache-mpich.outputs.cache-hit != 'true'
run: |
wget http://www.mpich.org/static/downloads/3.3.2/mpich-3.3.2.tar.gz &> /dev/null
tar -xzf mpich-3.3.2.tar.gz
pushd mpich-3.3.2
./configure --prefix=/home/runner/mpich
make
sudo make install
popd
- name: cache-hdf5
id: cache-hdf5
uses: actions/cache@v2
with:
path: ~/hdf5
key: hdf5-${{ runner.os }}-1.10.6-mpich-3.3.2

- name: build-hdf5
if: steps.cache-hdf5.outputs.cache-hit != 'true'
run: |
set -x
export PATH="/home/runner/mpich/bin:$PATH"
export CC=/home/runner/mpich/bin/mpicc
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.6/src/hdf5-1.10.6.tar.gz &> /dev/null
tar -xzf hdf5-1.10.6.tar.gz
pushd hdf5-1.10.6
./configure --prefix=/home/runner/hdf5 --enable-parallel --disable-tools --disable-fortran --disable-cxx --enable-parallel-tests
make
sudo make install
popd
- name: cache-netcdf-c
id: cache-netcdf-c
uses: actions/cache@v2
with:
path: ~/netcdf-c
key: netcdf-c-${{ runner.os }}-4.7.4-mpich-3.3.2

- name: build-netcdf-c
if: steps.cache-netcdf-c.outputs.cache-hit != 'true'
run: |
set -x
export PATH="/home/runner/mpich/bin:$PATH"
export CC=/home/runner/mpich/bin/mpicc
wget https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-c-4.7.4.tar.gz &> /dev/null
tar -xzf netcdf-c-4.7.4.tar.gz
pushd netcdf-c-4.7.4
./configure --prefix=/home/runner/netcdf-c --disable-dap --disable-utilities
make -j
sudo make install
popd
- name: cache-netcdf-fortran
id: cache-netcdf-fortran
uses: actions/cache@v2
with:
path: ~/netcdf-fortran
key: netcdf-fortran-${{ runner.os }}-4.5.3-mpich-3.3.2

- name: build-netcdf-fortran
if: steps.cache-netcdf-fortran.outputs.cache-hit != 'true'
run: |
set -x
export PATH="/home/runner/mpich/bin:$PATH"
export CC=/home/runner/mpich/bin/mpicc
wget https://github.com/Unidata/netcdf-fortran/archive/v4.5.3.tar.gz &> /dev/null
tar -xzf v4.5.3.tar.gz
pushd netcdf-fortran-4.5.3
./configure --prefix=/home/runner/netcdf-fortran
make -j
sudo make install
popd
- name: cache-pnetcdf
id: cache-pnetcdf
uses: actions/cache@v2
with:
path: ~/pnetcdf
key: pnetcdf-${{ runner.os }}-1.12.1-mpich-3.3.2

- name: build-pnetcdf
if: steps.cache-pnetcdf.outputs.cache-hit != 'true'
run: |
set -x
export PATH="/home/runner/mpich/bin:$PATH"
export CC=/home/runner/mpich/bin/mpicc
wget https://parallel-netcdf.github.io/Release/pnetcdf-1.12.1.tar.gz &> /dev/null
tar -xzf 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: autotools build
run: |
set -x
echo 'export PATH=/home/runner/mpich/bin:$PATH' > .bashrc
source .bashrc
export CC=/home/runner/mpich/bin/mpicc
autoreconf -i
./configure
make -j check
17 changes: 10 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ endif()
# Set a variable that appears in the config.h.in file.
if(PIO_ENABLE_LOGGING)
set(ENABLE_LOGGING 1)
set(HAS_LOGGING "yes")
else()
set(ENABLE_LOGGING 0)
set(HAS_LOGGING "no")
endif()

# Set a variable that appears in the config.h.in file.
Expand Down Expand Up @@ -381,6 +383,14 @@ else ()
set(HAVE_NETCDF_INTEGRATION 0)
endif ()

# Configure testing with MPIEXEC.
if (NOT WITH_MPIEXEC)
set(WITH_MPIEXEC mpiexec)
endif()
#set(MPIEXEC "${WITH_MPIEXEC}" CACHE INTERNAL "")
set(MPIEXEC "${WITH_MPIEXEC}")
set_property(GLOBAL PROPERTY WITH_MPIEXEC "${WITH_MPIEXEC}")

#####
# Configure and print the libpio.settings file.
#####
Expand Down Expand Up @@ -461,10 +471,3 @@ configure_file (
"${PROJECT_SOURCE_DIR}/cmake_config.h.in"
"${PROJECT_BINARY_DIR}/config.h"
)

# Configure test scripts.
if (NOT WITH_MPIEXEC)
set(WITH_MPIEXEC mpiexec)
endif()
set(MPIEXEC "${WITH_MPIEXEC}" CACHE INTERNAL "")
set_property(GLOBAL PROPERTY WITH_MPIEXEC "${WITH_MPIEXEC}")

0 comments on commit f6feb76

Please sign in to comment.