diff --git a/script/install_HDF5.sh b/script/install_HDF5.sh
index 1494ba69ccde118d3f41f484d04fde1f0c5e5189..dea5e9476864e354ac13d3786313b015136a9683 100755
--- a/script/install_HDF5.sh
+++ b/script/install_HDF5.sh
@@ -22,7 +22,7 @@ if [ ! -d "$1/ZLIB"  -a x"$platform" != x"cygwin" ]; then
   tar -xf zlib-1.2.12.tar.gz
   cd zlib-1.2.12
 
-  CC=mpicc ./configure --prefix=$1/ZLIB
+  CC=mpicc CFLAGS=-fPIC  ./configure --prefix=$1/ZLIB
   make -j $2
   if [ $? -eq 0 ]; then
     make check install