File: mpi.m4

package info (click to toggle)
adolc 2.7.2-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,496 kB
  • sloc: cpp: 40,481; ansic: 19,390; sh: 4,277; makefile: 551; python: 486
file content (102 lines) | stat: -rw-r--r-- 2,346 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
AC_DEFUN([MPI_CONF_PRE],
[
AC_PREREQ(2.59)

# MPI root directory
AC_ARG_WITH(mpi_root,
[AC_HELP_STRING([--with-mpi-root=MPIROOT],
		[absolute path to the MPI root directory])])

if test x"$with_mpi_root" != "x"; 
then 
  if test x"$adolc_ampi_support" = "xno";
  then 
    AC_MSG_ERROR([if --with-mpi-root is set one  must also --enable_ampi])
  fi
  MPIROOT="$with_mpi_root"
fi

AC_ARG_WITH(mpicc,
[AC_HELP_STRING([--with-mpicc=MPICC],
		[name of the MPI C++ compiler to use (default mpicc)])])

if test x"$with_mpicc" != "x"; 
then 
  if test x"$adolc_ampi_support" = "xno" && test x"$adolc_medipack_support" = "xno";
  then 
    AC_MSG_ERROR([if --with-mpicc is set one  must also --enable-ampi])
  fi
  MPICC="$with_mpicc"
else 
  MPICC="mpicc"
fi

if test x"$with_mpi_root" != "x"; 
then 
  MPICC="$with_mpi_root/bin/$MPICC"
fi


AC_ARG_WITH(mpicxx,
[AC_HELP_STRING([--with-mpicxx=MPICXX],
		[name of the MPI C++ compiler to use (default mpicxx)])])

if test x"$with_mpicxx" != "x"; 
then 
  if test x"$adolc_ampi_support" = "xno" && test x"$adolc_medipack_support" = "xno";
  then 
    AC_MSG_ERROR([if --with-mpicxx is set one  must also --enable-ampi])
  fi
  MPICXX="$with_mpicxx"
else 
  MPICXX="mpicxx"
fi

if test x"$with_mpi_root" != "x"; 
then 
  MPICXX="$with_mpi_root/bin/$MPICXX"
fi

saveCC="$CC"
saveCXX="$CXX"
AC_SUBST(saveCC)
AC_SUBST(saveCXX)

if test x"$adolc_ampi_support" = "xyes" || test x"$adolc_medipack_support" = "xyes";
then
  CC="$MPICC"
  CXX="$MPICXX"
fi

])

AC_DEFUN([MPI_CONF_POST],
[
AC_PREREQ(2.59)

if test x"$adolc_ampi_support" = "xyes" || test x"$adolc_medipack_support" = "xyes";
then

  AC_MSG_CHECKING([Linking of MPI C programs])
  AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <mpi.h>],
               [MPI_Init(0,0)])],
               [AC_MSG_RESULT([ok])],
               [AC_MSG_RESULT([no])
               AC_MSG_FAILURE([MPI C compiler is required by $PACKAGE])])

fi

if test x"$adolc_ampi_support" = "xyes" || test x"$adolc_medipack_support" = "xyes";
then 

  AC_LANG_PUSH([C++])
  AC_MSG_CHECKING([Linking of MPI C++ programs])
  AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <mpi.h>],
               [MPI_Init(0,0)])],
               [AC_MSG_RESULT([ok])],
               [AC_MSG_RESULT([no])
               AC_MSG_FAILURE([MPI C++ compiler is required by $PACKAGE])])
  AC_LANG_POP([C++])
fi

])