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: Fri, 22 Dec 2017 04:01:06 -0500 (EST)

branch: mb-fix_compilation_error
commit abcd05dd2ae402b6169f996fda299a270dc64cd6
Author: Yves Renard <address@hidden>
Date:   Fri Dec 22 10:00:45 2017 +0100

    adding gmm_arch_config.h
---
 configure.ac      |  1 +
 extract_gmm++     | 45 ++++++++++++++++++++++++++++++++++++++++-----
 src/Makefile.am   |  1 +
 src/gmm/gmm_std.h |  4 ++--
 4 files changed, 44 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index 33bb880..afae287 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,6 +36,7 @@ AC_CONFIG_SRCDIR([install-sh])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADER(config.h)
 AX_PREFIX_CONFIG_H(src/getfem/getfem_arch_config.h,GETFEM) 
+AX_PREFIX_CONFIG_H(src/gmm/gmm_arch_config.h,GMM) 
 AC_PREREQ(2.61)
 AC_ARG_PROGRAM
 
diff --git a/extract_gmm++ b/extract_gmm++
index 2efdcfe..88f6429 100755
--- a/extract_gmm++
+++ b/extract_gmm++
@@ -60,7 +60,7 @@ print `cp -r $getfem_root/m4 $root`;
 
 open(F, ">$root/AUTHORS") or die "Open file impossible : $!\n";
 print F <<""
-Authors of GetFEM++\n
+Authors of GMM++\n
 Yves RENARD. Initial project. All the project.\n
 Julien POMMIER. All the project.\n
 
@@ -95,7 +95,7 @@ close(F);
 
 open(F, ">$root/include/Makefile.am") or die "Open file impossible : $!\n";
 print F <<""
-nobase_include_HEADERS=$gmm_files_bis
+nobase_include_HEADERS=$gmm_files_bis gmm/gmm_arch_config.h
 
 ;
 close(F);
@@ -125,6 +125,7 @@ CLEANFILES = so_locations\n
 ;
 close(F);
 
+
 open(F, ">$root/configure.ac") or die "Open file impossible : $!\n";
 print F <<""
 dnl Process this file with autoconf to produce a configure script.
@@ -136,8 +137,10 @@ dnl thus, updating cache ./config.cache avoided.
 define([AC_CACHE_LOAD], )dnl
 define([AC_CACHE_SAVE], )dnl\n
 AC_INIT(gmm, $MAJOR_VERSION.$MINOR_VERSION)
+AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADERS(config.h)
-AC_PREREQ(2.56)
+AX_PREFIX_CONFIG_H(src/gmm/gmm_arch_config.h,GMM)
+AC_PREREQ(2.61)
 AC_ARG_PROGRAM\n
 PACKAGE="gmm"
 MAJOR_VERSION="$MAJOR_VERSION"
@@ -239,6 +242,27 @@ dnl -Xc is for ansi conformance
         ;;
 esac\n
 AC_SUBST(SUPLDFLAGS)\n
+dnl ---------------------------OPENMP------------------------------
+useopenmp=0
+AC_ARG_ENABLE(openmp,
+   [AS_HELP_STRING([--enable-openmp],[enable the multithreaded version of 
GMM++])],
+   [ case \$enableval in
+        yes | "") useopenmp=YES ;;
+        no) useopenmp=NO ;;
+        *) AC_MSG_ERROR([bad value \${enableval} for --enable-openmp]) ;;
+     esac],
+   [useopenmp=NO]
+)
+if test x\$useopenmp = xYES; then
+  AC_OPENMP
+  if test "x\$ac_cv_prog_cxx_openmp" != "xunsupported" && test 
"x\$ac_cv_prog_cxx_openmp" != "x"; then
+    AC_SUBST(AM_CXXFLAGS,"\$OPENMP_CXXFLAGS")
+    CPPFLAGS="\$CPPFLAGS -DGMM_HAVE_OPENMP"
+  else
+    AC_MSG_ERROR([OpenMP support not found. Use --enable-openmp=no flag to 
compile GMM++ without OpenMP]);
+  fi
+fi;
+dnl ---------------------------END OF OPENMP-----------------------
 dnl ------------------------------------------------------------------------
 dnl   init libtools for shared libraries
 dnl ------------------------------------------------------------------------\n
@@ -271,11 +295,22 @@ chmod a+x gmm-config
 ;
 close(F);
 
+print `(cd $root && chmod a+x autogen.sh && ./autogen.sh)`;
+print `(cd $root && ./configure)`;
 
+open(F, ">$root/include/gmm/gmm_arch_config.h") or die "Open file impossible : 
$!\n";
+print F <<""
+#  ifndef _SRC_GMM_GMM_ARCH_CONFIG_H
+#define _SRC_GMM_GMM_ARCH_CONFIG_H 1
+// enable the following line for OpenMP support
+// #define GMM_HAVE_OPENMP
+//
+/* once: _SRC_GMM_GMM_ARCH_CONFIG_H */
+#endif
 
+;
+close(F);
 
-print `(cd $root && chmod a+x autogen.sh && ./autogen.sh)`;
-print `(cd $root && ./configure)`;
 print `(cd $root && make dist)`;
 print `(mv -f $root/gmm-*.tar.gz $getfem_root)`;
 `/bin/rm -fr $root`;
diff --git a/src/Makefile.am b/src/Makefile.am
index f995f55..d5700cf 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -19,6 +19,7 @@ nobase_include_HEADERS =                              \
        getfem_boost/workaround.hpp                     \
        getfem_boost/noncopyable.hpp                    \
        gmm/gmm.h                                       \
+       gmm/gmm_arch_config.h                           \
        gmm/gmm_matrix.h                                \
        gmm/gmm_iter_solvers.h                          \
        gmm/gmm_iter.h                                  \
diff --git a/src/gmm/gmm_std.h b/src/gmm/gmm_std.h
index 4d565e5..40d7d19 100644
--- a/src/gmm/gmm_std.h
+++ b/src/gmm/gmm_std.h
@@ -124,7 +124,7 @@ inline void GMM_NOPERATION_(int) { }
 #include <array>
 #include <locale.h>
 
-#include "getfem/getfem_arch_config.h"
+#include <gmm/gmm_arch_config.h>
 
 namespace std {
 #if defined(__GNUC__) && (__cplusplus <= 201103L)
@@ -174,7 +174,7 @@ namespace std {
 
 
 
-#ifdef GETFEM_HAVE_OPENMP
+#ifdef GMM_HAVE_OPENMP
 
 #include <omp.h>
        /**number of OpenMP threads*/



reply via email to

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