Merge pull request #62 from wkliao/openmpi #156
This file contains hidden or 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
name: Test PnetCDF-C master branch | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '**/*.md' | |
- '**/*.txt' | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- '**/*.md' | |
- '**/*.txt' | |
jobs: | |
build-linux: | |
name: Python (${{ matrix.python-version }}) | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
env: | |
MPICH_VERSION: 4.3.0 | |
MPICH_DIR: ${{ github.workspace }}/mpich-install | |
PNETCDF_VERSION: repo | |
PNETCDF_DIR: ${{ github.workspace }}/PnetCDF-install | |
AUTOCONF_VERSION: 2.71 | |
AUTOMAKE_VERSION: 1.17 | |
LIBTOOL_VERSION: 2.5.4 | |
M4_VERSION: 1.4.19 | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Ubuntu Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install automake autoconf libtool libtool-bin m4 | |
- name: Build GNU autotools | |
run: | | |
export PATH="${GITHUB_WORKSPACE}/AUTOTOOLS/bin:${PATH}" | |
export LD_LIBRARY_PATH="${GITHUB_WORKSPACE}/AUTOTOOLS/lib:${LD_LIBRARY_PATH}" | |
cd ${GITHUB_WORKSPACE} | |
wget -q https://ftp.gnu.org/gnu/m4/m4-${M4_VERSION}.tar.gz | |
gzip -dc m4-${M4_VERSION}.tar.gz | tar -xf - | |
cd m4-${M4_VERSION} | |
./configure --prefix=${GITHUB_WORKSPACE}/AUTOTOOLS \ | |
--silent | |
make -s -j 8 install > qout 2>&1 | |
make -s -j 8 distclean >> qout 2>&1 | |
cd ${GITHUB_WORKSPACE} | |
wget -q https://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.gz | |
gzip -dc autoconf-${AUTOCONF_VERSION}.tar.gz | tar -xf - | |
cd autoconf-${AUTOCONF_VERSION} | |
./configure --prefix=${GITHUB_WORKSPACE}/AUTOTOOLS \ | |
--silent | |
make -s -j 8 install > qout 2>&1 | |
make -s -j 8 distclean >> qout 2>&1 | |
cd ${GITHUB_WORKSPACE} | |
wget -q https://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.gz | |
gzip -dc automake-${AUTOMAKE_VERSION}.tar.gz | tar -xf - | |
cd automake-${AUTOMAKE_VERSION} | |
./configure --prefix=${GITHUB_WORKSPACE}/AUTOTOOLS \ | |
--silent | |
make -s -j 8 install > qout 2>&1 | |
make -s -j 8 distclean >> qout 2>&1 | |
cd ${GITHUB_WORKSPACE} | |
wget -q https://ftp.gnu.org/gnu/libtool/libtool-${LIBTOOL_VERSION}.tar.gz | |
gzip -dc libtool-${LIBTOOL_VERSION}.tar.gz | tar -xf - | |
cd libtool-${LIBTOOL_VERSION} | |
./configure --prefix=${GITHUB_WORKSPACE}/AUTOTOOLS \ | |
--silent | |
make -s -j 8 install > qout 2>&1 | |
make -s -j 8 distclean >> qout 2>&1 | |
- name: Build MPICH | |
run: | | |
echo "Install MPICH ${MPICH_VERSION} in $MPICH_DIR" | |
rm -rf MPICH ; mkdir MPICH ; cd MPICH | |
wget -q https://www.mpich.org/static/downloads/${MPICH_VERSION}/mpich-${MPICH_VERSION}.tar.gz | |
gzip -dc mpich-${MPICH_VERSION}.tar.gz | tar -xf - | |
cd mpich-${MPICH_VERSION} | |
./configure --prefix=$MPICH_DIR \ | |
--silent \ | |
--enable-romio \ | |
--with-file-system=ufs \ | |
--with-device=ch3:sock \ | |
--enable-shared\ | |
--disable-fortran \ | |
CC=gcc | |
make -s LIBTOOLFLAGS=--silent V=1 -j 4 install > qout 2>&1 | |
make -s -j 4 distclean >> qout 2>&1 | |
- name: Build PnetCDF-C from master branch | |
run: | | |
echo "Build PnetCDF-C from its master branch" | |
cd ${GITHUB_WORKSPACE} | |
export PATH="${GITHUB_WORKSPACE}/AUTOTOOLS/bin:${PATH}" | |
export LD_LIBRARY_PATH="${GITHUB_WORKSPACE}/AUTOTOOLS/lib:${LD_LIBRARY_PATH}" | |
m4 --version | |
autoconf --version | |
automake --version | |
libtool --version | |
git clone -q https://github.com/Parallel-NetCDF/PnetCDF.git | |
pushd PnetCDF | |
autoreconf -i | |
./configure --prefix=$PNETCDF_DIR \ | |
--silent \ | |
--enable-shared \ | |
--enable-debug \ | |
--disable-fortran \ | |
--disable-cxx \ | |
--with-mpi=$MPICH_DIR | |
make -s LIBTOOLFLAGS=--silent V=1 -j 4 install > qout 2>&1 | |
make -s -j 4 distclean >> qout 2>&1 | |
popd | |
- name: Install python dependencies via pip | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
pip install numpy cython cftime pytest twine check-manifest | |
export MPICC=$MPICH_DIR/bin/mpicc | |
pip install mpi4py | |
pip install torch torchvision | |
- name: Install PnetCDF-Python | |
run: | | |
export CC=$MPICH_DIR/bin/mpicc | |
pip install --verbose --no-build-isolation -e . | |
- name: Test PnetCDF-Python | |
run: | | |
export PATH=${MPICH_DIR}/bin:${PATH} | |
make ptests TESTMPIRUN="${MPICH_DIR}/bin/mpiexec" | |
- name: Re-install PnetCDF-Python from source distribution | |
run: | | |
pip uninstall -y pnetcdf | |
make install-clean | |
export CC=$MPICH_DIR/bin/mpicc | |
python setup.py sdist | |
pip install --verbose dist/pnetcdf-*.tar.gz | |
- name: Test PnetCDF-Python | |
run: | | |
export PATH=${MPICH_DIR}/bin:${PATH} | |
make ptests TESTMPIRUN="${MPICH_DIR}/bin/mpiexec" | |
# - name: Tarball | |
# run: | | |
# export PATH=${NETCDF_DIR}/bin:${PATH} | |
# python setup.py --version | |
# check-manifest --version | |
# check-manifest --verbose | |
# pip wheel . -w dist --no-deps | |
# twine check dist/* |