[Genabel-commits] r1849 - pkg/OmicABELnoMM

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Oct 26 22:51:41 CET 2014


Author: lckarssen
Date: 2014-10-26 22:51:40 +0100 (Sun, 26 Oct 2014)
New Revision: 1849

Modified:
   pkg/OmicABELnoMM/configure.ac
Log:
Added a check for an MPI compiler in OmicABELnoMM's configure.ac. Also added an option to so that the user can ask explicitly to use MPI (./configure --with-mpi) or explicitly disable use of MPI even if compilers are found (./configure --without-mpi) if neither the --with or --without option is specified, ./configure will try to locate an MPI compiler and if that fails, it will continue without.

Based on the results of this check, the variable USE_MPI is set to "yes" and passed to Automake for use during compilation and in the source code (usinf #ifdef).


NOTE for developers: The AX_PROG_CXX_MPI Autoconf macro is not part of the default Autoconf installation. It can be downloaded from the GNU Autoconf Archive: http://www.gnu.org/software/autoconf-archive/ or installed via the package manager of most Linux distributions, e.g. in Debian and its derivatives the package is called 'autoconf-archive'.


Modified: pkg/OmicABELnoMM/configure.ac
===================================================================
--- pkg/OmicABELnoMM/configure.ac	2014-10-24 13:31:20 UTC (rev 1848)
+++ pkg/OmicABELnoMM/configure.ac	2014-10-26 21:51:40 UTC (rev 1849)
@@ -31,12 +31,36 @@
 # If CXXFLAGS/CPPFLAGS are already set AC_PROG_CXX will not overwrite them
 # with its own defaults
 
-# Checks for programs.
-#AC_PROG_CC
-#AC_PROG_CXX
-AC_PROG_CXX([mpic++ mpicxx])
 
+# If --with-mpi=auto is used, try to find MPI, but use standard C
+#  compiler if it is not found.
+# If --with-mpi=yes is used, try to find MPI and fail if it isn't found.
+# If --with-mpi=no is used, use a standard C compiler instead.
+AC_ARG_WITH(mpi,
+   [AS_HELP_STRING([--with-mpi],
+      [compile with MPI (shared memory parallelization) support. If\
+none is found, MPI is not used. Default: auto])
+   ]
+   ,
+   ,
+   [with_mpi=auto])
 
+# AC_PROG_CXX_MPI will run AC_PROG_CXX if no MPI compiler can be found.
+AX_PROG_CXX_MPI([test "x$with_mpi" != "xno"],
+   [use_mpi=yes],
+   [use_mpi=no
+    if test "x$with_mpi" = "xyes"; then
+       AC_MSG_FAILURE([MPI compiler requested, but couldn't find MPI.])
+    elif test "x$with_mpi" = "xauto"; then
+       AC_MSG_NOTICE([No MPI compiler found, continuing without MPI.])
+    else
+       AC_MSG_NOTICE([Use of MPI disabled by user.])
+    fi]
+)
+
+AM_CONDITIONAL([USE_MPI], test "x$use_mpi" = "xyes")
+
+
 # Check for openMP. If found the OPENMP_CXXFLAGS is set automatically
 AC_OPENMP
 AC_SUBST(AM_CXXFLAGS, "$OPENMP_CFLAGS")



More information about the Genabel-commits mailing list