3 # Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
4 # University Research and Technology
5 # Corporation. All rights reserved.
6 # Copyright (c) 2004-2005 The University of Tennessee and The University
7 # of Tennessee Research Foundation. All rights
9 # Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
10 # University of Stuttgart. All rights reserved.
11 # Copyright (c) 2004-2005 The Regents of the University of California.
12 # All rights reserved.
15 # Additional copyrights may follow
20 # OMPI_CHECK_XCPU(prefix, [action-if-found], [action-if-not-found])
21 # --------------------------------------------------------
22 AC_DEFUN([OMPI_CHECK_XCPU],[
24 [AC_HELP_STRING([--with-xcpu],
25 [Path to xcpu installation])])
27 AS_IF([test "$with_xcpu" = "no"],[$3], [
28 ompi_check_xcpu_save_CPPFLAGS="$CPPFLAGS"
29 ompi_check_xcpu_save_LDFLAGS="$LDFLAGS"
30 ompi_check_xcpu_save_LIBS="$LIBS"
32 AS_IF([test ! -z "$with_xcpu" -a "$with_xcpu" != "yes"],
33 [CPPFLAGS="$CPPFLAGS -I$with_xcpu/include"
34 LDFLAGS="$LDFLAGS -L$with_xcpu/lib"])
35 AC_CHECK_HEADERS([sys/xcpu.h],
38 [ompi_check_xcpu_works="yes"],
39 [ompi_check_xcpu_works="no"])],
42 [ompi_check_xcpu_works="yes"],
43 [ompi_check_xcpu_works="no"])])
44 # check for library irrespective of if xcpu.h is there or not
45 # 'cause I am not sure
46 # if we need to check for xcpu.h
48 CPPFLAGS="$ompi_check_xcpu_save_CPPFLAGS"
49 LDFLAGS="$ompi_check_xcpu_save_LDFLAGS"
50 LIBS="$ompi_check_xcpu_save_LIBS"
52 AS_IF([test "$ompi_check_xcpu_works" = "yes"],
53 [AS_IF([test ! -z "$with_xcpu" -a "$with_xcpu" != "yes"],
54 [$1_CPPFLAGS="$$1_CPPFLAGS -I$with_xcpu/include"
55 $1_LDFLAGS="$$1_LDFLAGS -L$with_xcpu/lib"])
56 $1_LIBS="$$1_LIBS -lxcpu"
58 [AS_IF([test ! -z "$with_xcpu"],
59 [AC_MSG_ERROR([xcpu support requested but not found. Perhaps you need to specify the location of the xcpu libraries.])])