cd /path/to/zlib wget https://zlib.net/fossils/zlib-1.2.13.tar.gz
tar xf zlib-1.2.13.tar.gz cd zlib-1.2.13
CC=mpicc CXX=mpicxx FC=mpif90 ./configure --prefix=/path/to/zlib
make -j make install
export ZLIB_PATH=/path/to/zlib export PATH=${ZLIB_PATH}/bin:$PATH export LD_LIBRARY_PATH=${ZLIB_PATH}/lib:$LD_LIBRARY_PATH export INCLUDE=${ZLIB_PATH}/include:$INCLUDE