[pure-lang-svn] SF.net SVN: pure-lang:[759] pure/trunk
Status: Beta
Brought to you by:
agraef
|
From: <ag...@us...> - 2008-09-12 11:39:15
|
Revision: 759
http://pure-lang.svn.sourceforge.net/pure-lang/?rev=759&view=rev
Author: agraef
Date: 2008-09-12 11:39:25 +0000 (Fri, 12 Sep 2008)
Log Message:
-----------
Add configury for GSL support.
Modified Paths:
--------------
pure/trunk/config.h.in
pure/trunk/configure
pure/trunk/configure.ac
pure/trunk/interpreter.cc
pure/trunk/pure.cc
pure/trunk/runtime.cc
Modified: pure/trunk/config.h.in
===================================================================
--- pure/trunk/config.h.in 2008-09-12 00:38:24 UTC (rev 758)
+++ pure/trunk/config.h.in 2008-09-12 11:39:25 UTC (rev 759)
@@ -27,6 +27,12 @@
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
+/* Define when building with GSL vector/matrix support. */
+#undef HAVE_GSL
+
+/* Define to 1 if you have the <gsl/gsl_version.h> header file. */
+#undef HAVE_GSL_GSL_VERSION_H
+
/* Define if you have the iconv() function. */
#undef HAVE_ICONV
@@ -42,9 +48,18 @@
/* Define to 1 if you have the `gmp' library (-lgmp). */
#undef HAVE_LIBGMP
+/* Define to 1 if you have the `gsl' library (-lgsl). */
+#undef HAVE_LIBGSL
+
+/* Define to 1 if you have the `gslcblas' library (-lgslcblas). */
+#undef HAVE_LIBGSLCBLAS
+
/* Define to 1 if you have the `iconv' library (-liconv). */
#undef HAVE_LIBICONV
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
/* Define to 1 if you have the `readline' library (-lreadline). */
#undef HAVE_LIBREADLINE
Modified: pure/trunk/configure
===================================================================
--- pure/trunk/configure 2008-09-12 00:38:24 UTC (rev 758)
+++ pure/trunk/configure 2008-09-12 11:39:25 UTC (rev 759)
@@ -1271,10 +1271,11 @@
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-release enable the release build
+ --enable-gsl build with GSL support (default, experimental)
--enable-debug enable the debug build
--enable-debug2 enable the maintenance build
- --disable-shared link the interpreter statically
+ --enable-release enable the release build
+ --enable-shared build the shared runtime library (default)
--enable-warnings enable compiler warnings (-Wall)
Optional Packages:
@@ -4280,10 +4281,11 @@
_ACEOF
-# Check whether --enable-release was given.
-if test "${enable_release+set}" = set; then
- enableval=$enable_release; case "${enableval}" in
- yes) CPPFLAGS="-DNDEBUG -DDEBUG=0"; CXXFLAGS="-O3" ;;
+gsllib=yes
+# Check whether --enable-gsl was given.
+if test "${enable_gsl+set}" = set; then
+ enableval=$enable_gsl; case "${enableval}" in
+ no) gsllib=no ;;
esac
fi
@@ -4301,6 +4303,13 @@
esac
fi
+# Check whether --enable-release was given.
+if test "${enable_release+set}" = set; then
+ enableval=$enable_release; case "${enableval}" in
+ yes) CPPFLAGS="-DNDEBUG -DDEBUG=0"; CXXFLAGS="-O3" ;;
+ esac
+fi
+
sharedlib=yes
# Check whether --enable-shared was given.
if test "${enable_shared+set}" = set; then
@@ -4460,6 +4469,77 @@
fi
+{ echo "$as_me:$LINENO: checking for cos in -lm" >&5
+echo $ECHO_N "checking for cos in -lm... $ECHO_C" >&6; }
+if test "${ac_cv_lib_m_cos+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cos ();
+int
+main ()
+{
+return cos ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_m_cos=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_m_cos=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_cos" >&5
+echo "${ECHO_T}$ac_cv_lib_m_cos" >&6; }
+if test $ac_cv_lib_m_cos = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+ LIBS="-lm $LIBS"
+
+fi
+
+
{ echo "$as_me:$LINENO: checking for libiconv in -liconv" >&5
echo $ECHO_N "checking for libiconv in -liconv... $ECHO_C" >&6; }
if test "${ac_cv_lib_iconv_libiconv+set}" = set; then
@@ -5941,6 +6021,303 @@
fi
+if test $gsllib = yes; then
+
+{ echo "$as_me:$LINENO: checking for cblas_dgemm in -lgslcblas" >&5
+echo $ECHO_N "checking for cblas_dgemm in -lgslcblas... $ECHO_C" >&6; }
+if test "${ac_cv_lib_gslcblas_cblas_dgemm+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgslcblas $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cblas_dgemm ();
+int
+main ()
+{
+return cblas_dgemm ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_gslcblas_cblas_dgemm=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_gslcblas_cblas_dgemm=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_gslcblas_cblas_dgemm" >&5
+echo "${ECHO_T}$ac_cv_lib_gslcblas_cblas_dgemm" >&6; }
+if test $ac_cv_lib_gslcblas_cblas_dgemm = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGSLCBLAS 1
+_ACEOF
+
+ LIBS="-lgslcblas $LIBS"
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for gsl_blas_dgemm in -lgsl" >&5
+echo $ECHO_N "checking for gsl_blas_dgemm in -lgsl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_gsl_gsl_blas_dgemm+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgsl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gsl_blas_dgemm ();
+int
+main ()
+{
+return gsl_blas_dgemm ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_gsl_gsl_blas_dgemm=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_gsl_gsl_blas_dgemm=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_gsl_gsl_blas_dgemm" >&5
+echo "${ECHO_T}$ac_cv_lib_gsl_gsl_blas_dgemm" >&6; }
+if test $ac_cv_lib_gsl_gsl_blas_dgemm = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGSL 1
+_ACEOF
+
+ LIBS="-lgsl $LIBS"
+
+fi
+
+
+for ac_header in gsl/gsl_version.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ gsllib=no
+ if test $ac_cv_lib_gsl_gsl_blas_dgemm = yes; then
+ if test $ac_cv_header_gsl_gsl_version_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GSL 1
+_ACEOF
+
+ { echo "$as_me:$LINENO: result: Building with GSL support." >&5
+echo "${ECHO_T}Building with GSL support." >&6; }
+ gsllib=yes
+ fi
+ fi
+fi
ac_config_files="$ac_config_files Makefile"
cat >confcache <<\_ACEOF
@@ -7071,6 +7448,7 @@
Compiler: $CXX $CXXFLAGS $CPPFLAGS
Linker: $CXX $LDFLAGS $LIBS
Build libpure: $sharedlib
+ GSL support: $gsllib
Now run 'make' to build everything, and 'make install' to install this
software on your system. To remove the installed software at a later
@@ -7084,6 +7462,7 @@
Compiler: $CXX $CXXFLAGS $CPPFLAGS
Linker: $CXX $LDFLAGS $LIBS
Build libpure: $sharedlib
+ GSL support: $gsllib
Now run 'make' to build everything, and 'make install' to install this
software on your system. To remove the installed software at a later
Modified: pure/trunk/configure.ac
===================================================================
--- pure/trunk/configure.ac 2008-09-12 00:38:24 UTC (rev 758)
+++ pure/trunk/configure.ac 2008-09-12 11:39:25 UTC (rev 759)
@@ -44,10 +44,11 @@
dnl Determine pointer sizes. This will be 8 on 64 bit systems.
AC_CHECK_SIZEOF(void *)
dnl Parse --enable options.
-AC_ARG_ENABLE(release,
- [ --enable-release enable the release build],
+gsllib=yes
+AC_ARG_ENABLE(gsl,
+ [ --enable-gsl build with GSL support (default, experimental)],
[case "${enableval}" in
- yes) CPPFLAGS="-DNDEBUG -DDEBUG=0"; CXXFLAGS="-O3" ;;
+ no) gsllib=no ;;
esac])
AC_ARG_ENABLE(debug,
[ --enable-debug enable the debug build],
@@ -59,9 +60,14 @@
[case "${enableval}" in
yes) CPPFLAGS="-DDEBUG=2"; CXXFLAGS="-g" ;;
esac])
+AC_ARG_ENABLE(release,
+ [ --enable-release enable the release build],
+ [case "${enableval}" in
+ yes) CPPFLAGS="-DNDEBUG -DDEBUG=0"; CXXFLAGS="-O3" ;;
+ esac])
sharedlib=yes
AC_ARG_ENABLE(shared,
- [ --disable-shared link the interpreter statically],
+ [ --enable-shared build the shared runtime library (default)],
[case "${enableval}" in
no) LDFLAGS="$LDFLAGS $rdynamic"; sharedlib=no ;;
esac])
@@ -74,6 +80,7 @@
dnl Check for libraries.
AC_CHECK_LIB(gmp, __gmpz_init)
AC_CHECK_LIB(readline, readline)
+AC_CHECK_LIB(m, cos)
dnl On some systems iconv is in a separate library, and may actually be named
dnl libiconv.
AC_CHECK_LIB(iconv, libiconv)
@@ -95,6 +102,20 @@
AC_REINSTALL_SIGHANDLERS
dnl Check to see whether we have POSIX/ISOC99 complex numbers.
AC_CHECK_TYPES([_Complex float, _Complex double])
+dnl Check for GSL support.
+if test $gsllib = yes; then
+ AC_CHECK_LIB(gslcblas, cblas_dgemm)
+ AC_CHECK_LIB(gsl, gsl_blas_dgemm)
+ AC_CHECK_HEADERS([gsl/gsl_version.h])
+ gsllib=no
+ if test $ac_cv_lib_gsl_gsl_blas_dgemm = yes; then
+ if test $ac_cv_header_gsl_gsl_version_h = yes; then
+ AC_DEFINE(HAVE_GSL, 1, [Define when building with GSL vector/matrix support.])
+ AC_MSG_RESULT([Building with GSL support.])
+ gsllib=yes
+ fi
+ fi
+fi
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
@@ -106,6 +127,7 @@
Compiler: $CXX $CXXFLAGS $CPPFLAGS
Linker: $CXX $LDFLAGS $LIBS
Build libpure: $sharedlib
+ GSL support: $gsllib
Now run 'make' to build everything, and 'make install' to install this
software on your system. To remove the installed software at a later
Modified: pure/trunk/interpreter.cc
===================================================================
--- pure/trunk/interpreter.cc 2008-09-12 00:38:24 UTC (rev 758)
+++ pure/trunk/interpreter.cc 2008-09-12 11:39:25 UTC (rev 759)
@@ -14,6 +14,10 @@
#include "config.h"
+#ifdef HAVE_GSL
+#include <gsl/gsl_version.h>
+#endif
+
uint8_t interpreter::g_verbose = 0;
bool interpreter::g_interactive = false;
interpreter* interpreter::g_interp = 0;
@@ -339,6 +343,9 @@
defn("argv", args);
defn("version", pure_cstring_dup(version.c_str()));
defn("sysinfo", pure_cstring_dup(host.c_str()));
+#ifdef HAVE_GSL
+ defn("gsl_version", pure_cstring_dup(gsl_version));
+#endif
}
// Errors and warnings.
Modified: pure/trunk/pure.cc
===================================================================
--- pure/trunk/pure.cc 2008-09-12 00:38:24 UTC (rev 758)
+++ pure/trunk/pure.cc 2008-09-12 11:39:25 UTC (rev 759)
@@ -18,6 +18,10 @@
#include "config.h"
+#if HAVE_GSL
+#include <gsl/gsl_errno.h>
+#endif
+
using namespace std;
#ifndef HOST
@@ -339,6 +343,10 @@
// need to have USE_FASTCC in interpreter.hh enabled).
llvm::PerformTailCallOpt = true;
#endif
+#if defined(HAVE_GSL) && DEBUG<2
+ // Turn off GSL's own error handler which aborts the program.
+ gsl_set_error_handler_off();
+#endif
// scan the command line options
const string prog = *argv;
list<string> myargs;
Modified: pure/trunk/runtime.cc
===================================================================
--- pure/trunk/runtime.cc 2008-09-12 00:38:24 UTC (rev 758)
+++ pure/trunk/runtime.cc 2008-09-12 11:39:25 UTC (rev 759)
@@ -34,6 +34,10 @@
#include "config.h"
#include "funcall.h"
+#ifdef HAVE_GSL
+#include <gsl/gsl_errno.h>
+#endif
+
// Hooks to report stack overflows and other kinds of hard errors.
#define checkstk(test) if (interpreter::stackmax > 0 && \
interpreter::stackdir*(&test - interpreter::baseptr) \
@@ -1059,6 +1063,10 @@
// need to have USE_FASTCC in interpreter.hh enabled).
llvm::PerformTailCallOpt = true;
#endif
+#if defined(HAVE_GSL) && DEBUG<2
+ // Turn off GSL's own error handler which aborts the program.
+ gsl_set_error_handler_off();
+#endif
// scan the command line options
list<string> myargs;
for (char **args = ++argv; *args; ++args)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|