-
Notifications
You must be signed in to change notification settings - Fork 13
/
configure.ac
246 lines (204 loc) · 6.05 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
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
# For license: see LICENSE file at top-level
m4_define([pkg_name], [osss-ucx])
m4_define([pkg_major], [1])
m4_define([pkg_minor], [0])
m4_define([pkg_patch], [0])
m4_define([pkg_version], [pkg_major.pkg_minor.pkg_patch])
m4_define([pkg_bugreport], [anthony.curtis@stonybrook.edu])
m4_define([pkg_url], [https://github.com/openshmem-org/osss-ucx.git])
m4_define([spec_major_version], [1])
m4_define([spec_minor_version], [4])
m4_define([spec_max_name_len], [64])
# quoted to make C string literal
m4_define([spec_vendor_string], ["pkg_name"])
# unless overridden by user
m4_define([shmem_default_heap_size], ["32M"])
shmem_heap_size=""
AC_PREREQ([2.69])
AC_INIT([pkg_name],[pkg_version],[pkg_bugreport],[],[pkg_url])
config_flags="$*"
AC_DEFINE_UNQUOTED([CONFIG_FLAGS],
["$config_flags"],
[Flags passed to configure])
AC_SUBST([SHMEM_MAJOR_VERSION], [spec_major_version])
AC_SUBST([SHMEM_MINOR_VERSION], [spec_minor_version])
AC_SUBST([SHMEM_MAX_NAME_LEN], [spec_max_name_len])
AC_SUBST([SHMEM_VENDOR_STRING], [spec_vendor_string])
AC_SUBST([SHMEM_VENDOR_MAJOR_VERSION], [pkg_major])
AC_SUBST([SHMEM_VENDOR_MINOR_VERSION], [pkg_minor])
AC_SUBST([SHMEM_VENDOR_PATCH_VERSION], [pkg_patch])
AC_DEFINE_UNQUOTED([SHMEM_MAJOR_VERSION],
[spec_major_version],
[Major version of package])
AC_DEFINE_UNQUOTED([SHMEM_MINOR_VERSION],
[spec_minor_version],
[Minor version of package])
AC_DEFINE_UNQUOTED([SHMEM_MAX_NAME_LEN],
[spec_max_name_len],
[Maximum length of vendor string])
AC_DEFINE_UNQUOTED([SHMEM_VENDOR_STRING],
[spec_vendor_string],
[Vendor-supplied package name])
AC_CONFIG_SRCDIR([autogen.sh])
AC_CONFIG_HEADERS([config.h])
# AC_CONFIG_MACRO_DIRS([m4])
AC_CONFIG_MACRO_DIR([m4])
# for multiple levels of autoconf packages (embedding)
# AC_CONFIG_AUX_DIR([.])
# AC_CONFIG_SUBDIRS([src/shcoll])
AM_INIT_AUTOMAKE([subdir-objects tar-pax])
AM_SILENT_RULES([yes])
AC_PROG_LN_S
# C
AC_PROG_CC
AC_PROG_CC_C_O
AC_PROG_INSTALL
AM_PROG_CC_C_O
# Checks for libraries.
# for building shared libraries
LT_INIT
m4_include([config/m4/pmix.m4])
m4_include([config/m4/ucx.m4])
m4_include([config/m4/shcoll.m4])
m4_include([config/m4/confargs.m4])
# m4_include([config/m4/progress.m4])
m4_include([config/m4/ax_gcc_func_attribute.m4])
m4_include([config/m4/attribute_checks.m4])
# do we have python?
m4_include([config/m4/ax_python.m4])
AX_PYTHON
case "$ax_python_bin" in
python*)
AC_DEFINE_UNQUOTED([HAVE_PY_LAUNCHER], [1], [Enable Python-based launcher])
AM_CONDITIONAL([HAVE_PY_LAUNCHER], [true])
AC_SUBST([PYTHON_BIN], [$ax_python_bin])
;;
*)
AM_CONDITIONAL([HAVE_PY_LAUNCHER], [false])
;;
esac
# c++ -specific checks
m4_include([config/m4/cxx.m4])
# static and shared library detection
AS_IF([test "x$enable_static" = "xyes"],
[AC_DEFINE([ENABLE_STATIC], [1], [Enable static libraries])]
)
AS_IF([test "x$enable_shared" = "xyes"],
[AC_DEFINE([ENABLE_SHARED], [1], [Enable shared libraries])]
)
# Checks for header files.
AC_CHECK_HEADERS([stdlib.h unistd.h string.h strings.h time.h sys/time.h sys/utsname.h sys/types.h fcntl.h stddef.h sys/param.h assert.h stdarg.h stdbool.h sched.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_SIZE_T
AC_CHECK_TYPES([int64_t])
AC_CHECK_TYPES([uint64_t])
AC_CHECK_TYPES([ptrdiff_t])
#
# Checks for library functions.
#
# AC_FUNC_MALLOC
# AC_FUNC_REALLOC
AC_FUNC_MMAP
AC_CHECK_FUNCS([atexit _exit exit gettimeofday gethostname uname memset strlcat strlcpy sched_yield nanosleep setenv putenv])
AC_CHECK_LIB([m], [log10])
now="`date`"
AC_DEFINE_UNQUOTED([CONFIG_BUILD_DATE],["$now"],[When this package was compiled])
host="`hostname`"
AC_DEFINE_UNQUOTED([CONFIG_BUILD_HOST],["$host"],[Where this package was compiled])
#
# check for pthreads and how to set it up
#
m4_include([config/m4/ax_pthread.m4])
AX_PTHREAD
AC_SUBST([PTHREAD_CC])
AC_SUBST([PTHREAD_CFLAGS])
AC_SUBST([PTHREAD_LIBS])
#
# see if compiler knows about builtin_expect
#
m4_include([config/m4/ax_gcc_builtin.m4])
AX_GCC_BUILTIN(__builtin_expect)
#
# Stub for doxygen
#
m4_include([config/m4/ax_prog_doxygen.m4])
DX_INIT_DOXYGEN([openshmem])
#
# figure out the heap size
#
AS_IF([test -z "$shmem_heap_size"],
[shmem_heap_size=m4_expand([shmem_default_heap_size])]
)
# for the oshrun man page
AC_SUBST([SHMEM_DEFAULT_HEAP_SIZE], [$shmem_heap_size])
# C string
AC_DEFINE_UNQUOTED([SHMEM_DEFAULT_HEAP_SIZE],
["$shmem_heap_size"],
[Default size of symmetric heap])
#
# all the output files
#
AC_CONFIG_FILES([
Makefile
man/Makefile
man/man1/Makefile
man/man1/oshcc.1 man/man1/oshcxx.1
man/man1/oshrun.1 man/man1/osh_info.1 man/man1/osh_intro.1
include/Makefile
include/shmem/defs_subst.h
pkgconfig/Makefile
pkgconfig/osss-ucx.pc
src/Makefile
src/shmemc/Makefile
src/shmemc/osh_common
src/shmemt/Makefile
src/shmemu/Makefile
src/shcoll/Makefile
src/shcoll/src/Makefile
src/api/Makefile
src/api/atomics/Makefile
src/osh_info/Makefile
])
AC_OUTPUT
#
# Courtesy info
#
echo
echo "Summary"
echo "-------"
echo
echo " C Compiler: \"$CC\""
echo " C Flags: \"$CFLAGS\""
echo " C++ Compiler: \"$CXX\""
echo " C++ Flags: \"$CXXFLAGS\""
echo
echo " Logging: $enable_logging"
echo " Debugging: $enable_debug"
echo " Extensions: $enable_experimental"
echo " Aligned Addresses: $enable_aligned_addresses"
echo " Multi-threaded: $enable_threads"
echo " Profiling Support: $enable_pshmem"
echo " Default heap size: $shmem_heap_size"
echo " Install prefix: $prefix"
echo
echo " UCX: version $UCX_VERSION_STRING"
echo " PMIx: version $PMIX_VERSION_STRING"
case "x$shcoll_happy" in
xno)
;;
*)
echo " SHCOLL: in $SHCOLL_DIR"
;;
esac
case "x$SHMEM_LAUNCHER" in
xno)
;;
*)
echo " Launcher: $SHMEM_LAUNCHER"
;;
esac
echo