-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathconfigure.ac
134 lines (109 loc) · 4.15 KB
/
configure.ac
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# -*- mode: shell-script-mode -*-
#
# Copyright (c) 2014-2018 Los Alamos National Security, LLC. All rights
# reserved.
# Copyright (c) 2019 Triad National Security, LLC. All rights
# reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
AC_PREREQ([2.69])
AC_INIT([libhio], [1.4.1.3], [hjelmn@lanl.gov])
AC_CONFIG_SRCDIR([src/hio_context.c])
AC_CONFIG_HEADERS([src/include/hio_config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CHECK_PROG(MPICC, [mpicc], [mpicc], [none])
AC_CHECK_PROG(MPICXX, [mpicxx], [mpicxx], [none])
AM_SILENT_RULES([yes])
hio_use_mpi=0
if ( test -n "$XTOS_VERSION" || test -n "$CRAYPE_DIR" ) && (test -z $CC || test "$CC" = cc) ; then
# Work around Cray idiosyncrasies
# Don't let the Cray wrapper bring in extra crap
PE_VERSION=`echo $XTOS_VERSION | sed 's/\..*//g'`
# force the cray wrappers to act in a predictable way
if test x$PE_VERSION = x4 ; then
CC="cc -target=native -dynamic"
CXX="CC -target=native -dynamic"
else
CC="cc --cray-bypass-pkgconfig -dynamic"
CXX="CC --cray-bypass-pkgconfig -dynamic"
fi
# We may be cross-compiling so trick configure
cross_compiling=yes
if test ! -n "$LD" ; then
LD=ld
fi
elif test ! "$MPICC" = "none" ; then
CC=${MPICC}
CXX=${MPICXX}
hio_use_mpi=1
fi
AM_INIT_AUTOMAKE([serial-tests])
LT_INIT
AC_ARG_ENABLE([tests], [AC_HELP_STRING([--enable-tests],
[Enable hio tests @<:@default=yes@:>@])],
[hio_enable_tests=$enable_tests],[hio_enable_tests=$enable_static])
if test $hio_enable_tests = yes && test "x$enable_static" = "xno" ; then
AC_ERROR([Must have static libraries enabled to enable unit tests])
fi
HIO_CHECK_JSON
HIO_CHECK_DATAWARP
HIO_CHECK_XPMEM
HIO_CHECK_CVERSION
HIO_CHECK_BZ2
if test $hio_use_mpi = 0 ; then
AC_MSG_CHECKING([for craypich])
if test -n "$CRAY_MPICH2_DIR" ; then
AC_MSG_RESULT([yes])
CPPFLAGS="$CPPFLAGS -I$CRAY_MPICH2_DIR/include"
LDFLAGS="$LDFLAGS -L$CRAY_MPICH2_DIR/lib"
LIBS="$LIBS -lmpich"
hio_use_mpi=1
else
AC_MSG_RESULT([no])
fi
fi
if test $hio_use_mpi ; then
HIO_CHECK_MPI_FEATURES
fi
#Check for HDF5
HIO_CHECK_HDF5
# Checks for programs.
AC_PROG_CC_C99
AC_PROG_LEX
AC_ARG_VAR([HAVE_PDFLATEX], [Whether pdflatex exists and is executable])
AC_CHECK_PROG([HAVE_PDFLATEX], [pdflatex], [yes], [no])
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADERS_ONCE([strings.h sys/types.h sys/time.h pthread.h dlfcn.h sys/stat.h \
sys/param.h sys/mount.h sys/vfs.h bzlib.h AvailabilityMacros.h])
AC_CHECK_FUNCS_ONCE([access gettimeofday stat statfs MPI_Win_allocate_shared \
MPI_Comm_split_type MPI_Win_flush clock_gettime])
AC_SEARCH_LIBS([dlopen],[dl],[hio_dynamic_component=1],[hio_dynamic_component=0])
AC_SEARCH_LIBS([floor],[m],[],[AC_ERROR([Could not find math libraries])])
AX_PTHREAD([])
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
#Check for LUSTRE
HIO_CHECK_LUSTRE
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_TYPE_INT64_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_DEFINE_UNQUOTED([HIO_USE_MPI], [$hio_use_mpi], [Whether to use mpi with hio])
AC_DEFINE_UNQUOTED([USE_DYNAMIC_COMPONENTS], [$hio_dynamic_component], [Whether to use dynamic components])
AC_DEFINE([_GNU_SOURCE], [1], [Define _GNU_SOURCE feature macro])
AC_DEFINE_UNQUOTED([HIO_PREFIX], ["$prefix"], [HIO install prefix])
AM_CONDITIONAL([HAVE_PDFLATEX], [test $HAVE_PDFLATEX = yes])
AM_CONDITIONAL([HAVE_MPI], [test $hio_use_mpi = 1])
AM_CONDITIONAL([ENABLE_TESTS], [test $hio_enable_tests = yes])
AC_SUBST([HIO_PKGCONFIG_REQUIRES], [$hio_pkgconfig_requires])
AC_SUBST(HIO_BUILD_TIMESTAMP,[$(date "+%A %B %d, %Y at %l:%M %p %Z")])
# Checks for library functions.
AC_CONFIG_FILES([Makefile design/Makefile src/Makefile test/Makefile test/xexec/Makefile tools/Makefile libhio.pc design/doxygen.conf design/template/header.tex hdf5-hio/Makefile hdf5-hio/src/Makefile hdf5-hio/test/Makefile hdf5-hio/doc/Makefile hdf5-hio/doc/doxygen.conf hdf5-hio/doc/template/header.tex])
AC_OUTPUT