[cig-commits] [commit] devel, master: build: Add --enable-debug option to configure. (5c369ff)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Thu Nov 6 08:30:21 PST 2014


Repository : https://github.com/geodynamics/specfem3d_globe

On branches: devel,master
Link       : https://github.com/geodynamics/specfem3d_globe/compare/bc58e579b3b0838a0968725a076f5904845437ca...be63f20cbb6f462104e949894dbe205d2398cd7f

>---------------------------------------------------------------

commit 5c369ffdd27e1f219d90cca80096b13d93db1df5
Author: Elliott Sales de Andrade <esalesde at physics.utoronto.ca>
Date:   Sun Sep 7 21:06:04 2014 -0400

    build: Add --enable-debug option to configure.
    
    At the moment, this only switches from optimizing options to debugging
    options.


>---------------------------------------------------------------

5c369ffdd27e1f219d90cca80096b13d93db1df5
 configure    | 30 ++++++++++++++++++++++++++++++
 configure.ac | 13 +++++++++++++
 flags.guess  |  6 +++++-
 3 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 1056b4e..dae75a7 100755
--- a/configure
+++ b/configure
@@ -694,6 +694,8 @@ COND_CUDA5_FALSE
 COND_CUDA5_TRUE
 COND_CUDA_FALSE
 COND_CUDA_TRUE
+COND_DEBUG_FALSE
+COND_DEBUG_TRUE
 CUSTOM_MPI_TYPE
 CUSTOM_REAL
 host_os
@@ -746,6 +748,7 @@ ac_subst_files=''
 ac_user_opts='
 enable_option_checking
 enable_double_precision
+enable_debug
 with_cuda
 with_opencl
 enable_vtk
@@ -1401,6 +1404,7 @@ Optional Features:
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --enable-double-precision
                           solver in double precision [default=no]
+  --enable-debug          build with debugging options enabled [default=no]
   --enable-vtk            build VTK enabled version [default=no]
   --enable-vectorization  build FORCE_VECTORIZATION enabled version
                           [default=yes]
@@ -2737,6 +2741,28 @@ fi
 
 
 ###
+### debugging
+###
+
+# Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then :
+  enableval=$enable_debug; want_debug="$enableval"
+else
+  want_debug=no
+fi
+
+ if test x"$want_debug" != xno; then
+  COND_DEBUG_TRUE=
+  COND_DEBUG_FALSE='#'
+else
+  COND_DEBUG_TRUE='#'
+  COND_DEBUG_FALSE=
+fi
+
+export COND_DEBUG_FALSE
+export COND_DEBUG_TRUE
+
+###
 ### GPU
 ###
 
@@ -7655,6 +7681,10 @@ LIBOBJS=$ac_libobjs
 LTLIBOBJS=$ac_ltlibobjs
 
 
+if test -z "${COND_DEBUG_TRUE}" && test -z "${COND_DEBUG_FALSE}"; then
+  as_fn_error $? "conditional \"COND_DEBUG\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${COND_CUDA_TRUE}" && test -z "${COND_CUDA_FALSE}"; then
   as_fn_error $? "conditional \"COND_CUDA\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/configure.ac b/configure.ac
index 12d4334..8246575 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,6 +44,19 @@ AC_SUBST([CUSTOM_REAL])
 AC_SUBST([CUSTOM_MPI_TYPE])
 
 ###
+### debugging
+###
+
+AC_ARG_ENABLE([debug],
+    [AC_HELP_STRING([--enable-debug],
+        [build with debugging options enabled @<:@default=no@:>@])],
+    [want_debug="$enableval"],
+    [want_debug=no])
+AM_CONDITIONAL([COND_DEBUG], [test x"$want_debug" != xno])
+export COND_DEBUG_FALSE
+export COND_DEBUG_TRUE
+
+###
 ### GPU
 ###
 
diff --git a/flags.guess b/flags.guess
index 11939ba..e74e1f2 100644
--- a/flags.guess
+++ b/flags.guess
@@ -231,7 +231,11 @@ esac
 #DEF_CFLAGS="-g -O3"
 
 if test "x$FLAGS_CHECK" = "x"; then
-    FLAGS_CHECK="$DEF_FFLAGS $OPT_FFLAGS"
+    if test "x$COND_DEBUG_TRUE" = "x"; then
+        FLAGS_CHECK="$DEF_FFLAGS $DEBUG_FFLAGS"
+    else
+        FLAGS_CHECK="$DEF_FFLAGS $OPT_FFLAGS"
+    fi
 fi
 if test "x$MPIFC" = "x"; then
     MPIFC="$DEF_MPIFC"



More information about the CIG-COMMITS mailing list