diff --git a/configure.ac b/configure.ac
index f493e1160a3cfe713fe47b3eafd7ea23806eb0a8..78e94cf7416e3d83aa6719b401c3d66ec75a5c83 100644
--- a/configure.ac
+++ b/configure.ac
@@ -143,9 +143,16 @@ AX_LIB_PETSC()
 
 ## Check for quadmath
 
-AC_CHECK_LIB(quadmath, sinq, [AC_DEFINE(HAVE_LIBQUADMATH,[],[Have quad math lib])
-                                LIBQUADMATH=" -lquadmath "
-                                ], [])
+
+have_quad_lib=no
+have_quad_head=no
+AC_CHECK_LIB(quadmath, sinq, [have_quad_lib=yes], [])
+AC_CHECK_HEADER(quadmath.h,[have_quad_head=yes],[])
+
+if [x"have_quad_math" == x"yes" $&& x"have_quad_math" == x"yes" ]; then
+    AC_DEFINE(HAVE_LIBQUADMATH,[],[Have quad math lib])
+    LIBQUADMATH=" -lquadmath "
+fi
 
 AC_SUBST(OPENMP_CFLAGS)
 AC_SUBST(OPENMP_LDFLAGS)
diff --git a/script/install_PETSC.sh b/script/install_PETSC.sh
index ccb0c536fea18706c7cb2a2e1cefe2ba059feaba..d4f67ab9d7176e5e3fd0266293f277ff4fc13d4a 100755
--- a/script/install_PETSC.sh
+++ b/script/install_PETSC.sh
@@ -46,9 +46,9 @@ if [ -d "$1/METIS" ]; then
   configure_options="$configure_options --with-metis=yes --with-metis-dir=$1/METIS  "
 fi
 
-if [ -d "$1/HDF5" ]; then
-  configure_options="$configure_options --with-hdf5=yes --with-hdf5-dir=$1/HDF5  "
-fi
+#if [ -d "$1/HDF5" ]; then
+#  configure_options="$configure_options --with-hdf5=yes --with-hdf5-dir=$1/HDF5  "
+#fi
 
 if [ -d "$1/BOOST" ]; then  
   configure_options="$configure_options --with-boost=yes --with-boost-dir=$1/BOOST "
@@ -292,9 +292,9 @@ fi
 tar -xf petsc-lite-3.6.4.tar.gz
 cd petsc-3.6.4
 
-echo "./configure --with-cxx-dialect=C++11 --with-mpi-dir=$mpi_dir  $configure_options  --prefix=$1/PETSC"
+echo "./configure --with-cxx-dialect=C++11 --with-mpi-dir=$mpi_dir  $configure_options  --prefix=$1/PETSC --with-debugging=0"
 
-./configure --with-cxx-dialect=C++11 $petsc_openmp --with-mpi-dir=$mpi_dir  $configure_options --with-mumps-lib="$MUMPS_extra_lib"  --prefix=$1/PETSC
+./configure --with-cxx-dialect=C++11 $petsc_openmp --with-mpi-dir=$mpi_dir  $configure_options --with-mumps-lib="$MUMPS_extra_lib"  --prefix=$1/PETSC --with-debugging=0
 make all test
 make install