forked from openpmix/openpmix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
370 lines (305 loc) · 12 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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
# -*- shell-script -*-
#
# Copyright (c) 2004-2009 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2010 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006-2020 Cisco Systems, Inc. All rights reserved
# Copyright (c) 2006-2008 Sun Microsystems, Inc. All rights reserved.
# Copyright (c) 2006-2017 Los Alamos National Security, LLC. All rights
# reserved.
# Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
# Copyright (c) 2011-2013 NVIDIA Corporation. All rights reserved.
# Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013 Mellanox Technologies, Inc.
# All rights reserved.
# Copyright (c) 2014-2020 Intel, Inc. All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# Copyright (c) 2016-2018 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2021 Nanook Consulting. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
############################################################################
# Initialization, version number, and other random setup/init stuff
############################################################################
# Load in everything found by autogen.pl
m4_include([config/autogen_found_items.m4])
# We don't have the version number to put in here yet, and we can't
# call PMIX_GET_VERSION (etc.) before AC_INIT. So use the shell
# version.
AC_INIT([pmix],[m4_normalize(esyscmd([config/pmix_get_version.sh VERSION --tarball]))],[https://github.com/openpmix/openpmix/issues],[pmix])
AC_PREREQ([2.69])
AC_CONFIG_AUX_DIR(./config)
# Note that this directory must *exactly* match what was specified via
# -I in ACLOCAL_AMFLAGS in the top-level Makefile.am.
AC_CONFIG_MACRO_DIR(./config)
# autotools expects to perform tests without interference
# from user-provided CFLAGS, particularly -Werror flags.
# Search for them here and cache any we find
PMIX_CFLAGS_cache=
PMIX_CFLAGS_pass=
for val in $CFLAGS; do
if echo "$val" | grep -q -e "-W"; then
PMIX_CFLAGS_cache="$PMIX_CFLAGS_cache $val";
else
PMIX_CFLAGS_pass="$PMIX_CFLAGS_pass $val";
fi
done
CFLAGS=$PMIX_CFLAGS_pass
PMIX_CAPTURE_CONFIGURE_CLI([PMIX_CONFIGURE_CLI])
# Get our platform support file. This has to be done very, very early
# because it twiddles random bits of autoconf
PMIX_LOAD_PLATFORM
PMIX_TOP_BUILDDIR="`pwd`"
AC_SUBST(PMIX_TOP_BUILDDIR)
top_buildir=`pwd`
cd "$srcdir"
PMIX_TOP_SRCDIR="`pwd`"
top_srcdir=$PMIX_TOP_SRCDIR
AC_SUBST(PMIX_TOP_SRCDIR)
cd "$PMIX_TOP_BUILDDIR"
AC_MSG_NOTICE([builddir: $PMIX_TOP_BUILDDIR])
AC_MSG_NOTICE([srcdir: $PMIX_TOP_SRCDIR])
if test "$PMIX_TOP_BUILDDIR" != "$PMIX_TOP_SRCDIR"; then
AC_MSG_NOTICE([Detected VPATH build])
fi
# setup configure options (e.g., show_title and friends)
PMIX_CONFIGURE_SETUP
pmix_show_title "Configuring PMIx"
# This must be before AM_INIT_AUTOMAKE
AC_CANONICAL_TARGET
# Init automake
AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects no-define 1.13.4])
# SILENT_RULES is new in AM 1.11, but we require 1.13.4 or higher via
# autogen. Limited testing shows that calling SILENT_RULES directly
# works in more cases than adding "silent-rules" to INIT_AUTOMAKE
# (even though they're supposed to be identical). Shrug.
AM_SILENT_RULES([yes])
# set the language
AC_LANG([C])
# find NM
AC_PROG_GREP
LT_PATH_NM
# AC_USE_SYSTEM_EXTENSIONS will modify CFLAGS if nothing was in there
# beforehand. We don't want that. So if there was nothing in
# CFLAGS, put nothing back in there.
PMIX_VAR_SCOPE_PUSH([CFLAGS_save])
CFLAGS_save=$CFLAGS
AC_USE_SYSTEM_EXTENSIONS
AS_IF([test -z "$CFLAGS_save"], [CFLAGS=])
PMIX_VAR_SCOPE_POP
# Sanity checks
AC_DEFUN([PMIX_CHECK_DIR_FOR_SPACES],[
dir="$1"
article="$2"
label="$3"
AC_MSG_CHECKING([directory of $label])
AC_MSG_RESULT([$dir])
AS_IF([test -n "`echo $dir | grep ' '`"],
[AC_MSG_WARN([This version of OpenPMIx does not support $article $label])
AC_MSG_WARN([with a path that contains spaces])
AC_MSG_ERROR([Cannot continue.])])
])
AC_DEFUN([PMIX_CANONICALIZE_PATH],[
case $host_os in
darwin*)
# MacOS does not have "readlink -f" or realpath (at least as
# of MacOS Cataline / 10.15). Instead, use Python, because we
# know MacOS comes with a /usr/bin/python that has
# os.path.realpath.
$2=`/usr/bin/python -c 'import os; print os.path.realpath("'$1'")'`
;;
*)
$2=`readlink -f $1`
;;
esac
])
PMIX_VAR_SCOPE_PUSH(pmix_checkdir)
PMIX_CHECK_DIR_FOR_SPACES([$srcdir], [a], [source tree])
PMIX_CANONICALIZE_PATH([$srcdir], [pmix_checkdir])
PMIX_CHECK_DIR_FOR_SPACES([$pmix_checkdir], [an], [absolute source tree])
PMIX_CANONICALIZE_PATH([.], [pmix_checkdir])
PMIX_CHECK_DIR_FOR_SPACES([$pmix_checkdir], [a], [build tree])
PMIX_CHECK_DIR_FOR_SPACES([$prefix], [a], [prefix])
PMIX_CANONICALIZE_PATH([$prefix], [pmix_checkdir])
PMIX_CHECK_DIR_FOR_SPACES([$pmix_checkdir], [an], [absolute prefix])
PMIX_VAR_SCOPE_POP
####################################################################
# Setup the configure header files
####################################################################
AH_TOP([/* -*- c -*-
*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
* Copyright (c) 2016 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
* This file is automatically generated by configure. Edits will be lost
* the next time you run configure!
*/
#ifndef PMIX_CONFIG_H
#define PMIX_CONFIG_H
#include "src/include/pmix_config_top.h"
])
AH_BOTTOM([
#include "src/include/pmix_config_bottom.h"
#endif /* PMIX_CONFIG_H */
])
############################################################################
# Setup Libtool
############################################################################
# We want new Libtool. None of that old stuff. Pfft.
m4_ifdef([LT_PREREQ], [],
[m4_fatal([libtool version 2.2.6 or higher is required], [63])])
LT_PREREQ([2.2.6])
#
# Enable static so that we have the --with tests done up here and can
# check for OS. Save the values of $enable_static and $enable_shared
# before setting the defaults, because if the user specified
# --[en|dis]able-[static|shared] on the command line, they'll already
# be set. In this way, we can tell if the user requested something or
# if the default was set here.
#
pmix_enable_shared="$enable_shared"
pmix_enable_static="$enable_static"
AS_IF([test ! -z "$enable_static" && test "$enable_static" = "yes"],
[CFLAGS="$CFLAGS -fPIC"])
AC_ENABLE_SHARED([])
AC_DISABLE_STATIC([])
PMIX_SETUP_WRAPPER_INIT
# This did not exist pre AM 1.11.x (where x is somewhere >0 and <3),
# but it is necessary in AM 1.12.x.
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AC_PROG_LEX(yywrap)
############################################################################
# Configuration options
############################################################################
# Set the MCA prefix
PMIX_SET_MCA_PREFIX([PMIX_MCA_])
PMIX_SET_MCA_CMD_LINE_ID([pmca])
# Define PMIx configure arguments
PMIX_DEFINE_ARGS
# Define some basic useful values
PMIX_BASIC_SETUP
# If debug mode, add -g
AS_IF([test "$pmix_debug" = "1"],
[CFLAGS="$CFLAGS -g"])
LT_INIT()
LT_LANG([C])
############################################################################
# Setup the core
############################################################################
# Setup the pmix core
PMIX_SETUP_CORE()
# Run the AM_CONDITIONALs
PMIX_DO_AM_CONDITIONALS
####################################################################
# Setup C compiler
####################################################################
AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
AS_IF([test -z "$CC_FOR_BUILD"],[
AC_SUBST([CC_FOR_BUILD], [$CC])
])
# restore any user-provided Werror flags
AS_IF([test ! -z "$PMIX_CFLAGS_cache"], [CFLAGS="$CFLAGS $PMIX_CFLAGS_cache"])
# Delay setting pickyness until here so we
# don't break configure code tests
#if test "$WANT_PICKY_COMPILER" = "1"; then
# CFLAGS="$CFLAGS -Wall -Wextra -Werror"
#fi
# Cleanup duplicate flags
PMIX_FLAGS_UNIQ(CFLAGS)
PMIX_FLAGS_UNIQ(CPPFLAGS)
PMIX_FLAGS_UNIQ(LDFLAGS)
PMIX_FLAGS_UNIQ(LIBS)
#
# Delayed the substitution of CFLAGS and CXXFLAGS until now because
# they may have been modified throughout the course of this script.
#
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
pmix_show_title "Final compiler flags"
AC_MSG_CHECKING([final CPPFLAGS])
AC_MSG_RESULT([$CPPFLAGS])
AC_MSG_CHECKING([final CFLAGS])
AC_MSG_RESULT([$CFLAGS])
AC_MSG_CHECKING([final LDFLAGS])
AC_MSG_RESULT([$LDFLAGS])
AC_MSG_CHECKING([final LIBS])
AC_MSG_RESULT([$LIBS])
####################################################################
# Setup variables for pkg-config file (maint/pmix.pc.in)
####################################################################
#
# Dependencies that themselves have a pkg-config file available.
#
PC_REQUIRES=""
AS_IF([test $pmix_hwloc_support -eq 1 && test "$pmix_hwloc_source" != "cobuild"],
[PC_REQUIRES="$PC_REQUIRES hwloc"])
AS_IF([test $pmix_libevent_support -eq 1 && test "$pmix_libevent_source" != "cobuild"],
[PC_REQUIRES="$PC_REQUIRES libevent"])
AS_IF([test "$pmix_zlib_support" = "1"],
[PC_REQUIRES="$PC_REQUIRES zlib"])
AC_SUBST([PC_REQUIRES], ["$PC_REQUIRES"])
#
# Dependencies that don't have a pkg-config file available.
# In this case we need to manually add -L<path> and -l<lib>
# to the PC_PRIVATE_LIBS variable.
#
PC_PRIVATE_LIBS=""
AS_IF([test $pmix_libev_support -eq 1],
[PC_PRIVATE_LIBS="$PC_PRIVATE_LIBS $pmix_libev_LDFLAGS $pmix_libev_LIBS"])
AC_SUBST([PC_PRIVATE_LIBS], ["$PC_PRIVATE_LIBS"])
####################################################################
# -Werror for CI scripts
####################################################################
AC_ARG_ENABLE(werror,
AS_HELP_STRING([--enable-werror],
[Treat compiler warnings as errors]),
[
CFLAGS="$CFLAGS -Werror"
])
####################################################################
# Version information
####################################################################
# PMIX_VERSION was setup by PMIX_SETUP_CORE above.
# Make configure depend on the VERSION file, since it's used in AC_INIT
AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/VERSION'])
. $srcdir/VERSION
AC_SUBST([libpmix_so_version])
AC_SUBST([libpmi_so_version])
AC_SUBST([libpmi2_so_version])
AC_SUBST([libmca_common_dstore_so_version])
AC_SUBST([libmca_common_sse_so_version])
AC_CONFIG_FILES(pmix_config_prefix[contrib/Makefile]
pmix_config_prefix[examples/Makefile]
pmix_config_prefix[test/Makefile]
pmix_config_prefix[test/python/Makefile]
pmix_config_prefix[test/simple/Makefile]
pmix_config_prefix[test/sshot/Makefile]
pmix_config_prefix[maint/pmix.pc])
pmix_show_title "Configuration complete"
AC_OUTPUT
PMIX_SUMMARY_PRINT