Changeset 2f6525


Ignore:
Timestamp:
May 24, 2008, 12:32:32 PM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
35051f
Parents:
44fa6a
Message:

new MPI autoconf macro installed and changed lines in configure.ac

MPICC was set to CC which caused trouble, when different gcc version had to be used (core2 optimization). As standard mpicc is just a link to gcc with mpi headers included, in the new manner, this can easily be acounted for

Location:
pcp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pcp/configure.ac

    r44fa6a r2f6525  
    2121dnl Check for MPI-Routines
    2222AC_ARG_ENABLE([mpi],
    23               AS_HELP_STRING([--enable-mpi],[build MPI parallel version (default is yes if MPI code can be compiled)]),
    24               [enable_mpi=$enableval], [enable_mpi=maybe])
     23              AC_HELP_STRING([--enable-mpi],
     24                             [build MPI parallel version
     25                              (default is yes if MPI code can be compiled)]),
     26              [enable_mpi=$enableval], [enable_mpi=maybe])
    2527disabled_msg="MPI version disabled."
    2628if test x"$enable_mpi" = xyes -o x"$enable_mpi" = xmaybe
    2729then
    28         AC_MSG_NOTICE([checking for MPI features])
    29         ACX_MPI([enable_mpi=yes
    30                  CC=mpicc
    31                  CXX=mpicxx],
    32                 [err_msg="cannot find out how to compile MPI code."
    33                  if test x"$enable_mpi" = xyes
    34                  then
    35                          AC_MSG_ERROR([$err_msg])
    36                  else
    37                          AC_MSG_WARN([$err_msg $disabled_msg])
    38                          enable_mpi=no
    39                  fi])
     30        AC_MSG_NOTICE([checking for MPI features])
     31        ACX_MPI([enable_mpi=yes],
     32                [err_msg="cannot find out how to compile MPI code."
     33                 if test x"$enable_mpi" = xyes
     34                 then
     35                         AC_MSG_ERROR([$err_msg])
     36                 else
     37                         AC_MSG_WARN([$err_msg $disabled_msg])
     38                         enable_mpi=no
     39                 fi])
    4040else
    41         AC_MSG_NOTICE([$disabled_msg])
     41        AC_MSG_NOTICE([$disabled_msg])
    4242fi
    43 #AC_ARG_VAR([MPILIBS],[necessary libraries to link MPI C code])
     43AC_ARG_VAR([MPILIBS],[necessary libraries to link MPI C code])
     44AC_ARG_VAR([MPICC],[necessary comnpiler for MPI C code])
    4445AM_CONDITIONAL([MPIVER], [test x"$enable_mpi" = xyes])
    4546
  • pcp/m4/acx_mpi.m4

    r44fa6a r2f6525  
    2525dnl the default action will define HAVE_MPI.
    2626dnl
    27 dnl @version $Id: acx_mpi.m4,v 1.1.1.1 2007-09-03 16:17:11 heber Exp $
    28 dnl @author Steven G. Johnson <address@hidden>
     27dnl @version $Id: acx_mpi.m4,v 1.2 2004-01-02 14:51:12 wildenhu Exp $
     28dnl @author Steven G. Johnson <stevenj@alum.mit.edu>
    2929
    3030AC_DEFUN([ACX_MPI], [
     
    3434        AC_REQUIRE([AC_PROG_CC])
    3535        AC_ARG_VAR(MPICC,[MPI C compiler command])
    36         AC_CHECK_PROGS(MPICC, mpicc hcc mpcc mpcc_r mpxlc cmpicc, $CC)
     36        AC_CHECK_PROGS(MPICC, mpicc hcc mpcc mpcc_r mpxlc, $CC)
    3737        acx_mpi_save_CC="$CC"
    3838        CC="$MPICC"
     
    4242        AC_REQUIRE([AC_PROG_CXX])
    4343        AC_ARG_VAR(MPICXX,[MPI C++ compiler command])
    44         AC_CHECK_PROGS(MPICXX, mpic++ mpiCC mpCC hcp mpxlC mpxlC_r cmpic++, $CXX)
     44        AC_CHECK_PROGS(MPICXX, mpiCC mpCC hcp mpic++, $CXX)
    4545        acx_mpi_save_CXX="$CXX"
    4646        CXX="$MPICXX"
     
    5050        AC_REQUIRE([AC_PROG_F77])
    5151        AC_ARG_VAR(MPIF77,[MPI Fortran compiler command])
    52         AC_CHECK_PROGS(MPIF77, mpif77 hf77 mpxlf mpf77 mpif90 mpf90 mpxlf90 mpxlf95 mpxlf_r cmpifc cmpif90c, $F77)
     52        AC_CHECK_PROGS(MPIF77, mpif77 hf77 mpxlf mpf77 mpif90 mpf90 mpxlf90 mpxlf95 mpxlf_r, $F77)
    5353        acx_mpi_save_F77="$F77"
    5454        F77="$MPIF77"
     
    8282                AC_MSG_RESULT(no)])
    8383fi])
     84dnl There are b0rked implementations that '#define main mpi_main' in their mpi.h
     85dnl which will cause all tests above to fail miserably (e.g. MPICH-SCore).
     86dnl TODO: prototype checking, exit instead of return from main, test C++, implement F77.
     87dnl TODO: use the information already gathered...
     88if test x = x"$MPILIBS"; then
     89        AC_MSG_CHECKING([for last resort: compile and link a small MPI test program])
     90        AC_LANG_CASE([C], [AC_LINK_IFELSE([#include <mpi.h>
     91int main(int argc, char **argv)
     92{
     93  MPI_Init(&argc, &argv);
     94  return 0;
     95}
     96                        ], [MPILIBS=" "
     97                AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])],
     98                [C++], [AC_LINK_IFELSE([#include <mpi.h>
     99int main(int argc, char **argv)
     100{
     101  MPI_Init(&argc, &argv);
     102  return 0;
     103}
     104                        ], [MPILIBS=" "
     105                AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])],
     106                [Fortran 77], [])
     107fi
    84108
    85109AC_LANG_CASE([C], [CC="$acx_mpi_save_CC"],
Note: See TracChangeset for help on using the changeset viewer.