getfem-commits
[Top][All Lists]
Advanced

[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: Wed, 24 Oct 2018 07:29:43 -0400 (EDT)

branch: master
commit aa4d3e16c568d7a85de23f719fb60adead96f3d0
Author: Yves Renard <address@hidden>
Date:   Wed Oct 24 13:29:31 2018 +0200

    minor modification for compatibility with xcode 10.0, mac
---
 .gitignore                        |  1 +
 configure.ac                      |  2 +-
 interface/src/getfem_interface.cc | 18 +++++++++---------
 m4/ax_prog_cxx_mpi.m4             | 20 +++++++++-----------
 src/getfem/getfem_mesh_fem.h      |  2 +-
 src/getfem_assembling_tensors.cc  | 15 ++++-----------
 src/gmm/gmm_except.h              | 16 ++++++++--------
 tests/dynamic_array.cc            |  2 +-
 8 files changed, 34 insertions(+), 42 deletions(-)

diff --git a/.gitignore b/.gitignore
index dadba2f..397f882 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@
 .libs
 .DS_Store
 *.trs
+__pycache__
 Makefile.in
 Makefile
 *~
diff --git a/configure.ac b/configure.ac
index f64a2ea..b7b3a95 100644
--- a/configure.ac
+++ b/configure.ac
@@ -578,7 +578,7 @@ case $host in
         MUMPS_SEQ_LIBS="-lsmumps -ldmumps -lcmumps -lzmumps -lmumps_common 
-lmpiseq -lpord"
         ;;
     *apple*)
-        MUMPS_SEQ_LIBS="-lsmumps -ldmumps -lcmumps -lzmumps -lmumps_common 
-lmpiseq -lpord"
+        MUMPS_SEQ_LIBS="-lsmumps -ldmumps -lcmumps -lzmumps -lmumps_common 
-lmpiseq -lpord -lgomp"
         ;;
     *)
         MUMPS_SEQ_LIBS="-lsmumps_seq -ldmumps_seq -lcmumps_seq -lzmumps_seq"
diff --git a/interface/src/getfem_interface.cc 
b/interface/src/getfem_interface.cc
index 1d43da5..50270d4 100644
--- a/interface/src/getfem_interface.cc
+++ b/interface/src/getfem_interface.cc
@@ -210,36 +210,36 @@ char* getfem_interface_main(int config_id, const char 
*function,
     *nb_out_args = int(out.args().size());
     std::copy(out.args().begin(), out.args().end(), *pout_args);
   }
-  catch (getfemint_bad_arg e) {
+  catch (const getfemint_bad_arg &e) {
     // cerr << "Bad argument!\n";
     return strdup(e.what());
   }
-  catch (getfemint_interrupted) {
+  catch (const getfemint_interrupted &) {
     cerr << "Ctrl-C catched!\n";
     return strdup("Interrupted (Ctrl-C)");
   }
-  catch (getfemint_error e) {
+  catch (const getfemint_error &e) {
     // cerr << "Error!\n";
     return strdup(e.what());
   }
-  catch (std::logic_error e) {
+  catch (const std::logic_error &e) {
     cerr << "logic_error exception caught\n";
     return strdup(e.what());
   }
-  catch (std::runtime_error e) {
+  catch (const std::runtime_error &e) {
     cerr << "runtime_error exception caught\n";
     return strdup(e.what());
   }
-  catch(std::bad_alloc) {
+  catch(const std::bad_alloc &) {
     return strdup("getfem caught a bad_alloc exception\n");
   }
-  catch(std::bad_cast) {
+  catch(const std::bad_cast &) {
     return strdup("getfem caught a bad_cast exception\n");
   }
-  catch(std::bad_typeid) {
+  catch(const std::bad_typeid &) {
     return strdup("getfem caught a bad_typeid exception\n");
   }
-  catch(std::bad_exception) {
+  catch(const std::bad_exception &) {
     return strdup("getfem caught a bad_exception exception\n");
   }
   catch (...) {
diff --git a/m4/ax_prog_cxx_mpi.m4 b/m4/ax_prog_cxx_mpi.m4
index 3b4c1fc..36b66f0 100644
--- a/m4/ax_prog_cxx_mpi.m4
+++ b/m4/ax_prog_cxx_mpi.m4
@@ -1,5 +1,5 @@
 # ===========================================================================
-#      http://www.gnu.org/software/autoconf-archive/ax_prog_cxx_mpi.html
+#     https://www.gnu.org/software/autoconf-archive/ax_prog_cxx_mpi.html
 # ===========================================================================
 #
 # SYNOPSIS
@@ -57,7 +57,7 @@
 #   Public License for more details.
 #
 #   You should have received a copy of the GNU General Public License along
-#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#   with this program. If not, see <https://www.gnu.org/licenses/>.
 #
 #   As a special exception, the respective Autoconf Macro's copyright owner
 #   gives unlimited permission to copy, distribute and modify the configure
@@ -72,7 +72,7 @@
 #   modified version of the Autoconf Macro, you may extend this special
 #   exception to the GPL to apply to your modified version as well.
 
-#serial 1
+#serial 3
 
 AC_DEFUN([AX_PROG_CXX_MPI], [
 AC_PREREQ(2.50)
@@ -87,24 +87,22 @@ AS_IF([test x"$_ax_prog_cxx_mpi_mpi_wanted" = xno],
   [
     AC_LANG_PUSH([C++])
 
-    # test whether MPI::Init is available
+    # test whether MPI_Init() is available
     # We do not use AC_SEARCH_LIBS here, as it caches its outcome and
     # thus disallows corresponding calls in the other AX_PROG_*_MPI
     # macros.
     for lib in NONE mpi mpich; do
       save_LIBS=$LIBS
       if test x"$lib" = xNONE; then
-        AC_MSG_CHECKING([for function MPI::Init])
+        AC_MSG_CHECKING([for function MPI_Init])
       else
-        AC_MSG_CHECKING([for function MPI::Init in -l$lib])
+        AC_MSG_CHECKING([for function MPI_Init in -l$lib])
         LIBS="-l$lib $LIBS"
       fi
       AC_LINK_IFELSE([
         AC_LANG_PROGRAM([
-namespace MPI {
-char Init();
-};
-using MPI::Init;],[MPI::Init;])],
+extern "C" { void MPI_Init(); }
+],[MPI_Init();])],
         [ _ax_prog_cxx_mpi_mpi_found=yes ],
         [ _ax_prog_cxx_mpi_mpi_found=no ])
       AC_MSG_RESULT($_ax_prog_cxx_mpi_mpi_found)
@@ -176,5 +174,5 @@ AC_DEFUN([_AX_PROG_CXX_MPI], [
       AC_CHECK_TOOLS([CXX], [mpic++ mpicxx mpiCC sxmpic++ hcp mpxlC_r mpxlC 
mpixlcxx_r mpixlcxx mpg++ mpc++ mpCC cmpic++ mpiFCC CCicpc pgCC pathCC sxc++ 
xlC_r xlC bgxlC_r bgxlC openCC sunCC crayCC g++ c++ gpp aCC CC cxx cc++ cl.exe 
FCC KCC RCC])
     fi
   fi
-  AC_PROG_CXX(g++ cxx KCC CC cc++ xlC aCC c++ icpc)
+  AC_PROG_CXX
 ])dnl _AX_PROG_CXX_MPI
diff --git a/src/getfem/getfem_mesh_fem.h b/src/getfem/getfem_mesh_fem.h
index 9482d50..6a3864f 100644
--- a/src/getfem/getfem_mesh_fem.h
+++ b/src/getfem/getfem_mesh_fem.h
@@ -64,7 +64,7 @@ namespace getfem {
     iterator &operator ++()
     { ++ii; if (ii == N) { ii = 0; ++it; } return *this; }
     iterator &operator --()
-    { if (ii == 0) { ii = N-1; --it; } else --ii; return *this; }
+    { if (ii == 0) { ii = N; --it; } --ii; return *this; }
     iterator operator ++(int) { iterator tmp = *this; ++(*this); return tmp; }
     iterator operator --(int) { iterator tmp = *this; --(*this); return tmp; }
 
diff --git a/src/getfem_assembling_tensors.cc b/src/getfem_assembling_tensors.cc
index b1cdc6c..378863c 100644
--- a/src/getfem_assembling_tensors.cc
+++ b/src/getfem_assembling_tensors.cc
@@ -153,7 +153,7 @@ namespace getfem {
         tensor_ranges rn(child(n).ranges());
         const std::string &s = red[n].second;
         GMM_ASSERT1(rn.size() == s.size(), "Wrong size !");
-        for (unsigned i=0; i < rn.size(); ++i)
+        for (unsigned i=0; i < rn.size(); ++i) {
           if (s[i] != ' ') {
             size_type p = s.find(s[i]);
             if (p != size_type(-1) && p < i && rn[p] != rn[i])
@@ -161,16 +161,9 @@ namespace getfem {
               "of size " << rn << " with '"
               << s << "'");
           }
-          //cerr << "ts = " << child(n).ranges() << ", red="
-          //     << red[n].second << "\n";
-          bgeot::tensor_reduction::diag_shape(ts, red[n].second);
-          // cerr << "REDUCTION '" << red[n].second
-          //        << "' -> sending required to child#" << int(n)
-          //        << " " << child(n).name() << ":" << endl;
-          // cerr << ts << endl;
-          child(n).merge_required_shape(ts);
-          // cerr << "------>required shape is now: "
-          //      << child(n).required_shape() << endl;
+        }
+        bgeot::tensor_reduction::diag_shape(ts, red[n].second);
+        child(n).merge_required_shape(ts);
       }
     }
 
diff --git a/src/gmm/gmm_except.h b/src/gmm/gmm_except.h
index f19e87f..2e2721c 100644
--- a/src/gmm/gmm_except.h
+++ b/src/gmm/gmm_except.h
@@ -57,7 +57,7 @@ namespace gmm {
   public:
     gmm_error(const std::string& what_arg, int errorLevel = 1):
       std::logic_error (what_arg), errorLevel_(errorLevel) {}
-    int errLevel() {return errorLevel_;}
+    int errLevel() const { return errorLevel_; }
 
   private:
     int errorLevel_;
@@ -304,7 +304,7 @@ inline void GMM_THROW() {}
 #endif
 
 #define GMM_STANDARD_CATCH_ERROR                                           \
-  catch(gmm::gmm_error e)                                                  \
+  catch(const gmm::gmm_error &e)                                           \
   {                                                                        \
     std::stringstream strStream;                                           \
     strStream << "============================================\n";         \
@@ -315,7 +315,7 @@ inline void GMM_THROW() {}
                                gmm::FeedbackType::ASSERT, e.errLevel());   \
     gmm::feedback_manager::terminating_action();                           \
   }                                                                        \
-  catch(std::logic_error e)                                                \
+  catch(const std::logic_error &e)                                         \
   {                                                                        \
     std::stringstream strStream;                                           \
     strStream << "============================================\n";         \
@@ -326,7 +326,7 @@ inline void GMM_THROW() {}
                                gmm::FeedbackType::ASSERT, 0);              \
     gmm::feedback_manager::terminating_action();                           \
   }                                                                        \
-  catch(std::runtime_error e)                                              \
+  catch(const std::runtime_error &e)                                       \
   {                                                                        \
     std::stringstream strStream;                                           \
     strStream << "============================================\n";         \
@@ -337,7 +337,7 @@ inline void GMM_THROW() {}
                                gmm::FeedbackType::ASSERT, 0);              \
     gmm::feedback_manager::terminating_action();                           \
   }                                                                        \
-  catch(std::bad_alloc)                                                    \
+  catch(const std::bad_alloc &)                                            \
   {                                                                        \
     std::stringstream strStream;                                           \
     strStream << "============================================\n";         \
@@ -347,7 +347,7 @@ inline void GMM_THROW() {}
                                gmm::FeedbackType::ASSERT, 0);              \
     gmm::feedback_manager::terminating_action();                           \
   }                                                                        \
-  catch(std::bad_typeid)                                                   \
+  catch(const std::bad_typeid &)                                           \
   {                                                                        \
     std::stringstream strStream;                                           \
     strStream << "============================================\n";         \
@@ -357,7 +357,7 @@ inline void GMM_THROW() {}
                                gmm::FeedbackType::ASSERT, 0);              \
     gmm::feedback_manager::terminating_action();                           \
   }                                                                        \
-  catch(std::bad_exception)                                                \
+  catch(const std::bad_exception &)                                        \
   {                                                                        \
     std::stringstream strStream;                                           \
     strStream << "============================================\n";         \
@@ -367,7 +367,7 @@ inline void GMM_THROW() {}
                                gmm::FeedbackType::ASSERT, 0);              \
     gmm::feedback_manager::terminating_action();                           \
   }                                                                        \
-  catch(std::bad_cast)                                                     \
+  catch(const std::bad_cast &)                                             \
   {                                                                        \
     std::stringstream strStream;                                           \
     strStream << "============================================\n";         \
diff --git a/tests/dynamic_array.cc b/tests/dynamic_array.cc
index a7ae4a4..f9b8c87 100644
--- a/tests/dynamic_array.cc
+++ b/tests/dynamic_array.cc
@@ -159,7 +159,7 @@ int main(void) {
       t[(unsigned)(-5)] = 8;
       GMM_ASSERT1(false, "negative index does not produce an error");
     }
-    catch(std::logic_error e) {
+    catch(const std::logic_error &e) {
       cout << "Out of range error successfully catched, ok\n";
     }
 #endif



reply via email to

[Prev in Thread] Current Thread [Next in Thread]