-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcit_adios2.m4
71 lines (61 loc) · 2.04 KB
/
cit_adios2.m4
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
# -*- Autoconf -*-
# ======================================================================
# Autoconf macros for ADIOS2.
# ======================================================================
# ----------------------------------------------------------------------
# CIT_ADIOS2_CONFIG
# ----------------------------------------------------------------------
AC_DEFUN([CIT_ADIOS2_CONFIG], [
dnl ADIOS 2.x comes with a program that *should* tell us how to link with it.
AC_ARG_VAR([ADIOS2_CONFIG], [Path to adios_config program that indicates how to compile with it.])
AC_PATH_PROG([ADIOS2_CONFIG], [adios2-config])
if test "x$ADIOS2_CONFIG" = "x"; then
AC_MSG_ERROR([adios2-config program not found; try setting ADIOS2_CONFIG to point to it])
fi
AC_LANG_PUSH([Fortran])
FC_save="$FC"
FCFLAGS_save="$FCFLAGS"
LIBS_save="$LIBS"
FC="$MPIFC" dnl Must use mpi compiler.
dnl First check for directory with ADIOS2 modules
AC_MSG_CHECKING([for ADIOS2 modules])
ADIOS2_FCFLAGS=`$ADIOS2_CONFIG --fortran-flags`
FCFLAGS="$ADIOS2_FCFLAGS $FCFLAGS"
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([], [[
use adios2
type(adios2_adios) :: adios
]])
], [
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
AC_MSG_ERROR([ADIOS2 modules not found; is ADIOS2 built with Fortran support for this compiler?])
])
dnl Now check for libraries that must be linked.
AC_MSG_CHECKING([for ADIOS2 libraries])
FCFLAGS="$ADIOS2_FCFLAGS $FCFLAGS_save"
ADIOS2_LIBS=`$ADIOS2_CONFIG --fortran-libs`
LIBS="$ADIOS2_LIBS $LIBS"
AC_LINK_IFELSE([
AC_LANG_PROGRAM([], [[
use adios2
type(adios2_adios) :: adios
type(adios2_io) :: io
integer :: ierr
call adios2_declare_io(io, adios, "testIO", ierr)
]])
], [
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
AC_MSG_ERROR([ADIOS2 libraries not found.])
])
FC="$FC_save"
FCFLAGS="$FCFLAGS_save"
LIBS="$LIBS_save"
AC_LANG_POP([Fortran])
AC_SUBST([ADIOS2_FCFLAGS])
AC_SUBST([ADIOS2_LIBS])
])dnl CIT_ADIOS2_CONFIG
dnl end of file