1 dnl -*- shell-script -*-
3 dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
4 dnl University Research and Technology
5 dnl Corporation. All rights reserved.
6 dnl Copyright (c) 2004-2005 The University of Tennessee and The University
7 dnl of Tennessee Research Foundation. All rights
9 dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
10 dnl University of Stuttgart. All rights reserved.
11 dnl Copyright (c) 2004-2005 The Regents of the University of California.
12 dnl All rights reserved.
15 dnl Additional copyrights may follow
21 # OMPI_SETUP_WRAPPER_INIT()
22 # -------------------------
23 # Setup wrapper compiler configuration information - should be called
24 # before the bulk of the tests that can affect the wrapper compilers
26 # Note that we keep the user-specified flags seperately because we
27 # don't want them to go through OMPI_UNIQ because that has resulted in
28 # unexpected behavior for the user in the past.
29 AC_DEFUN([OMPI_SETUP_WRAPPER_INIT],[
30 WRAPPER_EXTRA_CPPFLAGS=
32 WRAPPER_EXTRA_CXXFLAGS=
34 WRAPPER_EXTRA_FCFLAGS=
35 WRAPPER_EXTRA_LDFLAGS=
38 USER_WRAPPER_EXTRA_CFLAGS=
39 USER_WRAPPER_EXTRA_CXXFLAGS=
40 USER_WRAPPER_EXTRA_FFLAGS=
41 USER_WRAPPER_EXTRA_FCFLAGS=
42 USER_WRAPPER_EXTRA_LDFLAGS=
43 USER_WRAPPER_EXTRA_LIBS=
45 AC_ARG_WITH([wrapper-cflags],
46 [AC_HELP_STRING([--with-wrapper-cflags],
47 [Extra flags to add to CFLAGS when using mpicc])])
48 if test "$with_wrapper_cflags" = "yes" -o "$with_wrapper_cflags" = "no"; then
49 AC_MSG_ERROR([--with-wrapper-cflags must have an argument. Aborting])
50 elif test ! -z "$with_wrapper_cflags" ; then
51 USER_WRAPPER_EXTRA_CFLAGS="$with_wrapper_cflags"
54 AC_ARG_WITH([wrapper-cxxflags],
55 [AC_HELP_STRING([--with-wrapper-cxxflags],
56 [Extra flags to add to CXXFLAGS when using mpiCC/mpic++])])
57 if test "$with_wrapper_cxxflags" = "yes" -o "$with_wrapper_cxxflags" = "no"; then
58 AC_MSG_ERROR([--with-wrapper-cxxflags must have an argument. Aborting])
59 elif test ! -z "$with_wrapper_cxxflags" ; then
60 USER_WRAPPER_EXTRA_CXXFLAGS="$with_wrapper_cxxflags"
63 AC_ARG_WITH([wrapper-fflags],
64 [AC_HELP_STRING([--with-wrapper-fflags],
65 [Extra flags to add to FFLAGS when using mpif77])])
66 if test "$with_wrapper_fflags" = "yes" -o "$with_wrapper_fflags" = "no"; then
67 AC_MSG_ERROR([--with-wrapper-fflags must have an argument. Aborting])
68 elif test ! -z "$with_wrapper_fflags" ; then
69 USER_WRAPPER_EXTRA_FFLAGS="$with_wrapper_fflags"
72 AC_ARG_WITH([wrapper-fcflags],
73 [AC_HELP_STRING([--with-wrapper-fcflags],
74 [Extra flags to add to FCFLAGS when using mpif90])])
75 if test "$with_wrapper_fcflags" = "yes" -o "$with_wrapper_fcflags" = "no"; then
76 AC_MSG_ERROR([--with-wrapper-fcflags must have an argument. Aborting])
77 elif test ! -z "$with_wrapper_fcflags" ; then
78 USER_WRAPPER_EXTRA_FCFLAGS="$with_wrapper_fcflags"
81 AC_ARG_WITH([wrapper-ldflags],
82 [AC_HELP_STRING([--with-wrapper-ldflags],
83 [Extra flags to add to LDFLAGS when using wrapper compilers])])
84 if test "$with_wrapper_ldflags" = "yes" -o "$with_wrapper_ldflags" = "no"; then
85 AC_MSG_ERROR([--with-wrapper-ldflags must have an argument. Aborting])
86 elif test ! -z "$with_wrapper_ldflags" ; then
87 USER_WRAPPER_EXTRA_LDFLAGS="$with_wrapper_ldflags"
90 AC_ARG_WITH([wrapper-libs],
91 [AC_HELP_STRING([--with-wrapper-libs],
92 [Extra flags to add to LIBS when using wrapper compilers])])
93 if test "$with_wrapper_libs" = "yes" -o "$with_wrapper_libs" = "no"; then
94 AC_MSG_ERROR([--with-wrapper-libs must have an argument. Aborting])
95 elif test ! -z "$with_wrapper_libs" ; then
96 USER_WRAPPER_EXTRA_LIBS="$with_wrapper_libs"
101 AC_DEFUN([OMPI_SETUP_WRAPPER_FINAL],[
102 OMPI_UNIQ([WRAPPER_EXTRA_CPPFLAGS])
103 OMPI_UNIQ([WRAPPER_EXTRA_CFLAGS])
104 OMPI_UNIQ([WRAPPER_EXTRA_CXXFLAGS])
105 OMPI_UNIQ([WRAPPER_EXTRA_FFLAGS])
106 OMPI_UNIQ([WRAPPER_EXTRA_FCFLAGS])
107 OMPI_UNIQ([WRAPPER_EXTRA_LDFLAGS])
112 OMPI_UNIQ([opal_WRAPPER_EXTRA_LDFLAGS])
113 OMPI_UNIQ([opal_WRAPPER_EXTRA_LIBS])
115 AC_MSG_CHECKING([for OPAL CPPFLAGS])
116 OPAL_WRAPPER_EXTRA_CPPFLAGS="$WRAPPER_EXTRA_CPPFLAGS $USER_WRAPPER_EXTRA_CPPFLAGS"
117 AC_SUBST([OPAL_WRAPPER_EXTRA_CPPFLAGS])
118 AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_CPPFLAGS])
120 AC_MSG_CHECKING([for OPAL CFLAGS])
121 OPAL_WRAPPER_EXTRA_CFLAGS="$WRAPPER_EXTRA_CFLAGS $USER_WRAPPER_EXTRA_CFLAGS"
122 AC_SUBST([OPAL_WRAPPER_EXTRA_CFLAGS])
123 AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_CFLAGS])
125 AC_MSG_CHECKING([for OPAL CXXFLAGS])
126 OPAL_WRAPPER_EXTRA_CXXFLAGS="$WRAPPER_EXTRA_CXXFLAGS $USER_WRAPPER_EXTRA_CXXFLAGS"
127 AC_SUBST([OPAL_WRAPPER_EXTRA_CXXFLAGS])
128 AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_CXXFLAGS])
130 AC_MSG_CHECKING([for OPAL LDFLAGS])
131 OPAL_WRAPPER_EXTRA_LDFLAGS="$opal_WRAPPER_EXTRA_LDFLAGS $WRAPPER_EXTRA_LDFLAGS $USER_WRAPPER_EXTRA_LDFLAGS"
132 AC_SUBST([OPAL_WRAPPER_EXTRA_LDFLAGS])
133 AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_LDFLAGS])
135 AC_MSG_CHECKING([for OPAL LIBS])
136 OPAL_WRAPPER_EXTRA_LIBS="$opal_WRAPPER_EXTRA_LIBS $WRAPPER_EXTRA_LIBS $USER_WRAPPER_EXTRA_LIBS"
137 AC_SUBST([OPAL_WRAPPER_EXTRA_LIBS])
138 AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_LIBS])
140 AC_MSG_CHECKING([for OPAL extra include dirs])
141 if test "$WANT_INSTALL_HEADERS" = "1" ; then
142 OPAL_WRAPPER_EXTRA_INCLUDES="openmpi"
144 OPAL_WRAPPER_EXTRA_INCLUDES=
146 AC_SUBST([OPAL_WRAPPER_EXTRA_INCLUDES])
147 AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_INCLUDES])
153 OMPI_UNIQ([orte_WRAPPER_EXTRA_LDFLAGS])
154 OMPI_UNIQ([orte_WRAPPER_EXTRA_LIBS])
156 AC_MSG_CHECKING([for ORTE CPPFLAGS])
157 ORTE_WRAPPER_EXTRA_CPPFLAGS="$OPAL_WRAPPER_EXTRA_CPPFLAGS"
158 AC_SUBST([ORTE_WRAPPER_EXTRA_CPPFLAGS])
159 AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_CPPFLAGS])
161 AC_MSG_CHECKING([for ORTE CFLAGS])
162 ORTE_WRAPPER_EXTRA_CFLAGS="$OPAL_WRAPPER_EXTRA_CFLAGS"
163 AC_SUBST([ORTE_WRAPPER_EXTRA_CFLAGS])
164 AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_CFLAGS])
166 AC_MSG_CHECKING([for ORTE CXXFLAGS])
167 ORTE_WRAPPER_EXTRA_CXXFLAGS="$OPAL_WRAPPER_EXTRA_CXXFLAGS"
168 AC_SUBST([ORTE_WRAPPER_EXTRA_CXXFLAGS])
169 AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_CXXFLAGS])
171 AC_MSG_CHECKING([for ORTE LDFLAGS])
172 ORTE_WRAPPER_EXTRA_LDFLAGS="$orte_WRAPPER_EXTRA_LDFLAGS $OPAL_WRAPPER_EXTRA_LDFLAGS"
173 AC_SUBST([ORTE_WRAPPER_EXTRA_LDFLAGS])
174 AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_LDFLAGS])
176 AC_MSG_CHECKING([for ORTE LIBS])
177 ORTE_WRAPPER_EXTRA_LIBS="$orte_WRAPPER_EXTRA_LIBS $OPAL_WRAPPER_EXTRA_LIBS"
178 AC_SUBST([ORTE_WRAPPER_EXTRA_LIBS])
179 AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_LIBS])
181 AC_MSG_CHECKING([for ORTE extra include dirs])
182 ORTE_WRAPPER_EXTRA_INCLUDES="$OPAL_WRAPPER_EXTRA_INCLUDES"
183 AC_SUBST([ORTE_WRAPPER_EXTRA_INCLUDES])
184 AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_INCLUDES])
190 OMPI_UNIQ([ompi_WRAPPER_EXTRA_LDFLAGS])
191 OMPI_UNIQ([ompi_WRAPPER_EXTRA_LIBS])
193 AC_MSG_CHECKING([for OMPI CPPFLAGS])
194 OMPI_WRAPPER_EXTRA_CPPFLAGS="$ORTE_WRAPPER_EXTRA_CPPFLAGS"
195 AC_SUBST([OMPI_WRAPPER_EXTRA_CPPFLAGS])
196 AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CPPFLAGS])
198 AC_MSG_CHECKING([for OMPI CFLAGS])
199 OMPI_WRAPPER_EXTRA_CFLAGS="$ORTE_WRAPPER_EXTRA_CFLAGS"
200 AC_SUBST([OMPI_WRAPPER_EXTRA_CFLAGS])
201 AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CFLAGS])
203 AC_MSG_CHECKING([for OMPI CXXFLAGS])
204 OMPI_WRAPPER_EXTRA_CXXFLAGS="$ORTE_WRAPPER_EXTRA_CXXFLAGS"
205 AC_SUBST([OMPI_WRAPPER_EXTRA_CXXFLAGS])
206 AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CXXFLAGS])
208 AC_MSG_CHECKING([for OMPI FFLAGS])
209 OMPI_WRAPPER_EXTRA_FFLAGS="$WRAPPER_EXTRA_FFLAGS $USER_WRAPPER_EXTRA_FFLAGS"
210 AC_SUBST([OMPI_WRAPPER_EXTRA_FFLAGS])
211 AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_FFLAGS])
213 AC_MSG_CHECKING([for OMPI FCFLAGS])
214 OMPI_WRAPPER_EXTRA_FCFLAGS="$WRAPPER_EXTRA_FCFLAGS $USER_WRAPPER_EXTRA_FCFLAGS"
215 AC_SUBST([OMPI_WRAPPER_EXTRA_FCFLAGS])
216 AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_FCFLAGS])
218 AC_MSG_CHECKING([for OMPI LDFLAGS])
219 OMPI_WRAPPER_EXTRA_LDFLAGS="$ompi_WRAPPER_EXTRA_LDFLAGS $ORTE_WRAPPER_EXTRA_LDFLAGS"
220 AC_SUBST([OMPI_WRAPPER_EXTRA_LDFLAGS])
221 AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_LDFLAGS])
223 AC_MSG_CHECKING([for OMPI LIBS])
224 OMPI_WRAPPER_EXTRA_LIBS="$ompi_WRAPPER_EXTRA_LIBS $ORTE_WRAPPER_EXTRA_LIBS"
225 AC_SUBST([OMPI_WRAPPER_EXTRA_LIBS])
226 AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_LIBS])
228 AC_MSG_CHECKING([for OMPI extra include dirs])
229 if test "$WANT_INSTALL_HEADERS" = "1" ; then
230 # Always include openmpi in case C++ bindings get installed
231 OMPI_WRAPPER_EXTRA_INCLUDES="$ORTE_WRAPPER_EXTRA_INCLUDES"
233 OMPI_WRAPPER_EXTRA_INCLUDES="$ORTE_WRAPPER_EXTRA_INCLUDES openmpi"
235 AC_SUBST([OMPI_WRAPPER_EXTRA_INCLUDES])
236 AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_INCLUDES])
238 # language binding support. C++ is a bit different, as the
239 # compiler should work even if there is no language support.
240 if test "$WANT_MPI_CXX_SUPPORT" = "1" ; then
241 OMPI_WRAPPER_CXX_LIB="-lmpi_cxx"
242 OMPI_WRAPPER_CXX_REQUIRED_FILE="libmpi_cxx.la"
244 OMPI_WRAPPER_CXX_LIB=""
245 OMPI_WRAPPER_CXX_REQUIRED_FILE=""
247 AC_SUBST([OMPI_WRAPPER_CXX_LIB])
248 AC_SUBST([OMPI_WRAPPER_CXX_REQUIRED_FILE])
250 if test "$OMPI_WANT_F77_BINDINGS" = "1" ; then
251 OMPI_WRAPPER_F77_REQUIRED_FILE=""
253 OMPI_WRAPPER_F77_REQUIRED_FILE="not supported"
255 AC_SUBST([OMPI_WRAPPER_F77_REQUIRED_FILE])
257 if test "$OMPI_WANT_F90_BINDINGS" = "1" ; then
258 OMPI_WRAPPER_F90_REQUIRED_FILE="libmpi_f90.a"
260 OMPI_WRAPPER_F90_REQUIRED_FILE="not supported"
262 AC_SUBST([OMPI_WRAPPER_F90_REQUIRED_FILE])
265 # compatibility defines that will eventually go away
266 WRAPPER_EXTRA_CFLAGS="$OMPI_WRAPPER_EXTRA_CFLAGS"
267 WRAPPER_EXTRA_CXXFLAGS="$OMPI_WRAPPER_EXTRA_CXXFLAGS"
268 WRAPPER_EXTRA_FFLAGS="$OMPI_WRAPPER_EXTRA_FFLAGS"
269 WRAPPER_EXTRA_FCFLAGS="$OMPI_WRAPPER_EXTRA_FCFLAGS"
270 WRAPPER_EXTRA_LDFLAGS="$OMPI_WRAPPER_EXTRA_LDFLAGS"
271 WRAPPER_EXTRA_LIBS="$OMPI_WRAPPER_EXTRA_LIBS"
273 AC_SUBST(WRAPPER_EXTRA_CFLAGS)
274 AC_SUBST(WRAPPER_EXTRA_CXXFLAGS)
275 AC_SUBST(WRAPPER_EXTRA_FFLAGS)
276 AC_SUBST(WRAPPER_EXTRA_FCFLAGS)
277 AC_SUBST(WRAPPER_EXTRA_LDFLAGS)
278 AC_SUBST(WRAPPER_EXTRA_LIBS)
280 AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CFLAGS, "$WRAPPER_EXTRA_CFLAGS",
281 [Additional CFLAGS to pass through the wrapper compilers])
282 AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CXXFLAGS, "$WRAPPER_EXTRA_CXXFLAGS",
283 [Additional CXXFLAGS to pass through the wrapper compilers])
284 AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_FFLAGS, "$WRAPPER_EXTRA_FFLAGS",
285 [Additional FFLAGS to pass through the wrapper compilers])
286 AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_FCFLAGS, "$WRAPPER_EXTRA_FCFLAGS",
287 [Additional FCFLAGS to pass through the wrapper compilers])
288 AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_LDFLAGS, "$WRAPPER_EXTRA_LDFLAGS",
289 [Additional LDFLAGS to pass through the wrapper compilers])
290 AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_LIBS, "$WRAPPER_EXTRA_LIBS",
291 [Additional LIBS to pass through the wrapper compilers])