-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.ac
More file actions
179 lines (155 loc) · 5.9 KB
/
configure.ac
File metadata and controls
179 lines (155 loc) · 5.9 KB
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
###############################################################################
# Init autoconf
###############################################################################
AC_PREREQ([2.69])
AC_INIT([Framework for Network Co-Simulation],
[0.1],
[jeff.daily@pnnl.gov],
[fncs])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([integrator.h])
###############################################################################
# Init automake
###############################################################################
AM_INIT_AUTOMAKE([foreign subdir-objects -Wall -Werror])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Don't emit "rebuild rules" for configure, Makefile.ins, etc.
AM_MAINTAINER_MODE
###############################################################################
# Misc. information and package setup.
###############################################################################
FNCS_TOP_BUILDDIR="`pwd`"
cd "$srcdir"
FNCS_TOP_SRCDIR="`pwd`"
cd "$FNCS_TOP_BUILDDIR"
AS_IF([test "$FNCS_TOP_BUILDDIR" != "$FNCS_TOP_SRCDIR"],
[AC_MSG_NOTICE([Detected VPATH build])])
AC_LANG([C++])
# We use the MPI compiler wrappers instead of the standard compilers.
FNCS_WITH_MPI
AS_IF([test "x$with_mpi" != xno], [with_mpi_val=1], [with_mpi_val=0])
AM_CONDITIONAL([HAVE_MPI], [test "x$with_mpi" != xno])
AC_DEFINE_UNQUOTED([HAVE_MPI], [$with_mpi_val], [define to 1 to use MPI])
###############################################################################
# C++ compiler
###############################################################################
AC_MSG_NOTICE
AC_MSG_NOTICE([C++ compiler])
AC_MSG_NOTICE
# Checks for programs.
FNCS_PROG_MPICXX
AS_IF([test "x$with_mpi_wrappers" = xyes], [FNCS_MPI_UNWRAP],
[FNCS_ARG_PARSE([with_mpi], [MPI_LIBS], [MPI_LDFLAGS], [MPI_CPPFLAGS])])
AS_IF([test "x$with_mpi" != xno], [FNCS_MPICXX_TEST_LINK])
# Checks for libraries.
FNCS_CHECK_PACKAGE([zmq], [zmq.h], [zmq], [zmq_ctx_new])
# Checks for header files.
FNCS_CHECK_HEADERS([cstdint])
FNCS_CHECK_HEADERS([stdint.h])
FNCS_CHECK_HEADERS([sys/time.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_CHECK_SIZEOF([int8_t])
AC_CHECK_SIZEOF([int16_t])
AC_CHECK_SIZEOF([int32_t])
AC_CHECK_SIZEOF([int64_t])
AC_CHECK_SIZEOF([uint8_t])
AC_CHECK_SIZEOF([uint16_t])
AC_CHECK_SIZEOF([uint32_t])
AC_CHECK_SIZEOF([uint64_t])
AC_CHECK_SIZEOF([short])
AC_CHECK_SIZEOF([char])
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([long])
AC_CHECK_SIZEOF([long long])
AC_CHECK_SIZEOF([unsigned char])
AC_CHECK_SIZEOF([unsigned short])
AC_CHECK_SIZEOF([unsigned int])
AC_CHECK_SIZEOF([unsigned long])
AC_CHECK_SIZEOF([unsigned long long])
AC_CHECK_SIZEOF([void*])
FNCS_CXX_NULLPTR
# Checks for library functions.
FNCS_CHECK_FUNCS([gettimeofday])
###############################################################################
# C compiler
###############################################################################
AC_MSG_NOTICE
AC_MSG_NOTICE([C compiler])
AC_MSG_NOTICE
AC_LANG_PUSH([C])
# Checks for programs.
FNCS_PROG_MPICC
AS_IF([test "x$with_mpi_wrappers" = xyes], [FNCS_MPI_UNWRAP])
AS_IF([test "x$with_mpi" != xno], [FNCS_MPICC_TEST_LINK])
# Checks for libraries.
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_LANG_POP([C])
###############################################################################
# Libtool setup -- no compiler/linker tests after this
###############################################################################
AC_MSG_NOTICE
AC_MSG_NOTICE([Libtool setup])
AC_MSG_NOTICE
# temporarily restore unwrapped compilers
# this works around a bug where libtool sadly relies on matching compiler
# names in order to determine features (Fortran only, I think)
# libtool doesn't recognize MPI compiler names, nor should it
AS_IF([test "x$with_mpi_wrappers" = xyes], [FNCS_MPI_UNWRAP_PUSH])
m4_ifdef([AM_PROG_AR],[AM_PROG_AR])
LT_INIT
# and now that that's over, put the MPI compilers back
# also, the above hack incorrectly sets the base compiler as the linker
AS_IF([test "x$with_mpi_wrappers" = xyes],
[FNCS_MPI_UNWRAP_POP
compiler="$CC"
LTCC="$CC"
lt_save_CC="$CC"
compiler_DEFAULT="$CC"
compiler_CXX="$CXX"])
###############################################################################
# Test suite setup
###############################################################################
AC_ARG_VAR([MPIEXEC],
[how to run parallel tests if built with MPI e.g. "mpiexec -np %NP%"])
AS_IF([test "x$MPIEXEC" = x && test "x$with_mpi" != xno],
[AC_PATH_PROGS([MPIEXEC], [mpirun mpiexec])])
AC_SUBST([MPIEXEC])
###############################################################################
# The End
###############################################################################
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
# Report on what we found.
AC_MSG_NOTICE([])
AC_MSG_NOTICE([**************************************************************])
AC_MSG_NOTICE([ $PACKAGE_NAME configured as follows:])
AC_MSG_NOTICE([**************************************************************])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([ MPI_LIBS=$MPI_LIBS])
AC_MSG_NOTICE([ MPI_LDFLAGS=$MPI_LDFLAGS])
AC_MSG_NOTICE([ MPI_CPPFLAGS=$MPI_CPPFLAGS])
AC_MSG_NOTICE([ CXX=$CXX])
AS_IF([test "x$with_mpi_wrappers" = xyes], [
AC_MSG_NOTICE([unwrapped CXX=$ga_cv_mpicxx_naked])
])
AC_MSG_NOTICE([ CXXFLAGS=$CXXFLAGS])
AC_MSG_NOTICE([ CPP=$CPP])
AC_MSG_NOTICE([ CPPFLAGS=$CPPFLAGS])
AC_MSG_NOTICE([ LDFLAGS=$LDFLAGS])
AC_MSG_NOTICE([ LIBS=$LIBS])
AC_MSG_NOTICE([ MPIEXEC=$MPIEXEC])
AC_MSG_NOTICE([])