[MOAB-dev] r3890 - MOAB/trunk/config

iulian at mcs.anl.gov iulian at mcs.anl.gov
Wed May 12 17:31:00 CDT 2010


Hi Jason,
With these latest changes, MOAB compiles fine for me. 
Thank you,
Iulian

----- Original Message -----
From: kraftche at cae.wisc.edu
To: moab-dev at mcs.anl.gov
Sent: Wednesday, May 12, 2010 5:08:09 PM GMT -06:00 US/Canada Central
Subject: [MOAB-dev] r3890 - MOAB/trunk/config

Author: kraftche
Date: 2010-05-12 17:08:09 -0500 (Wed, 12 May 2010)
New Revision: 3890

Modified:
   MOAB/trunk/config/compiler.m4
Log:
Fix previous checkin.  Do same changes differently to work around autoconf issues.


Autoconf issues:
  o AC_PROG_CC, AC_PROG_CXX, etc. cannot be specified more than once
    in the configure script.  For example, the following:
       if test "$myvar" = "yes"; then 
         AC_PROG_CC
       else
         AC_PROG_CC
       fi
    will result in a broken configure if myvar != yes.
    Sometimes autoconf is just bizare.
  
  o AC_PROG_CC, AC_PROG_CXX, etc. cannot be called with an
    empty list.  They can be called with no arguments at all,
    though.  E.g. 'AC_PROG_CC' works fine, as does
    'AC_PROG_CC([gcc cc])', but 'myvar=; AC_PROG_CC([$myvar])'
    will not work.
  
  o If AC_CHECK_PROGS is used to set the value of $CC, then
    some autoconf macros will use that value even if $CC is
    modified immediately after the call to AC_CHECK_PROGS.
    This does not appear to be the case for any variables other
    than $CC



Modified: MOAB/trunk/config/compiler.m4
===================================================================
--- MOAB/trunk/config/compiler.m4	2010-05-12 21:48:43 UTC (rev 3889)
+++ MOAB/trunk/config/compiler.m4	2010-05-12 22:08:09 UTC (rev 3890)
@@ -14,6 +14,31 @@
   rm .tmp
 ])
 
+
+########## Helper function for FATHOM_CHECK_COMPILERS #############
+# args: compiler variable, compiler list, path
+AC_DEFUN([FATHOM_SET_MPI_COMPILER], [
+  if test "x" = "x${$1}"; then
+    if test "x" = "x$3"; then
+      AC_CHECK_PROGS([$1], [$2], [false])
+    else
+      $1=false
+      for prog in $2 ; do
+        if test -x "$3/$prog"; then
+          $1="$3/$prog"
+          AC_SUBST($1)
+          export $1
+          break
+        fi
+      done
+    fi
+    
+    if test "x${$1}" = "xfalse"; then
+      AC_MSG_ERROR([Cannot find MPI compiler.  Try specifying \$$1])
+    fi
+  fi
+])
+
 #######################################################################################
 # Implement checks for C and C++ compilers, with all corresponding options
 #
@@ -52,91 +77,38 @@
   # Need to check this early so we can look for the correct compiler
 AC_ARG_WITH( [mpi], AC_HELP_STRING([[--with-mpi(=DIR)]], [Enable parallel support]),
              [WITH_MPI=$withval],[WITH_MPI=no] )
-case "x$WITH_MPI" in
-  xno)
-    CC_LIST=
-    CXX_LIST=
-    FC_LIST=
-    F77_LIST=
-    ;;
-  xyes)
-    CC_LIST="mpicc mpcc"
-    CXX_LIST="mpiCC mpCC mpicxx"
-    FC_LIST="mpif90"


More information about the moab-dev mailing list