From 5f826f6afc7c06f925476a464b820e7844678371 Mon Sep 17 00:00:00 2001
From: Pietro Incardona <incardon@mpi-cbg.de>
Date: Mon, 7 Nov 2016 16:06:58 +0100
Subject: [PATCH] Fixing installation PETSC

---
 configure.ac            | 13 ++++++++++---
 script/install_PETSC.sh | 10 +++++-----
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index f493e1160..78e94cf74 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 ccb0c536f..d4f67ab9d 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
 
-- 
GitLab