1# -*- shell-script -*-
2#
3# Copyright (c) 2004-2006 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
8#                         reserved.
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.
13# Copyright (c) 2008-2015 Cisco Systems, Inc.  All rights reserved.
14# Copyright (c) 2015-2017 Research Organization for Information Science
15#                         and Technology (RIST). All rights reserved.
16# $COPYRIGHT$
17#
18# Additional copyrights may follow
19#
20# $HEADER$
21#
22
23AC_DEFUN([MCA_ompi_io_romio321_POST_CONFIG], [
24    AM_CONDITIONAL([MCA_io_romio321_SHOULD_BUILD], [test $1 -eq 1])
25])
26
27
28# MCA_io_romio321_CONFIG([action-if-found], [action-if-not-found])
29# -----------------------------------------------------------
30AC_DEFUN([MCA_ompi_io_romio321_CONFIG],[
31    AC_CONFIG_FILES([ompi/mca/io/romio321/Makefile])
32
33    OPAL_VAR_SCOPE_PUSH([io_romio321_flags io_romio321_flags_define io_romio321_happy io_romio321_save_LIBS])
34    AC_ARG_ENABLE([io-romio],
35                  [AC_HELP_STRING([--disable-io-romio],
36                                  [Disable the ROMIO MPI-IO component])])
37    AC_ARG_WITH([io-romio-flags],
38                [AC_HELP_STRING([--with-io-romio-flags=FLAGS],
39                                [Pass FLAGS to the ROMIO distribution configuration script])])
40    AC_DEFINE_UNQUOTED([MCA_io_romio321_USER_CONFIGURE_FLAGS], ["$with_io_romio_flags"], [Set of user-defined configure flags given to ROMIOs configure script via --with-io-romio-flags])
41    AC_MSG_CHECKING([if want ROMIO component])
42    AS_IF([test "$enable_io_romio" = "no"],
43           [AC_MSG_RESULT([no])
44            $2],
45           [AC_MSG_RESULT([yes])
46            AC_MSG_CHECKING([if MPI profiling is enabled])
47            AS_IF([test "$enable_mpi_profile" = "no"],
48                  [AC_MSG_RESULT([no])
49                   AC_MSG_WARN([*** The ROMIO io component requires the MPI profiling layer])
50                   AS_IF([test "$enable_io_romio" = "yes"],
51                         [AC_MSG_ERROR([*** ROMIO requested but not available.  Aborting])])
52                   $2],
53                  [AC_MSG_RESULT([yes])
54
55                   AS_IF([test -n "$with_io_romio_flags" && test "$with_io_romio_flags" != "no"],
56                         [io_romio321_flags="$with_io_romio_flags $io_romio321_flags"],
57                         [io_romio321_flags=])
58                   # If ROMIO is going to end up in a DSO, all we need is
59                   # shared library-ized objects, as we're only building a
60                   # DSO (which is always shared).  Otherwise, build with
61                   # same flags as OMPI, as we might need any combination of
62                   # shared and static-ized objects...
63                   AS_IF([test "$compile_mode" = "dso"],
64                         [io_romio321_shared=enable
65                          io_romio321_static=disable],
66                         [AS_IF([test "$enable_shared" = "yes"],
67                                [io_romio321_shared=enable],
68                                [io_romio321_shared=disable])
69                          AS_IF([test "$enable_static" = "yes"],
70                                [io_romio321_static=enable],
71                                [io_romio321_static=disable])])
72                   AS_IF([test -n "$prefix" && test "$prefix" != "NONE"],
73                         [io_romio321_prefix_arg="--prefix=$prefix"],
74                         [io_romio321_prefix_arg=])
75
76                   AS_IF([test "$cross_compiling" = "yes"],
77                       [AS_IF([test ! -z $build], [io_romio321_flags="$io_romio321_flags --build=$build"])
78                        AS_IF([test ! -z $host], [io_romio321_flags="$io_romio321_flags --host=$host"])
79                        AS_IF([test ! -z $target], [io_romio321_flags="$io_romio321_flags --target=$target"])])
80                   AS_IF([test "$enable_grequest_extensions" = "yes"],
81                         [io_romio321_flags="$io_romio321_flags --enable-grequest-extensions"])
82                   io_romio321_flags_define="$io_romio321_flags FROM_OMPI=yes CC='$CC' CFLAGS='$CFLAGS -D__EXTENSIONS__' CPPFLAGS='$CPPFLAGS' FFLAGS='$FFLAGS' LDFLAGS='$LDFLAGS' --$io_romio321_shared-shared --$io_romio321_static-static $io_romio321_flags $io_romio321_prefix_arg --disable-aio --disable-weak-symbols --enable-strict --disable-f77 --disable-f90"
83                   AC_DEFINE_UNQUOTED([MCA_io_romio321_COMPLETE_CONFIGURE_FLAGS], ["$io_romio321_flags_define"], [Complete set of command line arguments given to ROMIOs configure script])
84
85                   io_romio321_flags="$io_romio321_flags FROM_OMPI=yes CC="'"'"$CC"'"'" CFLAGS="'"'"$CFLAGS -D__EXTENSIONS__"'"'" CPPFLAGS="'"'"$CPPFLAGS"'"'" FFLAGS="'"'"$FFLAGS"'"'" LDFLAGS="'"'"$LDFLAGS"'"'" --$io_romio321_shared-shared --$io_romio321_static-static $io_romio321_flags $io_romio321_prefix_arg --disable-aio --disable-weak-symbols --enable-strict --disable-f77 --disable-f90"
86
87                   opal_show_subtitle "Configuring ROMIO distribution"
88                   OPAL_CONFIG_SUBDIR([ompi/mca/io/romio321/romio],
89                                      [$io_romio321_flags],
90                                      [io_romio321_happy=1], [io_romio321_happy=0])
91
92                   AS_IF([test "$io_romio321_happy" = "1"],
93                         [ # grab the libraries list from ROMIO.  We don't
94                           # need this for building the component, as libtool
95                           # will figure that part out.  But we do need it for
96                           # the wrapper settings
97                          io_romio321_save_LIBS="$LIBS"
98                          LIBS=
99                          . ompi/mca/io/romio321/romio/localdefs
100                          io_romio321_LIBS="$LIBS"
101                          LIBS="$io_romio321_save_LIBS"
102
103                          echo "ROMIO distribution configured successfully"
104                          $1],
105                         [AS_IF([test "$enable_io_romio" = "yes"],
106                                [AC_MSG_ERROR([ROMIO distribution did not configure successfully])],
107                                [AC_MSG_WARN([ROMIO distribution did not configure successfully])])
108                          $2])])])
109    OPAL_VAR_SCOPE_POP
110])
111