[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Getfem-commits] (no subject)
From: |
Yves Renard |
Subject: |
[Getfem-commits] (no subject) |
Date: |
Sun, 4 Jun 2017 02:23:22 -0400 (EDT) |
branch: devel-yves
commit c828981c56a4b7912fa9a2cd7ed73349213fedbf
Author: Yves Renard <address@hidden>
Date: Sat Jun 3 16:24:39 2017 +0200
minor adaptations for macosX
---
configure.ac | 12 ++++++++++--
src/gmm/gmm_except.h | 13 ++++++-------
tests/integration.cc | 20 +++++++++++++++++++-
3 files changed, 35 insertions(+), 10 deletions(-)
diff --git a/configure.ac b/configure.ac
index 64502ba..df73b76 100644
--- a/configure.ac
+++ b/configure.ac
@@ -543,15 +543,23 @@ AC_ARG_WITH(mumps-include-dir,
CPPFLAGS="$CPPFLAGS $MUMPSINC"
MUMPS_LIBS=""
+case $host in
+ *apple*)
+ MUMPS_SEQ_LIBS="-lsmumps -ldmumps -lcmumps -lzmumps -lmumps_common
-lmpiseq -lpord"
+ ;;
+ *)
+ MUMPS_SEQ_LIBS="-lsmumps_seq -ldmumps_seq -lcmumps_seq -lzmumps_seq"
+ ;;
+esac
acx_mumps_ok="no"
usemumps="no"
AC_ARG_ENABLE(mumps,
[AS_HELP_STRING([--enable-mumps],[enable the use of the (sequential) MUMPS
library. A direct solver for large sparse linear systems.])],
[case $enableval in
- yes | "") usemumps="yes"; acx_mumps_ok="yes"; MUMPS_LIBS="-lsmumps_seq
-ldmumps_seq -lcmumps_seq -lzmumps_seq";;
+ yes | "") usemumps="yes"; acx_mumps_ok="yes"; MUMPS_LIBS="$MUMPS_SEQ_LIBS";;
no) usemumps="no";;
esac],
- [usemumps="test"; acx_mumps_ok="test"; MUMPS_LIBS="-lsmumps_seq -ldmumps_seq
-lcmumps_seq -lzmumps_seq"]
+ [usemumps="test"; acx_mumps_ok="test"; MUMPS_LIBS="$MUMPS_SEQ_LIBS"]
)
AC_ARG_ENABLE(par-mumps,
diff --git a/src/gmm/gmm_except.h b/src/gmm/gmm_except.h
index 4a5296c..30b813a 100644
--- a/src/gmm/gmm_except.h
+++ b/src/gmm/gmm_except.h
@@ -69,7 +69,7 @@ namespace gmm {
// defined.
// GMM_ASSERT3 : For internal checks. Hidden by default. Active
// only when DEBUG_MODE is defined.
-// __EXCEPTIONS is defined by gcc, _CPPUNWIND is defined by visual c++
+ // __EXCEPTIONS is defined by gcc, _CPPUNWIND is defined by visual c++
#if defined(__EXCEPTIONS) || defined(_CPPUNWIND)
inline void short_error_throw(const char *file, int line, const char *func,
const char *errormsg) {
@@ -115,7 +115,6 @@ namespace gmm {
# define GMM_ASSERT1(test, errormsg) \
{ if (!(test)) GMM_THROW_(gmm::gmm_error, errormsg); }
- // inline void GMM_THROW() IS_DEPRECATED;
inline void GMM_THROW() {}
#define GMM_THROW(a, b) { GMM_THROW_(a,b); gmm::GMM_THROW(); }
@@ -270,7 +269,7 @@ namespace gmm {
std::cerr << e.what() << std::endl << std::endl; \
exit(1); \
} \
- catch(std::runtime_error e) \
+ catch(const std::runtime_error &e) \
{ \
std::cerr << "============================================\n"; \
std::cerr << "| An error has been detected !!! |\n"; \
@@ -278,25 +277,25 @@ namespace gmm {
std::cerr << e.what() << std::endl << std::endl; \
exit(1); \
} \
- catch(std::bad_alloc) { \
+ catch(const std::bad_alloc &) { \
std::cerr << "============================================\n"; \
std::cerr << "| A bad allocation has been detected !!! |\n"; \
std::cerr << "============================================\n"; \
exit(1); \
} \
- catch(std::bad_typeid) { \
+ catch(const std::bad_typeid &) { \
std::cerr << "============================================\n"; \
std::cerr << "| A bad typeid has been detected !!! |\n"; \
std::cerr << "============================================\n"; \
exit(1); \
} \
- catch(std::bad_exception) { \
+ catch(const std::bad_exception &) { \
std::cerr << "============================================\n"; \
std::cerr << "| A bad exception has been detected !!! |\n"; \
std::cerr << "============================================\n"; \
exit(1); \
} \
- catch(std::bad_cast) { \
+ catch(const std::bad_cast &) { \
std::cerr << "============================================\n"; \
std::cerr << "| A bad cast has been detected !!! |\n"; \
std::cerr << "============================================\n"; \
diff --git a/tests/integration.cc b/tests/integration.cc
index 8aeb698..9548c48 100644
--- a/tests/integration.cc
+++ b/tests/integration.cc
@@ -447,6 +447,18 @@ static void print_some_methods() {
int main(/* int argc, char **argv */) {
+
+ try {
+ cout << "goulp1.1 ..." << endl;
+ throw std::string("toto");
+ cout << "goulp1.2 ..." << endl;
+ cout << "nbpts=" << im_none->structure()->nb_points() << "\n";
+ cout << "goulp1.3 ..." << endl;
+ } catch (const std::string &e) {
+ ok = 1;
+ }
+
+
FE_ENABLE_EXCEPT; // Enable floating point exception for Nan.
try {
@@ -459,11 +471,17 @@ int main(/* int argc, char **argv */) {
int ok = 0;
getfem::pintegration_method im_none =
getfem::int_method_descriptor("IM_NONE()");
+ cout << "goulp1 ..." << endl;
try {
+ cout << "goulp1.1 ..." << endl;
+ throw std::string("toto");
+ cout << "goulp1.2 ..." << endl;
cout << "nbpts=" << im_none->structure()->nb_points() << "\n";
- } catch (gmm::gmm_error e) {
+ cout << "goulp1.3 ..." << endl;
+ } catch (const std::string &e) {
ok = 1;
}
+ cout << "goulp2 ..." << endl;
GMM_ASSERT1(ok, "IM_NONE failed");
print_some_methods();
check_orders();