Skip to content

Instantly share code, notes, and snippets.

@dpo
Created June 20, 2014 00:03
Show Gist options
  • Select an option

  • Save dpo/ae679225d8850cfa4608 to your computer and use it in GitHub Desktop.

Select an option

Save dpo/ae679225d8850cfa4608 to your computer and use it in GitHub Desktop.
Index: configure
===================================================================
--- configure (revision 491)
+++ configure (revision 517)
@@ -700,6 +700,7 @@
ac_ct_CC
CFLAGS
CC
+HAVE_CXX11
am__fastdepCXX_FALSE
am__fastdepCXX_TRUE
CXXDEPMODE
@@ -719,6 +720,8 @@
CXX
BUILD_ADOLC_AMPI_SUPPORT_FALSE
BUILD_ADOLC_AMPI_SUPPORT_TRUE
+DARWIN_FALSE
+DARWIN_TRUE
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
@@ -3445,6 +3448,15 @@
esac
done
+ if test "x${host_os#darwin}" != "x${host_os}"; then
+ DARWIN_TRUE=
+ DARWIN_FALSE='#'
+else
+ DARWIN_TRUE='#'
+ DARWIN_FALSE=
+fi
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build ADOL-C with adjoinable MPI (AMPI) support" >&5
$as_echo_n "checking whether to build ADOL-C with adjoinable MPI (AMPI) support... " >&6; }
# Check whether --enable-ampi was given.
@@ -4169,6 +4181,129 @@
fi
+
+ ax_cxx_compile_cxx11_required=truednl
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+ ac_success=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5
+$as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; }
+if ${ax_cv_cxx_compile_cxx11+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ template <typename T>
+ struct check
+ {
+ static_assert(sizeof(int) <= sizeof(T), "not big enough");
+ };
+
+ typedef check<check<bool>> right_angle_brackets;
+
+ int a;
+ decltype(a) b;
+
+ typedef check<int> check_type;
+ check_type c;
+ check_type&& cr = static_cast<check_type&&>(c);
+
+ auto d = a;
+
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ax_cv_cxx_compile_cxx11=yes
+else
+ ax_cv_cxx_compile_cxx11=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5
+$as_echo "$ax_cv_cxx_compile_cxx11" >&6; }
+ if test x$ax_cv_cxx_compile_cxx11 = xyes; then
+ ac_success=yes
+ fi
+
+
+
+ if test x$ac_success = xno; then
+ for switch in -std=c++11 -std=c++0x; do
+ cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5
+$as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; }
+if eval \${$cachevar+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS $switch"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ template <typename T>
+ struct check
+ {
+ static_assert(sizeof(int) <= sizeof(T), "not big enough");
+ };
+
+ typedef check<check<bool>> right_angle_brackets;
+
+ int a;
+ decltype(a) b;
+
+ typedef check<int> check_type;
+ check_type c;
+ check_type&& cr = static_cast<check_type&&>(c);
+
+ auto d = a;
+
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ eval $cachevar=yes
+else
+ eval $cachevar=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CXXFLAGS="$ac_save_CXXFLAGS"
+fi
+eval ac_res=\$$cachevar
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ if eval test x\$$cachevar = xyes; then
+ CXXFLAGS="$CXXFLAGS $switch"
+ ac_success=yes
+ break
+ fi
+ done
+ fi
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ if test x$ax_cxx_compile_cxx11_required = xtrue; then
+ if test x$ac_success = xno; then
+ as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5
+ fi
+ else
+ if test x$ac_success = xno; then
+ HAVE_CXX11=0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5
+$as_echo "$as_me: No compiler with C++11 support was found" >&6;}
+ else
+ HAVE_CXX11=1
+
+$as_echo "#define HAVE_CXX11 1" >>confdefs.h
+
+ fi
+
+
+ fi
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4836,6 +4971,183 @@
fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if ${ac_cv_prog_cc_c99+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros. These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+ int x = 1234;
+ int y = 5678;
+ debug ("Flag");
+ debug ("X = %d\n", x);
+ showlist (The first, second, and third items.);
+ report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+ your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+ your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+ int datasize;
+ double data[];
+};
+
+struct named_init {
+ int number;
+ const wchar_t *name;
+ double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+ // See if C++-style comments work.
+ // Iterate through items via the restricted pointer.
+ // Also check for declarations in for loops.
+ for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+ continue;
+ return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ va_list args_copy;
+ va_copy (args_copy, args);
+
+ const char *str;
+ int number;
+ float fnumber;
+
+ while (*format)
+ {
+ switch (*format++)
+ {
+ case 's': // string
+ str = va_arg (args_copy, const char *);
+ break;
+ case 'd': // int
+ number = va_arg (args_copy, int);
+ break;
+ case 'f': // float
+ fnumber = va_arg (args_copy, double);
+ break;
+ default:
+ break;
+ }
+ }
+ va_end (args_copy);
+ va_end (args);
+}
+
+int
+main ()
+{
+
+ // Check bool.
+ _Bool success = false;
+
+ // Check restrict.
+ if (test_restrict ("String literal") == 0)
+ success = true;
+ char *restrict newvar = "Another string";
+
+ // Check varargs.
+ test_varargs ("s, d' f .", "string", 65, 34.234);
+ test_varargs_macros ();
+
+ // Check flexible array members.
+ struct incomplete_array *ia =
+ malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+ ia->datasize = 10;
+ for (int i = 0; i < ia->datasize; ++i)
+ ia->data[i] = i * 1.234;
+
+ // Check named initializers.
+ struct named_init ni = {
+ .number = 34,
+ .name = L"Test wide string",
+ .average = 543.34343,
+ };
+
+ ni.number = 58;
+
+ int dynamic_array[ni.number];
+ dynamic_array[ni.number - 1] = 543;
+
+ // work around unused variable warnings
+ return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+ || dynamic_array[ni.number - 1] != 543);
+
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c99"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+
+fi
+
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -8741,7 +9053,6 @@
-
func_stripname_cnf ()
{
case ${2} in
@@ -17609,6 +17920,10 @@
as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${DARWIN_TRUE}" && test -z "${DARWIN_FALSE}"; then
+ as_fn_error $? "conditional \"DARWIN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${BUILD_ADOLC_AMPI_SUPPORT_TRUE}" && test -z "${BUILD_ADOLC_AMPI_SUPPORT_FALSE}"; then
as_fn_error $? "conditional \"BUILD_ADOLC_AMPI_SUPPORT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
Index: Makefile.in
===================================================================
--- Makefile.in (revision 491)
+++ Makefile.in (revision 517)
@@ -107,7 +107,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -284,6 +285,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/test/Makefile.in
===================================================================
--- ADOL-C/test/Makefile.in (revision 491)
+++ ADOL-C/test/Makefile.in (revision 517)
@@ -95,7 +95,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -214,6 +215,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/Makefile.in
===================================================================
--- ADOL-C/Makefile.in (revision 491)
+++ ADOL-C/Makefile.in (revision 517)
@@ -82,7 +82,8 @@
build_triplet = @build@
host_triplet = @host@
@BUILD_ADOLC_AMPI_SUPPORT_TRUE@am__append_1 = src/libadolcampi.la
-@SPARSE_TRUE@am__append_2 = src/sparse/libsparse.la
+@BUILD_ADOLC_AMPI_SUPPORT_TRUE@@DARWIN_TRUE@am__append_2 = -Wl,-undefined,dynamic_lookup
+@SPARSE_TRUE@am__append_3 = src/sparse/libsparse.la
subdir = ADOL-C
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/autoconf/depcomp
@@ -95,7 +96,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -133,7 +135,7 @@
LTLIBRARIES = $(lib_LTLIBRARIES)
lib@adolclib@_la_DEPENDENCIES = src/libadolcsrc.la $(am__append_1) \
src/drivers/libdrivers.la src/tapedoc/libtapedoc.la \
- $(am__append_2)
+ $(am__append_3)
am_lib@adolclib@_la_OBJECTS = dummy.lo
lib@adolclib@_la_OBJECTS = $(am_lib@adolclib@_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
@@ -283,6 +285,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -390,11 +393,12 @@
@DOCEXA_TRUE@SUBDIRS = src . test examples include
MAINTAINERCLEANFILES = Makefile.in
lib_LTLIBRARIES = lib@adolclib@.la
-lib@adolclib@_la_LDFLAGS = -version-info 3:0:2 -no-undefined
+lib@adolclib@_la_LDFLAGS = -version-info 3:0:2 -no-undefined \
+ $(am__append_2)
lib@adolclib@_la_SOURCES = dummy.cpp
lib@adolclib@_la_LIBADD = src/libadolcsrc.la $(am__append_1) \
src/drivers/libdrivers.la src/tapedoc/libtapedoc.la \
- $(am__append_2)
+ $(am__append_3)
all: all-recursive
.SUFFIXES:
Index: ADOL-C/include/Makefile.in
===================================================================
--- ADOL-C/include/Makefile.in (revision 491)
+++ ADOL-C/include/Makefile.in (revision 517)
@@ -91,7 +91,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -215,6 +216,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/include/adolc/tapedoc/Makefile.in
===================================================================
--- ADOL-C/include/adolc/tapedoc/Makefile.in (revision 491)
+++ ADOL-C/include/adolc/tapedoc/Makefile.in (revision 517)
@@ -93,7 +93,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -204,6 +205,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/include/adolc/Makefile.in
===================================================================
--- ADOL-C/include/adolc/Makefile.in (revision 491)
+++ ADOL-C/include/adolc/Makefile.in (revision 517)
@@ -94,7 +94,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -247,6 +248,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/include/adolc/sparse/Makefile.in
===================================================================
--- ADOL-C/include/adolc/sparse/Makefile.in (revision 491)
+++ ADOL-C/include/adolc/sparse/Makefile.in (revision 517)
@@ -93,7 +93,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -204,6 +205,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/include/adolc/adouble.h
===================================================================
--- ADOL-C/include/adolc/adouble.h (revision 491)
+++ ADOL-C/include/adolc/adouble.h (revision 517)
@@ -29,11 +29,14 @@
#include <cstdlib>
#include <iostream>
#include <cmath>
+#include <stdexcept>
+
using std::cout;
using std::cin;
using std::cerr;
using std::ostream;
using std::istream;
+using std::logic_error;
#include <adolc/common.h>
@@ -245,18 +248,19 @@
friend ADOLC_DLL_EXPORT class adouble;
friend ADOLC_DLL_EXPORT class advector;
friend ADOLC_DLL_EXPORT class adubref;
+ friend ADOLC_DLL_EXPORT adub* adubp_from_adub(const adub&);
adub( adub const &) {}
protected:
adub( locint lo ):badouble(lo) {};
adub( void ):badouble(0) {
fprintf(DIAG_OUT,"ADOL-C error: illegal default construction of adub"
" variable\n");
- exit(-2);
+ throw logic_error("illegal constructor call, errorcode=-2");
};
explicit adub( double ):badouble(0) {
fprintf(DIAG_OUT,"ADOL-C error: illegal construction of adub variable"
" from double\n");
- exit(-2);
+ throw logic_error("illegal constructor call, errorcode=-2");
};
public:
Index: ADOL-C/include/adolc/adtl.h
===================================================================
--- ADOL-C/include/adolc/adtl.h (revision 491)
+++ ADOL-C/include/adolc/adtl.h (revision 517)
@@ -20,10 +20,12 @@
#include <ostream>
#include <adolc/common.h>
#include <list>
+#include <stdexcept>
using std::ostream;
using std::istream;
using std::list;
+using std::logic_error;
namespace adtl {
@@ -274,26 +276,26 @@
#endif
inline bool adouble::_do_val() {
- return (forward_mode & ADTL_Z_MASK == ADTL_Z_MASK);
+ return ((forward_mode & ADTL_Z_MASK) == ADTL_Z_MASK);
}
#define do_val() likely(adouble::_do_val())
#define no_do_val() unlikely(!adouble::_do_val())
inline bool adouble::_do_adval() {
- return (forward_mode & ADTL_F_MASK == ADTL_F_MASK);
+ return ((forward_mode & ADTL_F_MASK) == ADTL_F_MASK);
}
#define do_adval() likely(adouble::_do_adval())
#define no_do_adval() unlikely(!adouble::_do_adval())
inline bool adouble::_do_indo() {
- return (forward_mode & ADTL_I_MASK == ADTL_I_MASK);
+ return ((forward_mode & ADTL_I_MASK) == ADTL_I_MASK);
}
#define do_indo() unlikely(adouble::_do_indo())
#define no_do_indo() likely(!adouble::_do_indo())
inline void setNumDir(const size_t p) {
if (refcounter::refcnt > 0) {
- fprintf(DIAG_OUT, "ADOL-C Warning: Tapeless: Setting numDir will not change the number of\n directional derivative in existing adoubles and may lead to erronious results\n or memory corruption\n Number of currently existing adoubles = %z\n", refcounter::refcnt);
+ fprintf(DIAG_OUT, "ADOL-C Warning: Tapeless: Setting numDir will not change the number of\n directional derivative in existing adoubles and may lead to erronious results\n or memory corruption\n Number of currently existing adoubles = %zu\n", refcounter::refcnt);
}
if (p < 1) {
fprintf(DIAG_OUT, "ADOL-C Error: Tapeless: You are being a moron now.\n");
@@ -304,7 +306,7 @@
inline void setMode(enum Mode newmode) {
if (refcounter::refcnt > 0) {
- fprintf(DIAG_OUT, "ADOL-C Warning: Tapeless: Setting mode will the change the mode of\n computation in previously computed variables and may lead to erronious results\n or memory corruption\n Number of currently exisiting adoubles = %z\n", refcounter::refcnt);
+ fprintf(DIAG_OUT, "ADOL-C Warning: Tapeless: Setting mode will the change the mode of\n computation in previously computed variables and may lead to erronious results\n or memory corruption\n Number of currently exisiting adoubles = %zu\n", refcounter::refcnt);
}
adouble::forward_mode = newmode;
}
@@ -478,7 +480,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=val*a.val;
@@ -521,7 +523,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=val/a.val;
@@ -539,7 +541,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=v/a.val;
@@ -594,7 +596,7 @@
double tmp2;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP::tan(a.val);
@@ -613,7 +615,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP::exp(a.val);
@@ -629,7 +631,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP::log(a.val);
@@ -650,7 +652,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP::sqrt(a.val);
@@ -672,7 +674,7 @@
double tmp2;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP::sin(a.val);
@@ -691,7 +693,7 @@
double tmp2;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP::cos(a.val);
@@ -709,7 +711,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP::asin(a.val);
@@ -727,7 +729,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP::acos(a.val);
@@ -745,7 +747,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP::atan(a.val);
@@ -768,7 +770,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP::atan2(a.val, b.val);
@@ -794,7 +796,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP::pow(a.val, v);
@@ -812,7 +814,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP::pow(a.val, b.val);
@@ -833,7 +835,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP::pow(v, a.val);
@@ -851,7 +853,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP::log10(a.val);
@@ -869,7 +871,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP::sinh(a.val);
@@ -887,7 +889,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP::cosh(a.val);
@@ -905,7 +907,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP::tanh(a.val);
@@ -925,7 +927,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP_ERF::asinh(a.val);
@@ -943,7 +945,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP_ERF::acosh(a.val);
@@ -961,7 +963,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP_ERF::atanh(a.val);
@@ -980,7 +982,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP::fabs(a.val);
@@ -1028,7 +1030,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && (adouble::_do_adval() || adouble::_do_indo()))) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
double tmp2=a.val-b.val;
if (tmp2<0) {
@@ -1068,7 +1070,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && (adouble::_do_adval() || adouble::_do_indo()))) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
double tmp2=v-a.val;
if (tmp2<0) {
@@ -1104,7 +1106,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && (adouble::_do_adval() || adouble::_do_indo()))) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
double tmp2=a.val-v;
if (tmp2<0) {
@@ -1140,7 +1142,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && (adouble::_do_adval() || adouble::_do_indo()))) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
double tmp2=a.val-b.val;
if (tmp2<0) {
@@ -1181,7 +1183,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && (adouble::_do_adval() || adouble::_do_indo()))) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
double tmp2=v-a.val;
if (tmp2<0) {
@@ -1217,7 +1219,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && (adouble::_do_adval() || adouble::_do_indo()))) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
double tmp2=a.val-v;
if (tmp2<0) {
@@ -1272,7 +1274,7 @@
inline double frexp (const adouble &a, int* v) {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return ADOLC_MATH_NSP::frexp(a.val, v);
}
@@ -1282,7 +1284,7 @@
adouble tmp;
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val())
tmp.val=ADOLC_MATH_NSP_ERF::erf(a.val);
@@ -1303,7 +1305,7 @@
const adouble &arg1, const adouble &arg2 ) {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val()) {
if (cond.getValue() > 0)
@@ -1317,7 +1319,7 @@
const adouble &arg ) {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (do_val()) {
if (cond.getValue() > 0)
@@ -1398,7 +1400,7 @@
inline adouble& adouble::operator *= (const adouble& a) {
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (likely(adouble::_do_adval() && adouble::_do_val()))
FOR_I_EQ_0_LT_NUMDIR
@@ -1422,7 +1424,7 @@
inline adouble& adouble::operator /= (const adouble& a) {
if (unlikely(!adouble::_do_val() && adouble::_do_adval())) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (likely(adouble::_do_adval() && adouble::_do_val()))
FOR_I_EQ_0_LT_NUMDIR
@@ -1438,7 +1440,7 @@
inline int adouble::operator ! () const {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return val==0.0;
}
@@ -1447,7 +1449,7 @@
inline int adouble::operator != (const adouble &a) const {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return val!=a.val;
}
@@ -1455,7 +1457,7 @@
inline int adouble::operator != (const double v) const {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return val!=v;
}
@@ -1463,7 +1465,7 @@
inline int operator != (const double v, const adouble &a) {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return v!=a.val;
}
@@ -1471,7 +1473,7 @@
inline int adouble::operator == (const adouble &a) const {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return val==a.val;
}
@@ -1479,7 +1481,7 @@
inline int adouble::operator == (const double v) const {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return val==v;
}
@@ -1487,7 +1489,7 @@
inline int operator == (const double v, const adouble &a) {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return v==a.val;
}
@@ -1495,7 +1497,7 @@
inline int adouble::operator <= (const adouble &a) const {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return val<=a.val;
}
@@ -1503,7 +1505,7 @@
inline int adouble::operator <= (const double v) const {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return val<=v;
}
@@ -1511,7 +1513,7 @@
inline int operator <= (const double v, const adouble &a) {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return v<=a.val;
}
@@ -1519,7 +1521,7 @@
inline int adouble::operator >= (const adouble &a) const {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return val>=a.val;
}
@@ -1527,7 +1529,7 @@
inline int adouble::operator >= (const double v) const {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return val>=v;
}
@@ -1535,7 +1537,7 @@
inline int operator >= (const double v, const adouble &a) {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return v>=a.val;
}
@@ -1543,7 +1545,7 @@
inline int adouble::operator > (const adouble &a) const {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return val>a.val;
}
@@ -1551,7 +1553,7 @@
inline int adouble::operator > (const double v) const {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return val>v;
}
@@ -1559,7 +1561,7 @@
inline int operator > (const double v, const adouble &a) {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return v>a.val;
}
@@ -1567,7 +1569,7 @@
inline int adouble::operator < (const adouble &a) const {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return val<a.val;
}
@@ -1575,7 +1577,7 @@
inline int adouble::operator < (const double v) const {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return val<v;
}
@@ -1583,7 +1585,7 @@
inline int operator < (const double v, const adouble &a) {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return v<a.val;
}
@@ -1592,7 +1594,7 @@
inline double adouble::getValue() const {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return val;
}
@@ -1600,7 +1602,7 @@
inline void adouble::setValue(const double v) {
if (no_do_val()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
val=v;
}
@@ -1608,7 +1610,7 @@
inline const double *const adouble::getADValue() const {
if (no_do_adval()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return adval;
}
@@ -1616,7 +1618,7 @@
inline void adouble::setADValue(const double *const v) {
if (no_do_adval()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
FOR_I_EQ_0_LT_NUMDIR
ADVAL_I=V_I;
@@ -1625,13 +1627,13 @@
inline double adouble::getADValue(const unsigned int p) const {
if (no_do_adval()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (p>=adouble::numDir)
{
fprintf(DIAG_OUT, "Derivative array accessed out of bounds"\
" while \"getADValue(...)\"!!!\n");
- exit(-1);
+ throw logic_error("incorrect function call, errorcode=-1");
}
return adval[p];
}
@@ -1639,13 +1641,13 @@
inline void adouble::setADValue(const unsigned int p, const double v) {
if (no_do_adval()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (p>=adouble::numDir)
{
fprintf(DIAG_OUT, "Derivative array accessed out of bounds"\
" while \"setADValue(...)\"!!!\n");
- exit(-1);
+ throw logic_error("incorrect function call, errorcode=-1");
}
adval[p]=v;
}
@@ -1653,7 +1655,7 @@
inline const list<unsigned int>& adouble::get_pattern() const {
if (no_do_indo()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
return pattern;
}
@@ -1661,7 +1663,7 @@
inline void adouble::delete_pattern() {
if (no_do_indo()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if ( !pattern.empty() )
pattern.clear();
@@ -1670,7 +1672,7 @@
inline void adouble::add_to_pattern(const list<unsigned int>& v) {
if (no_do_indo()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
if (likely( pattern != v)) {
if( !v.empty() ){
@@ -1688,7 +1690,7 @@
inline size_t adouble::get_pattern_size() const {
if (no_do_indo()) {
fprintf(DIAG_OUT, "ADOL-C error: Tapeless: Incorrect mode, call setMode(enum Mode mode)\n");
- exit(1);
+ throw logic_error("incorrect function call, errorcode=1");
}
size_t s=0;
if( !pattern.empty() )
Index: ADOL-C/include/adolc/common.h
===================================================================
--- ADOL-C/include/adolc/common.h (revision 491)
+++ ADOL-C/include/adolc/common.h (revision 517)
@@ -102,10 +102,10 @@
# define END_C_DECLS
#endif
-#define MAXDEC(a,b) do { register revreal __r = (b); if ( __r > (a) ) (a) = __r; } while (0)
-#define MAXDECI(a,b) do { register int __r = (b); if ( __r > (a) ) (a) = __r; } while (0)
-#define MINDECR(a,b) do { register revreal __r = (b); if ( __r < (a) ) (a) = __r; } while (0)
-#define MINDEC(a,b) do { register int __r = (b); if ( __r < (a) ) (a) = __r; } while (0)
+#define MAXDEC(a,b) do { revreal __r = (b); if ( __r > (a) ) (a) = __r; } while (0)
+#define MAXDECI(a,b) do { int __r = (b); if ( __r > (a) ) (a) = __r; } while (0)
+#define MINDECR(a,b) do { revreal __r = (b); if ( __r < (a) ) (a) = __r; } while (0)
+#define MINDEC(a,b) do { int __r = (b); if ( __r < (a) ) (a) = __r; } while (0)
#define MAX_ADOLC(a,b) ( (a)<(b)? (b):(a) )
#define MIN_ADOLC(a,b) ( (a)>(b)? (b):(a) )
Index: ADOL-C/include/adolc/drivers/Makefile.in
===================================================================
--- ADOL-C/include/adolc/drivers/Makefile.in (revision 491)
+++ ADOL-C/include/adolc/drivers/Makefile.in (revision 517)
@@ -93,7 +93,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -204,6 +205,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/src/tapedoc/tapedoc.c
===================================================================
--- ADOL-C/src/tapedoc/tapedoc.c (revision 491)
+++ ADOL-C/src/tapedoc/tapedoc.c (revision 517)
@@ -59,7 +59,7 @@
fileName[strlen(baseName)+num+strlen(extension)]=0;
if ((fp = fopen(fileName,"w")) == NULL) {
fprintf(DIAG_OUT,"cannot open file !\n");
- exit(1);
+ adolc_exit(1,"",__func__,__FILE__,__LINE__);
}
free((void*)fileName);
fprintf(fp,"\\documentclass{article}\n");
@@ -276,7 +276,7 @@
"number recorded on tape %d (%zu:%zu)\n", depcheck,
indcheck, tag, ADOLC_CURRENT_TAPE_INFOS.stats[NUM_DEPENDENTS],
ADOLC_CURRENT_TAPE_INFOS.stats[NUM_INDEPENDENTS]);
- exit (-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
/* globals */
Index: ADOL-C/src/tapedoc/Makefile.in
===================================================================
--- ADOL-C/src/tapedoc/Makefile.in (revision 491)
+++ ADOL-C/src/tapedoc/Makefile.in (revision 517)
@@ -93,7 +93,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -205,6 +206,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/src/adalloc.c
===================================================================
--- ADOL-C/src/adalloc.c (revision 491)
+++ ADOL-C/src/adalloc.c (revision 517)
@@ -36,6 +36,8 @@
BEGIN_C_DECLS
+extern void adolc_exit(int errorcode, const char *what, const char* function, const char *file, int line);
+
/****************************************************************************/
/* MEMORY MANAGEMENT UTILITIES */
@@ -47,7 +49,7 @@
if (A == NULL) {
fprintf(DIAG_OUT,"ADOL-C error: myalloc1 cannot allocate %zd bytes\n",
(size_t)(m*sizeof(double)));
- exit (-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
}
return A;
@@ -63,12 +65,12 @@
if (Adum == NULL) {
fprintf(DIAG_OUT,"ADOL-C error: myalloc2 cannot allocate %zd bytes\n",
(size_t)(m*n*sizeof(double)));
- exit (-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
if (A == NULL) {
fprintf(DIAG_OUT,"ADOL-C error: myalloc2 cannot allocate %zd bytes\n",
(size_t)(m*sizeof(double*)));
- exit (-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
for (i=0; i<m; i++) {
A[i] = Adum;
@@ -89,17 +91,17 @@
if (Adum == NULL) {
fprintf(DIAG_OUT,"ADOL-C error: myalloc3 cannot allocate %zd bytes\n",
(size_t)(m*n*p*sizeof(double)));
- exit (-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
if (Apt == NULL) {
fprintf(DIAG_OUT,"ADOL-C error: myalloc3 cannot allocate %zd bytes\n",
(size_t)(m*n*sizeof(double*)));
- exit (-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
if (A == NULL) {
fprintf(DIAG_OUT,"ADOL-C error: myalloc3 cannot allocate %zd bytes\n",
(size_t)(m*sizeof(double**)));
- exit (-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
for (i=0; i<m; i++) {
A[i] = Apt;
@@ -142,12 +144,12 @@
if (Idum == NULL) {
fprintf(DIAG_OUT,"ADOL-C error: myallocI2 cannot allocate %i bytes\n",
(int)((2*n-1)*sizeof(double)));
- exit (-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
if (I == NULL) {
fprintf(DIAG_OUT,"ADOL-C error: myallocI2 cannot allocate %i bytes\n",
(int)(n*sizeof(double*)));
- exit (-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
Idum += (n - 1);
I[0] = Idum;
@@ -176,10 +178,10 @@
unsigned int *myalloc1_uint(int m) {
unsigned int *A = (unsigned int*)ADOLC_MALLOC(m,sizeof(unsigned int));
if (A == NULL) {
- fprintf(DIAG_OUT, "ADOL-C error, "__FILE__
+ fprintf(DIAG_OUT, "ADOL-C error, " __FILE__
":%i : \nmyalloc1_ushort cannot allocate %i bytes\n",
__LINE__, (int)(m*sizeof(unsigned int)));
- exit (-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
} /* endif */
return A;
}
@@ -189,10 +191,10 @@
unsigned long int *myalloc1_ulong(int m) {
unsigned long int *A = (unsigned long int*)ADOLC_CALLOC(m,sizeof(unsigned long int));
if (A == NULL) {
- fprintf(DIAG_OUT, "ADOL-C error, "__FILE__
+ fprintf(DIAG_OUT, "ADOL-C error, " __FILE__
":%i : \nmyalloc1_ulong cannot allocate %i bytes\n",
__LINE__, (int)(m*sizeof(unsigned long int)));
- exit (-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
} /* endif */
return A;
}
@@ -204,16 +206,16 @@
unsigned long int **A = (unsigned long int**)ADOLC_CALLOC(m,sizeof(unsigned long int*));
int i;
if (Adum == NULL) {
- fprintf(DIAG_OUT, "ADOL-C error, "__FILE__
+ fprintf(DIAG_OUT, "ADOL-C error, " __FILE__
":%i : \nmyalloc2_ulong cannot allocate %i bytes\n",
__LINE__, (int)(m*n*sizeof(unsigned long int)));
- exit (-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
} /* endif */
if (A == NULL) {
- fprintf(DIAG_OUT, "ADOL-C error, "__FILE__
+ fprintf(DIAG_OUT, "ADOL-C error, " __FILE__
":%i : \nmyalloc2_ulong cannot allocate %i bytes\n",
__LINE__, (int)(m*sizeof(unsigned long int*)));
- exit (-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
} /* endif */
for(i=0;i<m;i++) {
A[i] = Adum;
Index: ADOL-C/src/fixpoint.cpp
===================================================================
--- ADOL-C/src/fixpoint.cpp (revision 491)
+++ ADOL-C/src/fixpoint.cpp (revision 517)
@@ -77,7 +77,7 @@
}
if (fpi_stack_iterator==fpi_stack.end()) {
fprintf(stderr,"ADOL-C Error! No edf found for fixpoint iteration.\n");
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
for (i=0; i<dim_x; i++) x_fix[i] = xu[i];
for (k=1; k<=current->N_max; k++) {
@@ -108,7 +108,7 @@
}
if (fpi_stack_iterator==fpi_stack.end()) {
fprintf(stderr,"ADOL-C Error! No edf found for fixpoint iteration.\n");
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
for (k=1; (k<current->N_max_deriv)|(k<current->N_max); k++) {
for (i=0; i<dim_x; i++) xu[i] = x_fix[i];
@@ -142,7 +142,7 @@
}
if (fpi_stack_iterator==fpi_stack.end()) {
fprintf(stderr,"ADOL-C Error! No edf found for fixpoint iteration.\n");
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
double *U = new double[dim_xu];
double *xi = new double[dim_x];
Index: ADOL-C/src/Makefile.in
===================================================================
--- ADOL-C/src/Makefile.in (revision 491)
+++ ADOL-C/src/Makefile.in (revision 517)
@@ -100,7 +100,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -315,6 +316,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/src/taping_p.h
===================================================================
--- ADOL-C/src/taping_p.h (revision 491)
+++ ADOL-C/src/taping_p.h (revision 517)
@@ -37,7 +37,9 @@
ADOLC_FOS_REVERSE,
ADOLC_FOV_REVERSE,
ADOLC_HOS_REVERSE,
- ADOLC_HOV_REVERSE
+ ADOLC_HOV_REVERSE,
+
+ ADOLC_TAPING
};
/****************************************************************************/
@@ -114,7 +116,8 @@
ADOLC_CHECKPOINTING_REVOLVE_IRREGULAR_TERMINATED,
ADOLC_CHECKPOINTING_UNEXPECTED_REVOLVE_ACTION,
ADOLC_WRONG_PLATFORM_32,
- ADOLC_WRONG_PLATFORM_64
+ ADOLC_WRONG_PLATFORM_64,
+ ADOLC_TAPING_NOT_ACTUALLY_TAPING
};
/* additional infos fail can work with */
extern int failAdditionalInfo1;
@@ -169,11 +172,6 @@
int jacSolv_nax, jacSolv_modeold, jacSolv_cgd;
#ifdef SPARSE
- /* sparse derivative matrices */
-
- int inJacSparseUse;
- int inHessSparseUse;
-
/* sparse Jacobian matrices */
SparseJacInfos sJinfos;
@@ -663,6 +661,12 @@
/****************************************************************************/
void markNewTape();
+/****************************************************************************/
+/* Allows us to throw an exception instead of calling exit() in case of a */
+/* irrecoverable error */
+/****************************************************************************/
+void adolc_exit(int errorcode, const char *what, const char *function, const char* file, int line);
+
END_C_DECLS
/****************************************************************************/
Index: ADOL-C/src/fo_rev.c
===================================================================
--- ADOL-C/src/fo_rev.c (revision 491)
+++ ADOL-C/src/fo_rev.c (revision 517)
@@ -425,13 +425,13 @@
fprintf(DIAG_OUT, "ADOL-C error: Tape %d was not created compatible "
"with %s(..)\n Please call enableMinMaxUsingAbs() "
"before trace_on(%d)\n", tnum, GENERATED_FILENAME, tnum);
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
else if (swchk != ADOLC_CURRENT_TAPE_INFOS.stats[NUM_SWITCHES]) {
fprintf(DIAG_OUT, "ADOL-C error: Number of switches passed %d does not "
- "match with the one recorded on tape %d (%d)\n",swchk,tnum,
+ "match with the one recorded on tape %d (%zu)\n",swchk,tnum,
ADOLC_CURRENT_TAPE_INFOS.stats[NUM_SWITCHES]);
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
else
switchnum = swchk - 1;
@@ -449,6 +449,7 @@
rp_T = (revreal *)malloc(ADOLC_CURRENT_TAPE_INFOS.stats[NUM_MAX_LIVES] *
sizeof(revreal));
if (rp_T == NULL) fail(ADOLC_MALLOC_FAILED);
+ ADOLC_CURRENT_TAPE_INFOS.workMode = ADOLC_FOS_REVERSE;
#ifdef _ABS_NORM_
memset(results,0,sizeof(double)*(indep+swchk));
#endif
@@ -475,6 +476,7 @@
rp_T = (revreal *)malloc(ADOLC_CURRENT_TAPE_INFOS.stats[NUM_MAX_LIVES] *
sizeof(revreal));
if (rp_T == NULL) fail(ADOLC_MALLOC_FAILED);
+ ADOLC_CURRENT_TAPE_INFOS.workMode = ADOLC_FOV_REVERSE;
#if !defined(ADOLC_USE_CALLOC)
c_Ptr = (char *) ADOLC_GLOBAL_TAPE_VARS.dpp_A;
*c_Ptr = 0;
@@ -514,7 +516,7 @@
if (taycheck < 0) {
fprintf(DIAG_OUT,"\n ADOL-C error: reverse fails because it was not"
" preceded\nby a forward sweep with degree>0, keep=1!\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
};
if((numdep != depen)||(numind != indep))
@@ -1112,6 +1114,7 @@
}
#if !defined(_NTIGHT_)
+ if (arg != res)
ADOLC_GET_TAYLOR(res);
#endif /* !_NTIGHT_ */
break;
@@ -1803,7 +1806,7 @@
ADOLC_GET_TAYLOR(res);
#else
fprintf(DIAG_OUT, "ADOL-C error: active subscripting does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* !_NTIGHT_ */
}
break;
@@ -1834,12 +1837,12 @@
*/
if (arg1 != vectorloc+idx) {
fprintf(DIAG_OUT, "ADOL-C error: indexed active position does not match referenced position\nindexed = %zu, referenced = %d\n", vectorloc+idx, arg1);
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
}
ADOLC_GET_TAYLOR(res);
#else
fprintf(DIAG_OUT, "ADOL-C error: active subscripting does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* !_NTIGHT_ */
}
break;
@@ -1865,7 +1868,7 @@
ADOLC_GET_TAYLOR(res);
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif
break;
@@ -1879,7 +1882,7 @@
ADOLC_GET_TAYLOR(res);
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* !_NTIGHT_ */
break;
@@ -1902,7 +1905,7 @@
ADOLC_GET_TAYLOR(res);
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* !_NTIGHT_ */
break;
@@ -1924,7 +1927,7 @@
ADOLC_GET_TAYLOR(res);
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* !_NTIGHT_ */
break;
@@ -1953,7 +1956,7 @@
ADOLC_GET_TAYLOR(res);
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* !_NTIGHT_ */
break;
@@ -1972,7 +1975,7 @@
ADOLC_GET_TAYLOR(res);
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* !_NTIGHT_ */
indexi--;
break;
@@ -1987,7 +1990,7 @@
ADOLC_GET_TAYLOR(res);
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* !_NTIGHT_ */
break;
@@ -2012,7 +2015,7 @@
ADOLC_GET_TAYLOR(res);
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* !_NTIGHT_ */
break;
@@ -2026,7 +2029,7 @@
ADOLC_GET_TAYLOR(res);
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* !_NTIGHT_ */
break;
@@ -2050,7 +2053,7 @@
ADOLC_GET_TAYLOR(res);
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* !_NTIGHT_ */
break;
@@ -2071,7 +2074,7 @@
ADOLC_GET_TAYLOR(res);
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* !_NTIGHT_ */
break;
@@ -2099,7 +2102,7 @@
#endif
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* !_NTIGHT_ */
break;
@@ -2158,7 +2161,7 @@
}
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* !_NTIGHT_ */
}
break;
@@ -2199,7 +2202,7 @@
MINDEC(ret_c,0);
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* !_NTIGHT_ */
break;
@@ -2563,7 +2566,7 @@
fprintf(DIAG_OUT,"ADOL-C fatal error in " GENERATED_FILENAME " ("
__FILE__
") : no such operation %d\n", operation);
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
break;
} /* endswitch */
@@ -2585,6 +2588,7 @@
free(upp_A);
#endif
+ ADOLC_CURRENT_TAPE_INFOS.workMode = ADOLC_NO_MODE;
end_sweep();
return ret_c;
Index: ADOL-C/src/taping.c
===================================================================
--- ADOL-C/src/taping.c (revision 491)
+++ ADOL-C/src/taping.c (revision 517)
@@ -284,13 +284,19 @@
"ADOL-C error: Trace was created on a 32-bit platform, cannot be opened on 64-bit platform!\n"
);
break;
+ case ADOLC_TAPING_NOT_ACTUALLY_TAPING:
+ fprintf(DIAG_OUT,
+ "ADOL-C error: Trace %d is not being currently created!\n",
+ failAdditionalInfo1);
+ break;
default:
fprintf(DIAG_OUT, "ADOL-C error => unknown error type!\n");
- exit (-1);
+ adolc_exit(-1, "", __func__, __FILE__, __LINE__);
break;
}
- exit (error + 1);
+ adolc_exit(error+1, "", __func__, __FILE__, __LINE__);
+ // exit (error + 1);
}
/* print an error message describing the error number */
@@ -426,6 +432,13 @@
/****************************************************************************/
/* Tries to read a local config file containing, e.g., buffer sizes */
/****************************************************************************/
+static char* duplicatestr(const char* instr) {
+ size_t len = strlen(instr);
+ char *outstr = calloc(len+1,sizeof(char));
+ strncpy(outstr,instr,len);
+ return outstr;
+}
+
#define ADOLC_LINE_LENGTH 100
void readConfigFile() {
FILE *configFile = NULL;
@@ -435,13 +448,13 @@
long int number = 0;
char *path = NULL;
int defdirsize = strlen(TAPE_DIR PATHSEPARATOR);
- tapeBaseNames[0] = strdup(
+ tapeBaseNames[0] = duplicatestr(
TAPE_DIR PATHSEPARATOR ADOLC_LOCATIONS_NAME);
- tapeBaseNames[1] = strdup(
+ tapeBaseNames[1] = duplicatestr(
TAPE_DIR PATHSEPARATOR ADOLC_VALUES_NAME);
- tapeBaseNames[2] = strdup(
+ tapeBaseNames[2] = duplicatestr(
TAPE_DIR PATHSEPARATOR ADOLC_OPERATIONS_NAME);
- tapeBaseNames[3] = strdup(
+ tapeBaseNames[3] = duplicatestr(
TAPE_DIR PATHSEPARATOR ADOLC_TAYLORS_NAME);
ADOLC_OPENMP_THREAD_NUMBER;
@@ -1067,6 +1080,7 @@
ADOLC_CURRENT_TAPE_INFOS.currVal = ADOLC_CURRENT_TAPE_INFOS.valBuffer;
ADOLC_CURRENT_TAPE_INFOS.num_eq_prod = 0;
ADOLC_CURRENT_TAPE_INFOS.numSwitches = 0;
+ ADOLC_CURRENT_TAPE_INFOS.workMode = ADOLC_TAPING;
/* Put operation denoting the start_of_the tape */
put_op(start_of_tape);
Index: ADOL-C/src/ho_rev.c
===================================================================
--- ADOL-C/src/ho_rev.c (revision 491)
+++ ADOL-C/src/ho_rev.c (revision 517)
@@ -487,6 +487,7 @@
rp_Atemp = (revreal *)malloc(k1 * sizeof(revreal));
rp_Atemp2 = (revreal *)malloc(k1 * sizeof(revreal));
rp_Ttemp2 = (revreal *)malloc(k * sizeof(revreal));
+ ADOLC_CURRENT_TAPE_INFOS.workMode = ADOLC_HOS_REVERSE;
/*----------------------------------------------------------------------*/
#elif _HOV_ /* HOV */
rpp_A = (revreal**)malloc(ADOLC_CURRENT_TAPE_INFOS.stats[NUM_MAX_LIVES] *
@@ -512,6 +513,7 @@
rp_Atemp = (revreal*) malloc(pk1 * sizeof(revreal));
rp_Atemp2 = (revreal*) malloc(pk1 * sizeof(revreal));
rp_Ttemp2 = (revreal*) malloc(k * sizeof(revreal));
+ ADOLC_CURRENT_TAPE_INFOS.workMode = ADOLC_HOV_REVERSE;
/*----------------------------------------------------------------------*/
#elif _HOS_OV_ /* HOS_OV */
rpp_A = (revreal**)malloc(ADOLC_CURRENT_TAPE_INFOS.stats[NUM_MAX_LIVES] *
@@ -537,6 +539,7 @@
rp_Atemp = (revreal*) malloc(pk1 * sizeof(revreal));
rp_Atemp2 = (revreal*) malloc(pk1 * sizeof(revreal));
rp_Ttemp2 = (revreal*) malloc(p*k*sizeof(revreal));
+ ADOLC_CURRENT_TAPE_INFOS.workMode = ADOLC_HOV_REVERSE;
#endif
rp_Ttemp = (revreal*) malloc(k*sizeof(revreal));
if (rp_Ttemp == NULL) fail(ADOLC_MALLOC_FAILED);
@@ -555,7 +558,7 @@
fprintf(DIAG_OUT,"\n ADOL-C error: reverse fails because it was not"
" preceded\nby a forward sweep with degree>%i,"
" keep=%i!\n",degre,degre+1);
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
};
if((numdep != depen)||(numind != indep)) {
@@ -563,7 +566,7 @@
"the number of\nindependent and/or dependent variables"
" given to reverse are\ninconsistent with that of the"
" internal taylor array.\n",tnum);
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
}
@@ -1266,6 +1269,7 @@
}
}
+ if (arg != res)
GET_TAYL(res,k,p)
break;
@@ -2118,7 +2122,7 @@
*/
if (arg1 != vectorloc+idx) {
fprintf(DIAG_OUT, "ADOL-C error: indexed active position does not match referenced position\nindexed = %zu, referenced = %d\n", vectorloc+idx, arg1);
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
}
GET_TAYL(res,k,p)
}
@@ -2553,7 +2557,7 @@
fprintf(DIAG_OUT,"ADOL-C fatal error in " GENERATED_FILENAME " ("
__FILE__
") : no such operation %d\n", operation);
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
break;
} /* endswitch */
@@ -2585,6 +2589,7 @@
free((char*) jj);
free((char*) x);
+ ADOLC_CURRENT_TAPE_INFOS.workMode = ADOLC_NO_MODE;
end_sweep();
return ret_c;
Index: ADOL-C/src/advector.cpp
===================================================================
--- ADOL-C/src/advector.cpp (revision 491)
+++ ADOL-C/src/advector.cpp (revision 517)
@@ -30,7 +30,7 @@
if (ref != refloc) {
fprintf(DIAG_OUT,"ADOL-C error: strange construction of an active"
" vector subscript reference\n(passed ref = %d, stored refloc = %d)\n",ref,refloc);
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
}
}
@@ -466,11 +466,11 @@
adouble advector::lookupindex(const badouble& x, const badouble& y) const {
if (!nondecreasing()) {
fprintf(DIAG_OUT, "ADOL-C error: can only call lookup index if advector ist nondecreasing\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
}
if (y.value() < 0) {
fprintf(DIAG_OUT, "ADOL-C error: index lookup needs a nonnegative denominator\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
}
adouble r = 0;
size_t n = data.size();
Index: ADOL-C/src/adouble_tl.cpp
===================================================================
--- ADOL-C/src/adouble_tl.cpp (revision 491)
+++ ADOL-C/src/adouble_tl.cpp (revision 517)
@@ -28,6 +28,8 @@
using std::cout;
+extern "C" void adolc_exit(int errorcode, const char *what, const char* function, const char *file, int line);
+
namespace adtl {
@@ -62,7 +64,7 @@
if (num>adouble::numDir)
{
cout << "ADOL-C error: to many directions in input\n";
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
do in >> c;
while (c!=':' && !in.eof());
@@ -72,6 +74,7 @@
while (c!=')' && !in.eof());
return in;
}
+ return in;
}
/**************** ADOLC_TRACELESS_SPARSE_PATTERN ****************************/
Index: ADOL-C/src/adouble.cpp
===================================================================
--- ADOL-C/src/adouble.cpp (revision 491)
+++ ADOL-C/src/adouble.cpp (revision 517)
@@ -185,7 +185,19 @@
#endif
}
+
/****************************************************************************/
+/* HELPERS */
+
+adub* adubp_from_adub(const adub& a) {
+ locint locat = next_loc();
+ adub *retp = new adub(locat);
+ (*retp).badouble::operator=(a);
+ return retp;
+}
+
+
+/****************************************************************************/
/* VALUE */
/*--------------------------------------------------------------------------*/
@@ -1577,7 +1589,7 @@
ADOLC_OPENMP_GET_THREAD_NUMBER;
locint locat = next_loc();
- adouble y = 1.0 / sqrt(1.0 - x*x);
+ adouble y = 1.0 / sqrt(x*x-1.0);
if (ADOLC_CURRENT_TAPE_INFOS.traceFlag) { // old: write_quad(acosh_op,locat,x.loc(),y.loc());
put_op(acosh_op);
Index: ADOL-C/src/sparse/Makefile.in
===================================================================
--- ADOL-C/src/sparse/Makefile.in (revision 491)
+++ ADOL-C/src/sparse/Makefile.in (revision 517)
@@ -93,7 +93,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -205,6 +206,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/src/sparse/sparsedrivers.cpp
===================================================================
--- ADOL-C/src/sparse/sparsedrivers.cpp (revision 491)
+++ ADOL-C/src/sparse/sparsedrivers.cpp (revision 517)
@@ -73,7 +73,7 @@
if (crs == NULL) {
fprintf(DIAG_OUT,"ADOL-C user error in jac_pat(...) : "
"parameter crs may not be NULL !\n");
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
} else
for (i=0; i<depen; i++)
crs[i] = NULL;
@@ -132,7 +132,7 @@
#else
{
fprintf(DIAG_OUT, "ADOL-C error: function %s can only be used if linked with ColPack\n", __FUNCTION__);
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
#endif
@@ -165,7 +165,7 @@
if (crs == NULL) {
fprintf(DIAG_OUT,"ADOL-C user error in hess_pat(...) : "
"parameter crs may not be NULL !\n");
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
} else
for (i=0; i<indep; i++)
crs[i] = NULL;
@@ -213,7 +213,7 @@
#else
{
fprintf(DIAG_OUT, "ADOL-C error: function %s can only be used if linked with ColPack\n", __FUNCTION__);
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
#endif
@@ -414,7 +414,7 @@
#else
{
fprintf(DIAG_OUT, "ADOL-C error: function %s can only be used if linked with ColPack\n", __FUNCTION__);
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
#endif
@@ -484,7 +484,7 @@
memcpy(&ADOLC_CURRENT_TAPE_INFOS, tapeInfos, sizeof(TapeInfos));
if (indep != ADOLC_CURRENT_TAPE_INFOS.pTapeInfos.sHinfos.indep) {
fprintf(DIAG_OUT,"ADOL-C Error: wrong number of independents stored in hessian pattern.\n");
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
deepcopy_HP(&sHinfos.HP,ADOLC_CURRENT_TAPE_INFOS.pTapeInfos.sHinfos.HP,indep);
}
@@ -642,7 +642,7 @@
#else
{
fprintf(DIAG_OUT, "ADOL-C error: function %s can only be used if linked with ColPack\n", __FUNCTION__);
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
#endif
@@ -681,7 +681,7 @@
#else
{
fprintf(DIAG_OUT, "ADOL-C error: function %s can only be used if sparse configuration option was used\n", __FUNCTION__);
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
#endif
@@ -703,7 +703,7 @@
#else
{
fprintf(DIAG_OUT, "ADOL-C error: function %s can only be used if sparse configuration option was used\n", __FUNCTION__);
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
#endif
@@ -774,7 +774,7 @@
if (( tight_mode ) && ( basepoint == NULL )) {
fprintf(DIAG_OUT, "ADOL-C error in jac_pat(...) : supply basepoint x for tight mode.\n");
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
/* indep partial derivatives for the whole Jacobian */
@@ -800,10 +800,10 @@
if ( ! (indep_blocks_flags = (unsigned char*)
calloc(i_blocks_per_strip, sizeof(char)) ) ) {
- fprintf(DIAG_OUT, "ADOL-C error, "__FILE__
+ fprintf(DIAG_OUT, "ADOL-C error, " __FILE__
":%i : \njac_pat(...) unable to allocate %i bytes !\n",
__LINE__, (int)(i_blocks_per_strip*sizeof(char)));
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
seed = myalloc2_ulong(indep, p_stripmine);
@@ -877,10 +877,10 @@
if ((k > 0 ) || ( strip_idx == 0 )) {
if ( ! (crs[j] = (unsigned int*)realloc(crs[j],
(k_old+k+1)*sizeof(unsigned int))) ) {
- fprintf(DIAG_OUT, "ADOL-C error, "__FILE__
+ fprintf(DIAG_OUT, "ADOL-C error, " __FILE__
":%i : \njac_pat(...) unable to allocate %i bytes !\n",
__LINE__, (int)((k_old+k+1)*sizeof(unsigned int)));
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
if ( strip_idx == 0 )
crs[j][0] = 0;
@@ -929,10 +929,10 @@
/* allocate memory --------------------------------------------------- */
if ( ! (indep_blocks_flags = (unsigned char*)calloc(indep,
sizeof(unsigned char)) ) ) {
- fprintf(DIAG_OUT, "ADOL-C error, "__FILE__
+ fprintf(DIAG_OUT, "ADOL-C error, " __FILE__
":%i : \njac_pat(...) unable to allocate %i bytes !\n",
__LINE__, (int)(indep*sizeof(unsigned char)));
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
seed = myalloc2_ulong(q_stripmine, depen);
@@ -945,7 +945,7 @@
if ( basepoint == NULL ) {
fprintf(DIAG_OUT, "ADOL-C error in jac_pat(..) : ");
fprintf(DIAG_OUT, "no basepoint x for tight mode supplied.\n");
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
rc = zos_forward(tag, depen, indep, 1, basepoint, valuepoint);
@@ -1009,10 +1009,10 @@
k += *i_b_flags++;
if ( ! (crs[d_bl_idx] = (unsigned int*)malloc((k+1)*sizeof(unsigned int))) ) {
- fprintf(DIAG_OUT, "ADOL-C error, "__FILE__
+ fprintf(DIAG_OUT, "ADOL-C error, " __FILE__
":%i : \njac_pat(...) unable to allocate %i bytes !\n",
__LINE__, (int)((k+1)*sizeof(unsigned int)));
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
crs[d_bl_idx][0] = k; /* number of non-zero indep. blocks */
k=1;
@@ -1138,13 +1138,9 @@
//setNumDir(n);
setMode(ADTL_INDO);
{
-#ifdef __GNUC__
- adouble x[n],y[m];
-#else
adouble *x, *y;
x = new adouble[n];
y = new adouble[m];
-#endif
for (i=0; i < n ; i++){
x[i] = basepoints[i];
//x[i].setADValue(i,1);
@@ -1159,10 +1155,8 @@
}
ret_val = ADOLC_get_sparse_pattern(y, m, sJinfos.JP );
-#ifndef __GNUC__
delete[] x;
delete[] y;
-#endif
}
sJinfos.depen = m;
sJinfos.nnz_in = 0;
@@ -1201,13 +1195,10 @@
setNumDir(sJinfos.seed_clms);
setMode(ADTL_FOV);
{
-#ifdef __GNUC__
- adouble x[n],y[m];
-#else
adouble *x, *y;
x = new adouble[n];
y = new adouble[m];
-#endif
+
for (i=0; i < n ; i++){
x[i] = basepoints[i];
for (j=0; j < sJinfos.seed_clms; j++)
@@ -1219,10 +1210,9 @@
for (i=0;i<m;i++)
for (j=0; j< sJinfos.seed_clms;j++)
sJinfos.B[i][j] = y[i].getADValue(j);
-#ifndef __GNUC__
+
delete[] x;
delete[] y;
-#endif
}
/* recover compressed Jacobian => ColPack library */
@@ -1247,7 +1237,7 @@
#else
{
fprintf(DIAG_OUT, "ADOL-C error: function %s can only be used if linked with ColPack\n", __FUNCTION__);
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
#endif
@@ -1319,7 +1309,7 @@
#else
{
fprintf(DIAG_OUT, "ADOL-C error: function %s can only be used if linked with ColPack\n", __FUNCTION__);
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
#endif
#endif
Index: ADOL-C/src/sparse/sparse_fo_rev.cpp
===================================================================
--- ADOL-C/src/sparse/sparse_fo_rev.cpp (revision 491)
+++ ADOL-C/src/sparse/sparse_fo_rev.cpp (revision 517)
@@ -18,6 +18,8 @@
#if defined(__cplusplus)
+extern "C" void adolc_exit(int errorcode, const char *what, const char* function, const char *file, int line);
+
/****************************************************************************/
/* Bit pattern propagation; general call */
/* */
@@ -39,7 +41,7 @@
else {
fprintf(DIAG_OUT,"ADOL-C error: no basepoint for bit"
" pattern forward tight.\n");
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
else
if (mode == 0) // safe version
@@ -47,7 +49,7 @@
else {
fprintf(DIAG_OUT,"ADOL-C error: bad mode parameter to bit"
" pattern forward.\n");
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
return (rc);
}
@@ -68,7 +70,7 @@
if (mode != 0) // not safe
{ fprintf(DIAG_OUT,"ADOL-C error: bad mode parameter to bit"
" pattern forward.\n");
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
return int_forward_safe(tag,m,n,p,X,Y);
}
@@ -99,7 +101,7 @@
else {
fprintf(DIAG_OUT,"ADOL-C error: bad mode parameter"
" to bit pattern reverse.\n");
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
return rc;
}
Index: ADOL-C/src/config.h.in
===================================================================
--- ADOL-C/src/config.h.in (revision 491)
+++ ADOL-C/src/config.h.in (revision 517)
@@ -36,6 +36,9 @@
/* Define if the compiler provides __builtin_expect */
#undef HAVE_BUILTIN_EXPECT
+/* define if the compiler supports basic C++11 syntax */
+#undef HAVE_CXX11
+
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
Index: ADOL-C/src/interfaces.cpp
===================================================================
--- ADOL-C/src/interfaces.cpp (revision 491)
+++ ADOL-C/src/interfaces.cpp (revision 517)
@@ -21,6 +21,7 @@
#define fabs(x) ((x) > 0 ? (x) : -(x))
#define ceil(x) ((int)((x)+1) - (int)((x) == (int)(x)))
+extern "C" void adolc_exit(int errorcode, const char *what, const char* function, const char *file, int line);
/****************************************************************************/
/* FORWARD MODE, overloaded calls */
@@ -162,7 +163,7 @@
Y[0] = y;
} else {
fprintf(DIAG_OUT,"ADOL-C error: wrong Y dimension in forward \n");
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
return rc;
@@ -184,7 +185,7 @@
if (d != 0) {
fprintf(DIAG_OUT,"ADOL-C error: wrong X and Y dimensions in forward \n");
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
} else
rc = zos_forward(tag,m,n,keep,X,Y);
@@ -270,7 +271,7 @@
if (m != 1) {
fprintf(DIAG_OUT,"ADOL-C error: wrong u dimension in scalar-reverse \n");
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
} else
rc = hos_reverse(tag,m,n,d,&u,Z);
@@ -290,7 +291,7 @@
/* reverse(tag, m, n, 0, u[m], Z[n]), d=0 */
{ if (d != 0) {
fprintf(DIAG_OUT,"ADOL-C error: wrong Z dimension in scalar-reverse \n");
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
return fos_reverse(tag,m,n,u,Z);
@@ -311,7 +312,7 @@
if (m != 1 || d != 0 ) {
fprintf(DIAG_OUT,"ADOL-C error: wrong u or Z dimension in scalar-reverse \n");
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
} else
rc = fos_reverse(tag,m,n,&u,Z);
\
@@ -351,7 +352,7 @@
if (m != 1) {
fprintf(DIAG_OUT,"ADOL-C error: wrong U dimension in vector-reverse \n");
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
} else { /* olvo 980727 ??? */
/* double** upp = new double*[nrows]; */
double **upp = (double**) malloc(q*sizeof(double*));
@@ -381,7 +382,7 @@
if (d != 0) {
fprintf(DIAG_OUT,"ADOL-C error: wrong degree in vector-reverse \n");
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
} else
rc = fov_reverse(tag,m,n,q,U,Z);
@@ -428,7 +429,7 @@
if ((m != 1) || (d != 0)) {
fprintf(DIAG_OUT,"ADOL-C error: wrong U dimension in vector-reverse \n");
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
} else { /* olvo 980727 ??? */
/* double ** upp = new double*[nrows]; */
double **upp = (double**) malloc(q*sizeof(double*));
Index: ADOL-C/src/uni5_for.c
===================================================================
--- ADOL-C/src/uni5_for.c (revision 491)
+++ ADOL-C/src/uni5_for.c (revision 517)
@@ -1063,14 +1063,14 @@
depcheck, indcheck,
ADOLC_CURRENT_TAPE_INFOS.stats[NUM_DEPENDENTS],
ADOLC_CURRENT_TAPE_INFOS.stats[NUM_INDEPENDENTS]);
- exit (-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
#if defined(_ABS_NORM_)
if (! ADOLC_CURRENT_TAPE_INFOS.stats[NO_MIN_MAX] ) {
fprintf(DIAG_OUT,"ADOL-C error: tape %d was not created compatible "
"with %s\n Please call enableMinMaxUsingAbs() "
"before trace_on(%d)\n", tnum, __FUNCTION__, tnum);
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
#endif
/****************************************************************************/
@@ -1101,7 +1101,7 @@
if (keep>1) {
fprintf(DIAG_OUT,"\n ADOL-C error: zero order scalar forward cannot save"
" more\nthan zero order taylor coefficients!\n");
- exit (-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
#endif
#if defined(_KEEP_)
@@ -1119,7 +1119,7 @@
if (keep>2) {
fprintf(DIAG_OUT,"\n ADOL-C error: first order scalar forward cannot save"
" more \nthan first order taylor coefficients!\n");
- exit (-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
#endif
dp_T = myalloc1(ADOLC_CURRENT_TAPE_INFOS.stats[NUM_MAX_LIVES]);
@@ -2318,10 +2318,11 @@
IF_KEEP_WRITE_TAYLOR(res,keep,k,p)
- /* olvo 980922 necessary for reverse */
+ /* olvo 980922 necessary for reverse
+ kk 20140508 I don't think so
if (arg == res) {
IF_KEEP_WRITE_TAYLOR(arg,keep,k,p)
- }
+ } */
#if !defined(_NTIGHT_)
#if !defined(_ZOS_) && !defined(_INT_FOR_) && !defined(_INDO_)
@@ -4223,6 +4224,7 @@
"ADOL-C Warning: Branch switch detected in comparison "
"(operator %s).\n"
"Results may be unpredictable! Retaping recommended!\n",opname);
+ IF_KEEP_WRITE_TAYLOR(res,keep,k,p);
dp_T0[res] = retval;
}
#endif
@@ -4288,7 +4290,7 @@
#endif
#else
fprintf(DIAG_OUT, "ADOL-C error: active subscripting does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* ALL_TOGETHER_AGAIN */
}
break;
@@ -4316,7 +4318,7 @@
dp_T0[res] = arg1;
#else
fprintf(DIAG_OUT, "ADOL-C error: active subscripting does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif
}
break;
@@ -4346,7 +4348,7 @@
#endif
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* ALL_TOGETHER_AGAIN */
break;
@@ -4358,7 +4360,7 @@
dp_T0[arg1]++;
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif
break;
@@ -4370,7 +4372,7 @@
dp_T0[arg1]--;
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif
break;
@@ -4405,7 +4407,7 @@
#endif
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif
break;
@@ -4436,7 +4438,7 @@
#endif
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif
break;
@@ -4467,7 +4469,7 @@
#endif
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif
break;
@@ -4498,7 +4500,7 @@
#endif
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* ALL_TOGETHER_AGAIN */
break;
@@ -4538,7 +4540,7 @@
#endif
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* ALL_TOGETHER_AGAIN */
++indexi;
break;
@@ -4558,7 +4560,7 @@
dp_T0[res] += coval;
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* !_NTIGHT_ */
break;
@@ -4598,7 +4600,7 @@
#endif
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* ALL_TOGETHER_AGAIN */
break;
@@ -4616,7 +4618,7 @@
dp_T0[res] -= coval;
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* !_NTIGHT_ */
break;
@@ -4656,7 +4658,7 @@
#endif
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* ALL_TOGETHER_AGAIN */
break;
@@ -4686,7 +4688,7 @@
#endif
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* ALL_TOGETHER_AGAIN */
break;
@@ -4745,7 +4747,7 @@
dp_T0[res] *= dp_T0[arg];
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* !_NTIGHT_ */
break;
@@ -4849,7 +4851,7 @@
#endif
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* ALL_TOGETHER_AGAIN */
}
break;
@@ -4914,7 +4916,7 @@
#endif
#else
fprintf(DIAG_OUT, "ADOL-C error: active vector element referencing does not work in safe mode, please use tight mode\n");
- exit(-2);
+ adolc_exit(-2,"",__func__,__FILE__,__LINE__);
#endif /* ALL_TOGETHER_AGAIN */
break;
@@ -5283,7 +5285,7 @@
fprintf(DIAG_OUT,"ADOL-C fatal error in " GENERATED_FILENAME " ("
__FILE__
") : no such operation %d\n", operation);
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
break;
} /* endswitch */
@@ -5328,6 +5330,7 @@
free(dp_z);
#endif
+ ADOLC_CURRENT_TAPE_INFOS.workMode = ADOLC_NO_MODE;
end_sweep();
@@ -5390,7 +5393,7 @@
fprintf(DIAG_OUT,"ADOL-C error: tape %d was not created compatible "
"with %s\n Please call enableMinMaxUsingAbs() "
"before trace_on(%d)\n", tapeID, __FUNCTION__, tapeID);
- exit(-1);
+ adolc_exit(-1,"",__func__,__FILE__,__LINE__);
}
nswitch = ADOLC_CURRENT_TAPE_INFOS.stats[NUM_SWITCHES];
end_sweep();
Index: ADOL-C/src/drivers/Makefile.in
===================================================================
--- ADOL-C/src/drivers/Makefile.in (revision 491)
+++ ADOL-C/src/drivers/Makefile.in (revision 517)
@@ -93,7 +93,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -206,6 +207,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/src/tape_handling.cpp
===================================================================
--- ADOL-C/src/tape_handling.cpp (revision 491)
+++ ADOL-C/src/tape_handling.cpp (revision 517)
@@ -26,6 +26,7 @@
#include <vector>
#include <stack>
#include <errno.h>
+#include <exception>
using namespace std;
@@ -153,7 +154,7 @@
fprintf(DIAG_OUT,"\nADOL-C error:\n");
fprintf(DIAG_OUT,"maximal number (%d) of live active variables exceeded\n\n",
std::numeric_limits<locint>::max());
- exit(-3);
+ adolc_exit(-3,"",__func__,__FILE__,__LINE__);
}
#ifdef ADOLC_DEBUG
@@ -355,8 +356,6 @@
newTapeInfos->pTapeInfos.sHinfos.hr,
newTapeInfos->pTapeInfos.sHinfos.p,
newTapeInfos->pTapeInfos.sHinfos.indep);
- newTapeInfos->pTapeInfos.inJacSparseUse=0;
- newTapeInfos->pTapeInfos.inHessSparseUse=0;
newTapeInfos->pTapeInfos.sJinfos.B=NULL;
newTapeInfos->pTapeInfos.sJinfos.y=NULL;
newTapeInfos->pTapeInfos.sJinfos.g=NULL;
@@ -391,31 +390,6 @@
}
newTapeInfos->traceFlag=1;
newTapeInfos->inUse=1;
-#ifdef SPARSE
- newTapeInfos->pTapeInfos.inJacSparseUse=0;
- newTapeInfos->pTapeInfos.inHessSparseUse=0;
- newTapeInfos->pTapeInfos.sJinfos.B=NULL;
- newTapeInfos->pTapeInfos.sJinfos.y=NULL;
- newTapeInfos->pTapeInfos.sJinfos.g=NULL;
- newTapeInfos->pTapeInfos.sJinfos.jr1d=NULL;
- newTapeInfos->pTapeInfos.sJinfos.Seed=NULL;
- newTapeInfos->pTapeInfos.sJinfos.JP=NULL;
- newTapeInfos->pTapeInfos.sJinfos.depen=0;
- newTapeInfos->pTapeInfos.sJinfos.nnz_in=0;
- newTapeInfos->pTapeInfos.sJinfos.seed_rows=0;
- newTapeInfos->pTapeInfos.sJinfos.seed_clms=0;
- newTapeInfos->pTapeInfos.sHinfos.Zppp=NULL;
- newTapeInfos->pTapeInfos.sHinfos.Yppp=NULL;
- newTapeInfos->pTapeInfos.sHinfos.Xppp=NULL;
- newTapeInfos->pTapeInfos.sHinfos.Upp=NULL;
- newTapeInfos->pTapeInfos.sHinfos.Hcomp=NULL;
- newTapeInfos->pTapeInfos.sHinfos.HP=NULL;
- newTapeInfos->pTapeInfos.sHinfos.g=NULL;
- newTapeInfos->pTapeInfos.sHinfos.hr=NULL;
- newTapeInfos->pTapeInfos.sHinfos.nnz_in=0;
- newTapeInfos->pTapeInfos.sHinfos.indep=0;
- newTapeInfos->pTapeInfos.sHinfos.p=0;
-#endif
newTapeInfos->stats[OP_BUFFER_SIZE] =
ADOLC_GLOBAL_TAPE_VARS.operationBufferSize;
@@ -571,10 +545,6 @@
ADOLC_TAPE_INFOS_BUFFER.push_back(tapeInfos);
tapeInfos->traceFlag=1;
tapeInfos->inUse=0;
-#ifdef SPARSE
- tapeInfos->pTapeInfos.inJacSparseUse=0;
- tapeInfos->pTapeInfos.inHessSparseUse=0;
-#endif
tapeInfos->tapingComplete = 1;
read_tape_stats(tapeInfos);
return tapeInfos;
@@ -754,7 +724,7 @@
if ((*tiIter)->signature != NULL)
{
free((*tiIter)->signature);
- ((*tiIter)->signature == NULL);
+ (*tiIter)->signature = NULL;
}
if ((*tiIter)->tayBuffer != NULL)
{
@@ -965,11 +935,16 @@
void trace_off(int flag) {
ADOLC_OPENMP_THREAD_NUMBER;
ADOLC_OPENMP_GET_THREAD_NUMBER;
+ if (ADOLC_CURRENT_TAPE_INFOS.workMode != ADOLC_TAPING) {
+ failAdditionalInfo1 = ADOLC_CURRENT_TAPE_INFOS.tapeID;
+ fail(ADOLC_TAPING_NOT_ACTUALLY_TAPING);
+ }
ADOLC_CURRENT_TAPE_INFOS.pTapeInfos.keepTape = flag;
keep_stock(); /* copy remaining live variables + trace_flag = 0 */
stop_trace(flag);
cout.flush();
ADOLC_CURRENT_TAPE_INFOS.tapingComplete = 1;
+ ADOLC_CURRENT_TAPE_INFOS.workMode = ADOLC_NO_MODE;
releaseTape();
}
@@ -1019,7 +994,7 @@
/****************************************************************************/
/****************************************************************************/
#if defined(_OPENMP)
-#include "adolc_openmp.h"
+#include <adolc/adolc_openmp.h>
ADOLC_OpenMP ADOLC_OpenMP_Handler;
ADOLC_OpenMP_NC ADOLC_OpenMP_Handler_NC;
@@ -1181,12 +1156,21 @@
#endif /* _OPENMP */
+static void clearPersistantTapeInfos(TapeInfos* newTapeInfos) {
+ char *ptr;
+ ptr = (char*) &(newTapeInfos->pTapeInfos);
+ for (unsigned int i=0; i < sizeof(PersistantTapeInfos); ++i)
+ ptr[i] = 0;
+}
+
TapeInfos::TapeInfos() {
initTapeInfos(this);
+ clearPersistantTapeInfos(this);
}
TapeInfos::TapeInfos(short _tapeID) {
initTapeInfos(this);
+ clearPersistantTapeInfos(this);
tapeID = _tapeID;
pTapeInfos.op_fileName = createFileName(tapeID, OPERATIONS_TAPE);
pTapeInfos.loc_fileName = createFileName(tapeID, LOCATIONS_TAPE);
@@ -1281,7 +1265,7 @@
#endif
if (maxSize()-size()>n) {
if (indexFree.front().size>=n) found = true;
- if ((!found) && (double(maxSize())/double(size()))>gcTriggerRatio() || maxSize()>gcTriggerMaxSize()) {
+ if ((!found) && ((double(maxSize())/double(size()))>gcTriggerRatio() || maxSize()>gcTriggerMaxSize())) {
consolidateBlocks();
#ifdef ADOLC_LOCDEBUG
std::cerr << "ADOLC: GC called consolidateBlocks because " << maxSize() << "/" << size() << ">" << gcTriggerRatio() << " or " << maxSize() << ">" << gcTriggerMaxSize() << " after " << ensure_blockCallsSinceLastConsolidateBlocks << std::endl;
@@ -1338,7 +1322,7 @@
fprintf(DIAG_OUT,"\nADOL-C error:\n");
fprintf(DIAG_OUT,"maximal number (%u) of live active variables exceeded\n\n",
std::numeric_limits<locint>::max());
- exit(-3);
+ adolc_exit(-3,"",__func__,__FILE__,__LINE__);
}
#ifdef ADOLC_LOCDEBUG
@@ -1495,3 +1479,23 @@
"call %s after trace_off() for the correct behaviour\n"
,__FUNCTION__);
}
+
+class FatalError: public exception{
+protected:
+ static const int MAX_MSG_SIZE = 4*1024;
+ char msg[MAX_MSG_SIZE];
+
+public:
+ explicit FatalError(int errorcode, const char* what, const char* function, const char* file, int line) {
+ // need to use C-style functions that do not use exceptions themselves
+ snprintf(this->msg, MAX_MSG_SIZE, "errorcode=%d function=%s file=%s line=%d what=%s", errorcode, function, file, line, what);
+ }
+
+ virtual const char* what() const throw() {
+ return msg;
+ }
+};
+
+void adolc_exit(int errorcode, const char *what, const char* function, const char *file, int line) {
+ throw FatalError(errorcode, what, function, file, line);
+}
Index: ADOL-C/Makefile.am
===================================================================
--- ADOL-C/Makefile.am (revision 491)
+++ ADOL-C/Makefile.am (revision 517)
@@ -38,7 +38,10 @@
if BUILD_ADOLC_AMPI_SUPPORT
lib@adolclib@_la_LIBADD += src/libadolcampi.la
+if DARWIN
+lib@adolclib@_la_LDFLAGS += -Wl,-undefined,dynamic_lookup
endif
+endif
lib@adolclib@_la_LIBADD += src/drivers/libdrivers.la src/tapedoc/libtapedoc.la
Index: ADOL-C/examples/Makefile.in
===================================================================
--- ADOL-C/examples/Makefile.in (revision 491)
+++ ADOL-C/examples/Makefile.in (revision 517)
@@ -96,7 +96,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -279,6 +280,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/scal/Makefile.in
===================================================================
--- ADOL-C/examples/additional_examples/scal/Makefile.in (revision 491)
+++ ADOL-C/examples/additional_examples/scal/Makefile.in (revision 517)
@@ -94,7 +94,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -207,6 +208,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/scal/scalexam.cpp
===================================================================
--- ADOL-C/examples/additional_examples/scal/scalexam.cpp (revision 491)
+++ ADOL-C/examples/additional_examples/scal/scalexam.cpp (revision 517)
@@ -142,14 +142,14 @@
size_t tape_stats[STAT_SIZE];
tapestats(tag,tape_stats);
- fprintf(stdout,"\n independents %d\n",tape_stats[NUM_INDEPENDENTS]);
- fprintf(stdout," dependents %d\n",tape_stats[NUM_DEPENDENTS]);
- fprintf(stdout," operations %d\n",tape_stats[NUM_OPERATIONS]);
- fprintf(stdout," operations buffer size %d\n",tape_stats[OP_BUFFER_SIZE]);
- fprintf(stdout," locations buffer size %d\n",tape_stats[LOC_BUFFER_SIZE]);
- fprintf(stdout," constants buffer size %d\n",tape_stats[VAL_BUFFER_SIZE]);
- fprintf(stdout," maxlive %d\n",tape_stats[NUM_MAX_LIVES]);
- fprintf(stdout," valstack size %d\n\n",tape_stats[TAY_STACK_SIZE]);
+ fprintf(stdout,"\n independents %zu\n",tape_stats[NUM_INDEPENDENTS]);
+ fprintf(stdout," dependents %zu\n",tape_stats[NUM_DEPENDENTS]);
+ fprintf(stdout," operations %zu\n",tape_stats[NUM_OPERATIONS]);
+ fprintf(stdout," operations buffer size %zu\n",tape_stats[OP_BUFFER_SIZE]);
+ fprintf(stdout," locations buffer size %zu\n",tape_stats[LOC_BUFFER_SIZE]);
+ fprintf(stdout," constants buffer size %zu\n",tape_stats[VAL_BUFFER_SIZE]);
+ fprintf(stdout," maxlive %zu\n",tape_stats[NUM_MAX_LIVES]);
+ fprintf(stdout," valstack size %zu\n\n",tape_stats[TAY_STACK_SIZE]);
/*--------------------------------------------------------------------------*/
double *res;
Index: ADOL-C/examples/additional_examples/Makefile.in
===================================================================
--- ADOL-C/examples/additional_examples/Makefile.in (revision 491)
+++ ADOL-C/examples/additional_examples/Makefile.in (revision 517)
@@ -91,7 +91,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -217,6 +218,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/checkpointing/Makefile.in
===================================================================
--- ADOL-C/examples/additional_examples/checkpointing/Makefile.in (revision 491)
+++ ADOL-C/examples/additional_examples/checkpointing/Makefile.in (revision 517)
@@ -94,7 +94,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -207,6 +208,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/helm/Makefile.in
===================================================================
--- ADOL-C/examples/additional_examples/helm/Makefile.in (revision 491)
+++ ADOL-C/examples/additional_examples/helm/Makefile.in (revision 517)
@@ -94,7 +94,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -211,6 +212,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/timing/sgenmain.cpp
===================================================================
--- ADOL-C/examples/additional_examples/timing/sgenmain.cpp (revision 491)
+++ ADOL-C/examples/additional_examples/timing/sgenmain.cpp (revision 517)
@@ -270,14 +270,14 @@
size_t tape_stats[STAT_SIZE];
tapestats(tag,tape_stats);
- fprintf(stdout,"\n independents %d\n",tape_stats[NUM_INDEPENDENTS]);
- fprintf(stdout," dependents %d\n",tape_stats[NUM_DEPENDENTS]);
- fprintf(stdout," operations %d\n",tape_stats[NUM_OPERATIONS]);
- fprintf(stdout," operations buffer size %d\n",tape_stats[OP_BUFFER_SIZE]);
- fprintf(stdout," locations buffer size %d\n",tape_stats[LOC_BUFFER_SIZE]);
- fprintf(stdout," constants buffer size %d\n",tape_stats[VAL_BUFFER_SIZE]);
- fprintf(stdout," maxlive %d\n",tape_stats[NUM_MAX_LIVES]);
- fprintf(stdout," valstack size %d\n\n",tape_stats[TAY_STACK_SIZE]);
+ fprintf(stdout,"\n independents %zu\n",tape_stats[NUM_INDEPENDENTS]);
+ fprintf(stdout," dependents %zu\n",tape_stats[NUM_DEPENDENTS]);
+ fprintf(stdout," operations %zu\n",tape_stats[NUM_OPERATIONS]);
+ fprintf(stdout," operations buffer size %zu\n",tape_stats[OP_BUFFER_SIZE]);
+ fprintf(stdout," locations buffer size %zu\n",tape_stats[LOC_BUFFER_SIZE]);
+ fprintf(stdout," constants buffer size %zu\n",tape_stats[VAL_BUFFER_SIZE]);
+ fprintf(stdout," maxlive %zu\n",tape_stats[NUM_MAX_LIVES]);
+ fprintf(stdout," valstack size %zu\n\n",tape_stats[TAY_STACK_SIZE]);
fprintf(stdout," ");
fprintf(stdout,TIMEFORMAT,(t01-t00)*timeUnit*evalCount,
Index: ADOL-C/examples/additional_examples/timing/Makefile.in
===================================================================
--- ADOL-C/examples/additional_examples/timing/Makefile.in (revision 491)
+++ ADOL-C/examples/additional_examples/timing/Makefile.in (revision 517)
@@ -101,7 +101,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -297,6 +298,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/timing/vgenmain.cpp
===================================================================
--- ADOL-C/examples/additional_examples/timing/vgenmain.cpp (revision 491)
+++ ADOL-C/examples/additional_examples/timing/vgenmain.cpp (revision 517)
@@ -267,14 +267,14 @@
size_t tape_stats[STAT_SIZE];
tapestats(tag,tape_stats);
- fprintf(stdout,"\n independents %d\n",tape_stats[NUM_INDEPENDENTS]);
- fprintf(stdout," dependents %d\n",tape_stats[NUM_DEPENDENTS]);
- fprintf(stdout," operations %d\n",tape_stats[NUM_OPERATIONS]);
- fprintf(stdout," operations buffer size %d\n",tape_stats[OP_BUFFER_SIZE]);
- fprintf(stdout," locations buffer size %d\n",tape_stats[LOC_BUFFER_SIZE]);
- fprintf(stdout," constants buffer size %d\n",tape_stats[VAL_BUFFER_SIZE]);
- fprintf(stdout," maxlive %d\n",tape_stats[NUM_MAX_LIVES]);
- fprintf(stdout," valstack size %d\n\n",tape_stats[TAY_STACK_SIZE]);
+ fprintf(stdout,"\n independents %zu\n",tape_stats[NUM_INDEPENDENTS]);
+ fprintf(stdout," dependents %zu\n",tape_stats[NUM_DEPENDENTS]);
+ fprintf(stdout," operations %zu\n",tape_stats[NUM_OPERATIONS]);
+ fprintf(stdout," operations buffer size %zu\n",tape_stats[OP_BUFFER_SIZE]);
+ fprintf(stdout," locations buffer size %zu\n",tape_stats[LOC_BUFFER_SIZE]);
+ fprintf(stdout," constants buffer size %zu\n",tape_stats[VAL_BUFFER_SIZE]);
+ fprintf(stdout," maxlive %zu\n",tape_stats[NUM_MAX_LIVES]);
+ fprintf(stdout," valstack size %zu\n\n",tape_stats[TAY_STACK_SIZE]);
fprintf(stdout," ");
fprintf(stdout,TIMEFORMAT,(t01-t00)*timeUnit*evalCount,
Index: ADOL-C/examples/additional_examples/speelpenning/Makefile.in
===================================================================
--- ADOL-C/examples/additional_examples/speelpenning/Makefile.in (revision 491)
+++ ADOL-C/examples/additional_examples/speelpenning/Makefile.in (revision 517)
@@ -94,7 +94,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -207,6 +208,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/speelpenning/speelpenning.cpp
===================================================================
--- ADOL-C/examples/additional_examples/speelpenning/speelpenning.cpp (revision 491)
+++ ADOL-C/examples/additional_examples/speelpenning/speelpenning.cpp (revision 517)
@@ -80,14 +80,14 @@
/*--------------------------------------------------------------------------*/
tapestats(TAG,tape_stats);
- fprintf(stdout,"\n independents %d\n",tape_stats[NUM_INDEPENDENTS]);
- fprintf(stdout," dependents %d\n",tape_stats[NUM_DEPENDENTS]);
- fprintf(stdout," operations %d\n",tape_stats[NUM_OPERATIONS]);
- fprintf(stdout," operations buffer size %d\n",tape_stats[OP_BUFFER_SIZE]);
- fprintf(stdout," locations buffer size %d\n",tape_stats[LOC_BUFFER_SIZE]);
- fprintf(stdout," constants buffer size %d\n",tape_stats[VAL_BUFFER_SIZE]);
- fprintf(stdout," maxlive %d\n",tape_stats[NUM_MAX_LIVES]);
- fprintf(stdout," valstack size %d\n\n",tape_stats[TAY_STACK_SIZE]);
+ fprintf(stdout,"\n independents %zu\n",tape_stats[NUM_INDEPENDENTS]);
+ fprintf(stdout," dependents %zu\n",tape_stats[NUM_DEPENDENTS]);
+ fprintf(stdout," operations %zu\n",tape_stats[NUM_OPERATIONS]);
+ fprintf(stdout," operations buffer size %zu\n",tape_stats[OP_BUFFER_SIZE]);
+ fprintf(stdout," locations buffer size %zu\n",tape_stats[LOC_BUFFER_SIZE]);
+ fprintf(stdout," constants buffer size %zu\n",tape_stats[VAL_BUFFER_SIZE]);
+ fprintf(stdout," maxlive %zu\n",tape_stats[NUM_MAX_LIVES]);
+ fprintf(stdout," valstack size %zu\n\n",tape_stats[TAY_STACK_SIZE]);
/*--------------------------------------------------------------------------*/
double **r = new double*[1];
Index: ADOL-C/examples/additional_examples/detexam/Makefile.in
===================================================================
--- ADOL-C/examples/additional_examples/detexam/Makefile.in (revision 491)
+++ ADOL-C/examples/additional_examples/detexam/Makefile.in (revision 517)
@@ -94,7 +94,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -211,6 +212,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/detexam/detexam-old.cpp
===================================================================
--- ADOL-C/examples/additional_examples/detexam/detexam-old.cpp (revision 491)
+++ ADOL-C/examples/additional_examples/detexam/detexam-old.cpp (revision 517)
@@ -133,14 +133,14 @@
size_t tape_stats[STAT_SIZE];
tapestats(tag,tape_stats);
- fprintf(stdout,"\n independents %d\n",tape_stats[NUM_INDEPENDENTS]);
- fprintf(stdout," dependents %d\n",tape_stats[NUM_DEPENDENTS]);
- fprintf(stdout," operations %d\n",tape_stats[NUM_OPERATIONS]);
- fprintf(stdout," operations buffer size %d\n",tape_stats[OP_BUFFER_SIZE]);
- fprintf(stdout," locations buffer size %d\n",tape_stats[LOC_BUFFER_SIZE]);
- fprintf(stdout," constants buffer size %d\n",tape_stats[VAL_BUFFER_SIZE]);
- fprintf(stdout," maxlive %d\n",tape_stats[NUM_MAX_LIVES]);
- fprintf(stdout," valstack size %d\n\n",tape_stats[TAY_STACK_SIZE]);
+ fprintf(stdout,"\n independents %zu\n",tape_stats[NUM_INDEPENDENTS]);
+ fprintf(stdout," dependents %zu\n",tape_stats[NUM_DEPENDENTS]);
+ fprintf(stdout," operations %zu\n",tape_stats[NUM_OPERATIONS]);
+ fprintf(stdout," operations buffer size %zu\n",tape_stats[OP_BUFFER_SIZE]);
+ fprintf(stdout," locations buffer size %zu\n",tape_stats[LOC_BUFFER_SIZE]);
+ fprintf(stdout," constants buffer size %zu\n",tape_stats[VAL_BUFFER_SIZE]);
+ fprintf(stdout," maxlive %zu\n",tape_stats[NUM_MAX_LIVES]);
+ fprintf(stdout," valstack size %zu\n\n",tape_stats[TAY_STACK_SIZE]);
/*--------------------------------------------------------------------------*/
int itu = 8-n;
Index: ADOL-C/examples/additional_examples/detexam/detexam.cpp
===================================================================
--- ADOL-C/examples/additional_examples/detexam/detexam.cpp (revision 491)
+++ ADOL-C/examples/additional_examples/detexam/detexam.cpp (revision 517)
@@ -151,14 +151,14 @@
size_t tape_stats[STAT_SIZE];
tapestats(tag,tape_stats);
- fprintf(stdout,"\n independents %d\n",tape_stats[NUM_INDEPENDENTS]);
- fprintf(stdout," dependents %d\n",tape_stats[NUM_DEPENDENTS]);
- fprintf(stdout," operations %d\n",tape_stats[NUM_OPERATIONS]);
- fprintf(stdout," operations buffer size %d\n",tape_stats[OP_BUFFER_SIZE]);
- fprintf(stdout," locations buffer size %d\n",tape_stats[LOC_BUFFER_SIZE]);
- fprintf(stdout," constants buffer size %d\n",tape_stats[VAL_BUFFER_SIZE]);
- fprintf(stdout," maxlive %d\n",tape_stats[NUM_MAX_LIVES]);
- fprintf(stdout," valstack size %d\n\n",tape_stats[TAY_STACK_SIZE]);
+ fprintf(stdout,"\n independents %zu\n",tape_stats[NUM_INDEPENDENTS]);
+ fprintf(stdout," dependents %zu\n",tape_stats[NUM_DEPENDENTS]);
+ fprintf(stdout," operations %zu\n",tape_stats[NUM_OPERATIONS]);
+ fprintf(stdout," operations buffer size %zu\n",tape_stats[OP_BUFFER_SIZE]);
+ fprintf(stdout," locations buffer size %zu\n",tape_stats[LOC_BUFFER_SIZE]);
+ fprintf(stdout," constants buffer size %zu\n",tape_stats[VAL_BUFFER_SIZE]);
+ fprintf(stdout," maxlive %zu\n",tape_stats[NUM_MAX_LIVES]);
+ fprintf(stdout," valstack size %zu\n\n",tape_stats[TAY_STACK_SIZE]);
/*--------------------------------------------------------------------------*/
int itu = 8-n;
Index: ADOL-C/examples/additional_examples/clock/Makefile.in
===================================================================
--- ADOL-C/examples/additional_examples/clock/Makefile.in (revision 491)
+++ ADOL-C/examples/additional_examples/clock/Makefile.in (revision 517)
@@ -91,7 +91,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -155,6 +156,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/sparse/Makefile.in
===================================================================
--- ADOL-C/examples/additional_examples/sparse/Makefile.in (revision 491)
+++ ADOL-C/examples/additional_examples/sparse/Makefile.in (revision 517)
@@ -96,7 +96,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -225,6 +226,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/ext_diff_func/Makefile.in
===================================================================
--- ADOL-C/examples/additional_examples/ext_diff_func/Makefile.in (revision 491)
+++ ADOL-C/examples/additional_examples/ext_diff_func/Makefile.in (revision 517)
@@ -94,7 +94,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -207,6 +208,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/hessmat/Makefile.in
===================================================================
--- ADOL-C/examples/additional_examples/hessmat/Makefile.in (revision 491)
+++ ADOL-C/examples/additional_examples/hessmat/Makefile.in (revision 517)
@@ -94,7 +94,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -207,6 +208,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/pow/Makefile.in
===================================================================
--- ADOL-C/examples/additional_examples/pow/Makefile.in (revision 491)
+++ ADOL-C/examples/additional_examples/pow/Makefile.in (revision 517)
@@ -94,7 +94,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -207,6 +208,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/ode/Makefile.in
===================================================================
--- ADOL-C/examples/additional_examples/ode/Makefile.in (revision 491)
+++ ADOL-C/examples/additional_examples/ode/Makefile.in (revision 517)
@@ -95,7 +95,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -219,6 +220,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/ode/vgenodemain.cpp
===================================================================
--- ADOL-C/examples/additional_examples/ode/vgenodemain.cpp (revision 491)
+++ ADOL-C/examples/additional_examples/ode/vgenodemain.cpp (revision 517)
@@ -157,14 +157,14 @@
size_t tape_stats[STAT_SIZE];
tapestats(tag,tape_stats);
- fprintf(stdout,"\n independents %d\n",tape_stats[NUM_INDEPENDENTS]);
- fprintf(stdout," dependents %d\n",tape_stats[NUM_DEPENDENTS]);
- fprintf(stdout," operations %d\n",tape_stats[NUM_OPERATIONS]);
- fprintf(stdout," operations buffer size %d\n",tape_stats[OP_BUFFER_SIZE]);
- fprintf(stdout," locations buffer size %d\n",tape_stats[LOC_BUFFER_SIZE]);
- fprintf(stdout," constants buffer size %d\n",tape_stats[VAL_BUFFER_SIZE]);
- fprintf(stdout," maxlive %d\n",tape_stats[NUM_MAX_LIVES]);
- fprintf(stdout," valstack size %d\n\n",tape_stats[TAY_STACK_SIZE]);
+ fprintf(stdout,"\n independents %zu\n",tape_stats[NUM_INDEPENDENTS]);
+ fprintf(stdout," dependents %zu\n",tape_stats[NUM_DEPENDENTS]);
+ fprintf(stdout," operations %zu\n",tape_stats[NUM_OPERATIONS]);
+ fprintf(stdout," operations buffer size %zu\n",tape_stats[OP_BUFFER_SIZE]);
+ fprintf(stdout," locations buffer size %zu\n",tape_stats[LOC_BUFFER_SIZE]);
+ fprintf(stdout," constants buffer size %zu\n",tape_stats[VAL_BUFFER_SIZE]);
+ fprintf(stdout," maxlive %zu\n",tape_stats[NUM_MAX_LIVES]);
+ fprintf(stdout," valstack size %zu\n\n",tape_stats[TAY_STACK_SIZE]);
fprintf(stdout," ");
fprintf(stdout,TIMEFORMAT,(t01-t00)*rtu*evalCount,
Index: ADOL-C/examples/additional_examples/tapesave/Makefile.in
===================================================================
--- ADOL-C/examples/additional_examples/tapesave/Makefile.in (revision 491)
+++ ADOL-C/examples/additional_examples/tapesave/Makefile.in (revision 517)
@@ -94,7 +94,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -211,6 +212,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/openmp_exam/Makefile.in
===================================================================
--- ADOL-C/examples/additional_examples/openmp_exam/Makefile.in (revision 491)
+++ ADOL-C/examples/additional_examples/openmp_exam/Makefile.in (revision 517)
@@ -94,7 +94,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -211,6 +212,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/openmp_exam/liborser.cpp
===================================================================
--- ADOL-C/examples/additional_examples/openmp_exam/liborser.cpp (revision 491)
+++ ADOL-C/examples/additional_examples/openmp_exam/liborser.cpp (revision 517)
@@ -27,7 +27,7 @@
#include <ctime>
#include <cmath>
-#include "adolc.h"
+#include <adolc/adolc.h>
/* calculate path values */
Index: ADOL-C/examples/additional_examples/openmp_exam/liborpar.cpp
===================================================================
--- ADOL-C/examples/additional_examples/openmp_exam/liborpar.cpp (revision 491)
+++ ADOL-C/examples/additional_examples/openmp_exam/liborpar.cpp (revision 517)
@@ -31,7 +31,7 @@
#ifdef _OPENMP
#include <omp.h>
-#include <adolc_openmp.h>
+#include <adolc/adolc_openmp.h>
#endif
/* calculate path values */
Index: ADOL-C/examples/additional_examples/fixpoint_exam/Makefile.in
===================================================================
--- ADOL-C/examples/additional_examples/fixpoint_exam/Makefile.in (revision 491)
+++ ADOL-C/examples/additional_examples/fixpoint_exam/Makefile.in (revision 517)
@@ -94,7 +94,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -207,6 +208,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/taylor/Makefile.in
===================================================================
--- ADOL-C/examples/additional_examples/taylor/Makefile.in (revision 491)
+++ ADOL-C/examples/additional_examples/taylor/Makefile.in (revision 517)
@@ -96,7 +96,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -227,6 +228,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/lighthouse/Makefile.in
===================================================================
--- ADOL-C/examples/additional_examples/lighthouse/Makefile.in (revision 491)
+++ ADOL-C/examples/additional_examples/lighthouse/Makefile.in (revision 517)
@@ -95,7 +95,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -222,6 +223,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/lighthouse/cubic-2.cpp
===================================================================
--- ADOL-C/examples/additional_examples/lighthouse/cubic-2.cpp (revision 491)
+++ ADOL-C/examples/additional_examples/lighthouse/cubic-2.cpp (revision 517)
@@ -91,14 +91,14 @@
size_t tape_stats[STAT_SIZE];
tapestats(tag,tape_stats);
- fprintf(stdout,"\n independents %d\n",tape_stats[NUM_INDEPENDENTS]);
- fprintf(stdout," dependents %d\n",tape_stats[NUM_DEPENDENTS]);
- fprintf(stdout," operations %d\n",tape_stats[NUM_OPERATIONS]);
- fprintf(stdout," operations buffer size %d\n",tape_stats[OP_BUFFER_SIZE]);
- fprintf(stdout," locations buffer size %d\n",tape_stats[LOC_BUFFER_SIZE]);
- fprintf(stdout," constants buffer size %d\n",tape_stats[VAL_BUFFER_SIZE]);
- fprintf(stdout," maxlive %d\n",tape_stats[NUM_MAX_LIVES]);
- fprintf(stdout," valstack size %d\n\n",tape_stats[TAY_STACK_SIZE]);
+ fprintf(stdout,"\n independents %zu\n",tape_stats[NUM_INDEPENDENTS]);
+ fprintf(stdout," dependents %zu\n",tape_stats[NUM_DEPENDENTS]);
+ fprintf(stdout," operations %zu\n",tape_stats[NUM_OPERATIONS]);
+ fprintf(stdout," operations buffer size %zu\n",tape_stats[OP_BUFFER_SIZE]);
+ fprintf(stdout," locations buffer size %zu\n",tape_stats[LOC_BUFFER_SIZE]);
+ fprintf(stdout," constants buffer size %zu\n",tape_stats[VAL_BUFFER_SIZE]);
+ fprintf(stdout," maxlive %zu\n",tape_stats[NUM_MAX_LIVES]);
+ fprintf(stdout," valstack size %zu\n\n",tape_stats[TAY_STACK_SIZE]);
/*--------------------------------------------------------------------------*/
Index: ADOL-C/examples/additional_examples/lighthouse/cubic-iter-2.cpp
===================================================================
--- ADOL-C/examples/additional_examples/lighthouse/cubic-iter-2.cpp (revision 491)
+++ ADOL-C/examples/additional_examples/lighthouse/cubic-iter-2.cpp (revision 517)
@@ -69,14 +69,14 @@
size_t tape_stats[STAT_SIZE];
tapestats(tag,tape_stats);
- fprintf(stdout,"\n independents %d\n",tape_stats[NUM_INDEPENDENTS]);
- fprintf(stdout," dependents %d\n",tape_stats[NUM_DEPENDENTS]);
- fprintf(stdout," operations %d\n",tape_stats[NUM_OPERATIONS]);
- fprintf(stdout," operations buffer size %d\n",tape_stats[OP_BUFFER_SIZE]);
- fprintf(stdout," locations buffer size %d\n",tape_stats[LOC_BUFFER_SIZE]);
- fprintf(stdout," constants buffer size %d\n",tape_stats[VAL_BUFFER_SIZE]);
- fprintf(stdout," maxlive %d\n",tape_stats[NUM_MAX_LIVES]);
- fprintf(stdout," valstack size %d\n\n",tape_stats[TAY_STACK_SIZE]);
+ fprintf(stdout,"\n independents %zu\n",tape_stats[NUM_INDEPENDENTS]);
+ fprintf(stdout," dependents %zu\n",tape_stats[NUM_DEPENDENTS]);
+ fprintf(stdout," operations %zu\n",tape_stats[NUM_OPERATIONS]);
+ fprintf(stdout," operations buffer size %zu\n",tape_stats[OP_BUFFER_SIZE]);
+ fprintf(stdout," locations buffer size %zu\n",tape_stats[LOC_BUFFER_SIZE]);
+ fprintf(stdout," constants buffer size %zu\n",tape_stats[VAL_BUFFER_SIZE]);
+ fprintf(stdout," maxlive %zu\n",tape_stats[NUM_MAX_LIVES]);
+ fprintf(stdout," valstack size %zu\n\n",tape_stats[TAY_STACK_SIZE]);
/*--------------------------------------------------------------------------*/
x[1] = t;
Index: ADOL-C/examples/additional_examples/lighthouse/cubic.cpp
===================================================================
--- ADOL-C/examples/additional_examples/lighthouse/cubic.cpp (revision 491)
+++ ADOL-C/examples/additional_examples/lighthouse/cubic.cpp (revision 517)
@@ -112,25 +112,25 @@
tapestats(tag1,tape_stats);
- fprintf(stdout,"\n independents %d\n",tape_stats[NUM_INDEPENDENTS]);
- fprintf(stdout," dependents %d\n",tape_stats[NUM_DEPENDENTS]);
- fprintf(stdout," operations %d\n",tape_stats[NUM_OPERATIONS]);
- fprintf(stdout," operations buffer size %d\n",tape_stats[OP_BUFFER_SIZE]);
- fprintf(stdout," locations buffer size %d\n",tape_stats[LOC_BUFFER_SIZE]);
- fprintf(stdout," constants buffer size %d\n",tape_stats[VAL_BUFFER_SIZE]);
- fprintf(stdout," maxlive %d\n",tape_stats[NUM_MAX_LIVES]);
- fprintf(stdout," valstack size %d\n\n",tape_stats[TAY_STACK_SIZE]);
+ fprintf(stdout,"\n independents %zu\n",tape_stats[NUM_INDEPENDENTS]);
+ fprintf(stdout," dependents %zu\n",tape_stats[NUM_DEPENDENTS]);
+ fprintf(stdout," operations %zu\n",tape_stats[NUM_OPERATIONS]);
+ fprintf(stdout," operations buffer size %zu\n",tape_stats[OP_BUFFER_SIZE]);
+ fprintf(stdout," locations buffer size %zu\n",tape_stats[LOC_BUFFER_SIZE]);
+ fprintf(stdout," constants buffer size %zu\n",tape_stats[VAL_BUFFER_SIZE]);
+ fprintf(stdout," maxlive %zu\n",tape_stats[NUM_MAX_LIVES]);
+ fprintf(stdout," valstack size %zu\n\n",tape_stats[TAY_STACK_SIZE]);
tapestats(tag2,tape_stats);
- fprintf(stdout,"\n independents %d\n",tape_stats[NUM_INDEPENDENTS]);
- fprintf(stdout," dependents %d\n",tape_stats[NUM_DEPENDENTS]);
- fprintf(stdout," operations %d\n",tape_stats[NUM_OPERATIONS]);
- fprintf(stdout," operations buffer size %d\n",tape_stats[OP_BUFFER_SIZE]);
- fprintf(stdout," locations buffer size %d\n",tape_stats[LOC_BUFFER_SIZE]);
- fprintf(stdout," constants buffer size %d\n",tape_stats[VAL_BUFFER_SIZE]);
- fprintf(stdout," maxlive %d\n",tape_stats[NUM_MAX_LIVES]);
- fprintf(stdout," valstack size %d\n\n",tape_stats[TAY_STACK_SIZE]);
+ fprintf(stdout,"\n independents %zu\n",tape_stats[NUM_INDEPENDENTS]);
+ fprintf(stdout," dependents %zu\n",tape_stats[NUM_DEPENDENTS]);
+ fprintf(stdout," operations %zu\n",tape_stats[NUM_OPERATIONS]);
+ fprintf(stdout," operations buffer size %zu\n",tape_stats[OP_BUFFER_SIZE]);
+ fprintf(stdout," locations buffer size %zu\n",tape_stats[LOC_BUFFER_SIZE]);
+ fprintf(stdout," constants buffer size %zu\n",tape_stats[VAL_BUFFER_SIZE]);
+ fprintf(stdout," maxlive %zu\n",tape_stats[NUM_MAX_LIVES]);
+ fprintf(stdout," valstack size %zu\n\n",tape_stats[TAY_STACK_SIZE]);
/*--------------------------------------------------------------------------*/
tdist = (tmax-tmin)/((double) (vc-1));
Index: ADOL-C/examples/additional_examples/lighthouse/cubic-iter.cpp
===================================================================
--- ADOL-C/examples/additional_examples/lighthouse/cubic-iter.cpp (revision 491)
+++ ADOL-C/examples/additional_examples/lighthouse/cubic-iter.cpp (revision 517)
@@ -72,14 +72,14 @@
size_t tape_stats[STAT_SIZE];
tapestats(tag,tape_stats);
- fprintf(stdout,"\n independents %d\n",tape_stats[NUM_INDEPENDENTS]);
- fprintf(stdout," dependents %d\n",tape_stats[NUM_DEPENDENTS]);
- fprintf(stdout," operations %d\n",tape_stats[NUM_OPERATIONS]);
- fprintf(stdout," operations buffer size %d\n",tape_stats[OP_BUFFER_SIZE]);
- fprintf(stdout," locations buffer size %d\n",tape_stats[LOC_BUFFER_SIZE]);
- fprintf(stdout," constants buffer size %d\n",tape_stats[VAL_BUFFER_SIZE]);
- fprintf(stdout," maxlive %d\n",tape_stats[NUM_MAX_LIVES]);
- fprintf(stdout," valstack size %d\n\n",tape_stats[TAY_STACK_SIZE]);
+ fprintf(stdout,"\n independents %zu\n",tape_stats[NUM_INDEPENDENTS]);
+ fprintf(stdout," dependents %zu\n",tape_stats[NUM_DEPENDENTS]);
+ fprintf(stdout," operations %zu\n",tape_stats[NUM_OPERATIONS]);
+ fprintf(stdout," operations buffer size %zu\n",tape_stats[OP_BUFFER_SIZE]);
+ fprintf(stdout," locations buffer size %zu\n",tape_stats[LOC_BUFFER_SIZE]);
+ fprintf(stdout," constants buffer size %zu\n",tape_stats[VAL_BUFFER_SIZE]);
+ fprintf(stdout," maxlive %zu\n",tape_stats[NUM_MAX_LIVES]);
+ fprintf(stdout," valstack size %zu\n\n",tape_stats[TAY_STACK_SIZE]);
/*--------------------------------------------------------------------------*/
tdist = (tmax-tmin)/((double) (vc-1));
Index: ADOL-C/examples/additional_examples/cuda/Makefile.in
===================================================================
--- ADOL-C/examples/additional_examples/cuda/Makefile.in (revision 491)
+++ ADOL-C/examples/additional_examples/cuda/Makefile.in (revision 517)
@@ -91,7 +91,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -155,6 +156,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/lufact/Makefile.in
===================================================================
--- ADOL-C/examples/additional_examples/lufact/Makefile.in (revision 491)
+++ ADOL-C/examples/additional_examples/lufact/Makefile.in (revision 517)
@@ -94,7 +94,8 @@
$(top_srcdir)/autoconf/ltsugar.m4 \
$(top_srcdir)/autoconf/ltversion.m4 \
$(top_srcdir)/autoconf/lt~obsolete.m4 \
- $(top_srcdir)/autoconf/mpi.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/autoconf/mpi.m4 \
+ $(top_srcdir)/autoconf/stdcxx_11.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -211,6 +212,7 @@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Index: ADOL-C/examples/additional_examples/lufact/LUsolve.cpp
===================================================================
--- ADOL-C/examples/additional_examples/lufact/LUsolve.cpp (revision 491)
+++ ADOL-C/examples/additional_examples/lufact/LUsolve.cpp (revision 517)
@@ -126,14 +126,14 @@
size_t tape_stats[STAT_SIZE];
tapestats(tag,tape_stats);
- fprintf(stdout,"\n independents %d\n",tape_stats[NUM_INDEPENDENTS]);
- fprintf(stdout," dependents %d\n",tape_stats[NUM_DEPENDENTS]);
- fprintf(stdout," operations %d\n",tape_stats[NUM_OPERATIONS]);
- fprintf(stdout," operations buffer size %d\n",tape_stats[OP_BUFFER_SIZE]);
- fprintf(stdout," locations buffer size %d\n",tape_stats[LOC_BUFFER_SIZE]);
- fprintf(stdout," constants buffer size %d\n",tape_stats[VAL_BUFFER_SIZE]);
- fprintf(stdout," maxlive %d\n",tape_stats[NUM_MAX_LIVES]);
- fprintf(stdout," valstack size %d\n\n",tape_stats[TAY_STACK_SIZE]);
+ fprintf(stdout,"\n independents %zu\n",tape_stats[NUM_INDEPENDENTS]);
+ fprintf(stdout," dependents %zu\n",tape_stats[NUM_DEPENDENTS]);
+ fprintf(stdout," operations %zu\n",tape_stats[NUM_OPERATIONS]);
+ fprintf(stdout," operations buffer size %zu\n",tape_stats[OP_BUFFER_SIZE]);
+ fprintf(stdout," locations buffer size %zu\n",tape_stats[LOC_BUFFER_SIZE]);
+ fprintf(stdout," constants buffer size %zu\n",tape_stats[VAL_BUFFER_SIZE]);
+ fprintf(stdout," maxlive %zu\n",tape_stats[NUM_MAX_LIVES]);
+ fprintf(stdout," valstack size %zu\n\n",tape_stats[TAY_STACK_SIZE]);
/*------------------------------------------------------------------------*/
/* That's it */
Index: ADOL-C/examples/additional_examples/lufact/LUdet.cpp
===================================================================
--- ADOL-C/examples/additional_examples/lufact/LUdet.cpp (revision 491)
+++ ADOL-C/examples/additional_examples/lufact/LUdet.cpp (revision 517)
@@ -120,14 +120,14 @@
size_t tape_stats[STAT_SIZE];
tapestats(tag,tape_stats);
- fprintf(stdout,"\n independents %d\n",tape_stats[NUM_INDEPENDENTS]);
- fprintf(stdout," dependents %d\n",tape_stats[NUM_DEPENDENTS]);
- fprintf(stdout," operations %d\n",tape_stats[NUM_OPERATIONS]);
- fprintf(stdout," operations buffer size %d\n",tape_stats[OP_BUFFER_SIZE]);
- fprintf(stdout," locations buffer size %d\n",tape_stats[LOC_BUFFER_SIZE]);
- fprintf(stdout," constants buffer size %d\n",tape_stats[VAL_BUFFER_SIZE]);
- fprintf(stdout," maxlive %d\n",tape_stats[NUM_MAX_LIVES]);
- fprintf(stdout," valstack size %d\n\n",tape_stats[TAY_STACK_SIZE]);
+ fprintf(stdout,"\n independents %zu\n",tape_stats[NUM_INDEPENDENTS]);
+ fprintf(stdout," dependents %zu\n",tape_stats[NUM_DEPENDENTS]);
+ fprintf(stdout," operations %zu\n",tape_stats[NUM_OPERATIONS]);
+ fprintf(stdout," operations buffer size %zu\n",tape_stats[OP_BUFFER_SIZE]);
+ fprintf(stdout," locations buffer size %zu\n",tape_stats[LOC_BUFFER_SIZE]);
+ fprintf(stdout," constants buffer size %zu\n",tape_stats[VAL_BUFFER_SIZE]);
+ fprintf(stdout," maxlive %zu\n",tape_stats[NUM_MAX_LIVES]);
+ fprintf(stdout," valstack size %zu\n\n",tape_stats[TAY_STACK_SIZE]);
/*------------------------------------------------------------------------*/
/* That's it */
Index: configure.ac
===================================================================
--- configure.ac (revision 491)
+++ configure.ac (revision 517)
@@ -49,6 +49,8 @@
esac
done
+AM_CONDITIONAL(DARWIN, [test "x${host_os#darwin}" != "x${host_os}"])
+
AC_MSG_CHECKING(whether to build ADOL-C with adjoinable MPI (AMPI) support)
AC_ARG_ENABLE(ampi,
[AS_HELP_STRING([--enable-ampi],[build ADOL-C with adjoinable MPI (AMPI) support [default=disabled]])],
@@ -61,7 +63,9 @@
# checks for programs
AC_PROG_CXX
+AX_CXX_COMPILE_STDCXX_11(noext,mandatory)
AC_PROG_CC
+AC_PROG_CC_C99
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
Index: TODO
===================================================================
--- TODO (revision 491)
+++ TODO (revision 517)
@@ -1,4 +1,4 @@
-
+
- check variable initialization (to overcome ADOL-C - malloc bug)
- performance tuning for tape handling and in many other ways
Index: aclocal.m4
===================================================================
--- aclocal.m4 (revision 491)
+++ aclocal.m4 (revision 517)
@@ -1082,3 +1082,4 @@
m4_include([autoconf/ltversion.m4])
m4_include([autoconf/lt~obsolete.m4])
m4_include([autoconf/mpi.m4])
+m4_include([autoconf/stdcxx_11.m4])
Index: autoconf/stdcxx_11.m4
===================================================================
--- autoconf/stdcxx_11.m4 (revision 0)
+++ autoconf/stdcxx_11.m4 (revision 517)
@@ -0,0 +1,136 @@
+# based on
+# ============================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
+# ============================================================================
+#
+# SYNOPSIS
+#
+# AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional])
+#
+# DESCRIPTION
+#
+# Check for baseline language coverage in the compiler for the C++11
+# standard; if necessary, add switches to CXXFLAGS to enable support.
+#
+# The first argument, if specified, indicates whether you insist on an
+# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
+# -std=c++11). If neither is specified, you get whatever works, with
+# preference for an extended mode.
+#
+# The second argument, if specified 'mandatory' or if left unspecified,
+# indicates that baseline C++11 support is required and that the macro
+# should error out if no mode with that support is found. If specified
+# 'optional', then configuration proceeds regardless, after defining
+# HAVE_CXX11 if and only if a supporting mode is found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
+# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
+# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 3
+
+m4_ifndef([_AX_CXX_COMPILE_STDCXX_11_testbody], [
+m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [
+ template <typename T>
+ struct check
+ {
+ static_assert(sizeof(int) <= sizeof(T), "not big enough");
+ };
+
+ typedef check<check<bool>> right_angle_brackets;
+
+ int a;
+ decltype(a) b;
+
+ typedef check<int> check_type;
+ check_type c;
+ check_type&& cr = static_cast<check_type&&>(c);
+
+ auto d = a;
+])],[])
+
+m4_ifndef([AX_CXX_COMPILE_STDCXX_11],[dnl
+AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl
+ m4_if([$1], [], [],
+ [$1], [ext], [],
+ [$1], [noext], [],
+ [m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_11])])dnl
+ m4_if([$2], [], [ax_cxx_compile_cxx11_required=true],
+ [$2], [mandatory], [ax_cxx_compile_cxx11_required=true],
+ [$2], [optional], [ax_cxx_compile_cxx11_required=false],
+ [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX_11])])dnl
+ AC_LANG_PUSH([C++])dnl
+ ac_success=no
+ AC_CACHE_CHECK(whether $CXX supports C++11 features by default,
+ ax_cv_cxx_compile_cxx11,
+ [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
+ [ax_cv_cxx_compile_cxx11=yes],
+ [ax_cv_cxx_compile_cxx11=no])])
+ if test x$ax_cv_cxx_compile_cxx11 = xyes; then
+ ac_success=yes
+ fi
+
+ m4_if([$1], [noext], [], [dnl
+ if test x$ac_success = xno; then
+ for switch in -std=gnu++11 -std=gnu++0x; do
+ cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch])
+ AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch,
+ $cachevar,
+ [ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS $switch"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
+ [eval $cachevar=yes],
+ [eval $cachevar=no])
+ CXXFLAGS="$ac_save_CXXFLAGS"])
+ if eval test x\$$cachevar = xyes; then
+ CXXFLAGS="$CXXFLAGS $switch"
+ ac_success=yes
+ break
+ fi
+ done
+ fi])
+
+ m4_if([$1], [ext], [], [dnl
+ if test x$ac_success = xno; then
+ for switch in -std=c++11 -std=c++0x; do
+ cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch])
+ AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch,
+ $cachevar,
+ [ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS $switch"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
+ [eval $cachevar=yes],
+ [eval $cachevar=no])
+ CXXFLAGS="$ac_save_CXXFLAGS"])
+ if eval test x\$$cachevar = xyes; then
+ CXXFLAGS="$CXXFLAGS $switch"
+ ac_success=yes
+ break
+ fi
+ done
+ fi])
+ AC_LANG_POP([C++])
+ if test x$ax_cxx_compile_cxx11_required = xtrue; then
+ if test x$ac_success = xno; then
+ AC_MSG_ERROR([*** A compiler with support for C++11 language features is required.])
+ fi
+ else
+ if test x$ac_success = xno; then
+ HAVE_CXX11=0
+ AC_MSG_NOTICE([No compiler with C++11 support was found])
+ else
+ HAVE_CXX11=1
+ AC_DEFINE(HAVE_CXX11,1,
+ [define if the compiler supports basic C++11 syntax])
+ fi
+
+ AC_SUBST(HAVE_CXX11)
+ fi
+])],[])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment