forked from openucx/ucc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
198 lines (170 loc) · 6.2 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
#
# Copyright (C) Mellanox Technologies Ltd. 2001-2021. ALL RIGHTS RESERVED.
# This software product is a proprietary product of Mellanox Technologies Ltd.
# (the "Company") and all right, title, and interest and to the software product,
# including all associated intellectual property rights, are and shall
# remain exclusively with the Company.
#
# This software product is governed by the End User License Agreement
# provided with the software product.
# $COPYRIGHT$
# $HEADER$
define([ucc_ver_major], 1)
define([ucc_ver_minor], 0)
define([ucc_ver_patch], 0)
define([ucc_ver_micro], esyscmd([sh -c "git rev-list HEAD | wc -l | sed -e 's/ *//g' | xargs -n1 printf"]))
define([ucc_git_sha], esyscmd([sh -c "git rev-parse --short HEAD"]))
# This is the API version (see libtool library versioning)
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
# current:rev:age
define([libucc_so_version], 1:0:0)
AC_INIT([ucc], [ucc_ver_major.ucc_ver_minor])
: ${CPPFLAGS=""}
: ${CFLAGS=""}
: ${CXXFLAGS=""}
AC_USE_SYSTEM_EXTENSIONS
AC_GNU_SOURCE
AC_CONFIG_HEADERS([config.h])
UCC_TOP_BUILDDIR="`pwd`"
AC_SUBST(UCC_TOP_BUILDDIR)
cd "$srcdir"
UCC_TOP_SRCDIR="`pwd`"
AC_SUBST(UCC_TOP_SRCDIR)
cd "$UCC_TOP_BUILDDIR"
AC_MSG_NOTICE([builddir: $UCC_TOP_BUILDDIR])
AC_MSG_NOTICE([srcdir: $UCC_TOP_SRCDIR])
AM_INIT_AUTOMAKE([1.10 foreign tar-ustar silent-rules subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_MAINTAINER_MODE
AC_CONFIG_MACRO_DIR([m4])
define([ucc_prefix], [/opt/ucf/ucc])
AC_PREFIX_DEFAULT([ucc_prefix])
RPM_RELEASE=1
MAJOR_VERSION=ucc_ver_major
MINOR_VERSION=ucc_ver_minor
MICRO_VERSION=ucc_ver_micro
PATCH_VERSION=ucc_ver_micro
UCC_GIT_SHA=ucc_git_sha
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
SOVERSION=libucc_so_version
AC_SUBST(MAJOR_VERSION)
AC_SUBST(MINOR_VERSION)
AC_SUBST(MICRO_VERSION)
AC_SUBST(PATCH_VERSION)
AC_SUBST(RPM_RELEASE)
AC_SUBST(SOVERSION)
AC_SUBST(UCC_GIT_SHA)
AC_MSG_RESULT([git sha: $ucc_git_sha])
CFLAGS_save="$CFLAGS"
AC_PROG_CC
AC_PROG_CXX
AM_PROG_AS
AC_PROG_LN_S
AC_PROG_MKDIR_P
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_HEADER_STDC
CFLAGS="$CFLAGS_save"
#
# Check if 'ln' supports creating relative links
#
AC_MSG_CHECKING([if ${LN_S} supports --relative])
AS_IF([${LN_S} --relative symlinktest 2>/dev/null],
[AC_MSG_RESULT([yes])
AC_SUBST([LN_RS], ["${LN_S} --relative"])
rm symlinktest],
[AC_MSG_RESULT([no])
AC_SUBST([LN_RS], [${LN_S}])])
AC_SUBST([modulesubdir], [${PACKAGE_NAME}]) # module directory names
AC_SUBST([moduledir], [${libdir}/${modulesubdir}]) # module installation directory
AC_SUBST([localmoduledir], ['$(abs_top_builddir)/modules']) # local directory for module symlinks
AC_SUBST([objdir], [${objdir}]) # libtool objects dir, usually .libs
AC_SUBST([shrext], [${shrext_cmds}]) # libtool shared library extension
AC_DEFINE_UNQUOTED([UCC_MODULE_SUBDIR], ["${modulesubdir}"], [UCC module sub-directory])
#
# Additional m4 files
#
m4_include([config/m4/ax_prog_doxygen.m4])
AC_ARG_WITH([docs_only],
AS_HELP_STRING([--with-docs-only],
[Compile only documentation for UCC. [default=NO]]),
,[:],[with_docs_only=no])
AC_DEFUN([UCC_DX_ENABLE_CHECK],
[AS_IF([DX_TEST_FEATURE($1)],
[],
[AS_IF([test "x$enable_doxygen_$1" == xyes],
[AC_MSG_ERROR([--enable-doxygen-$1 was specified, but $1
doxygen was not found])],
[])])])
#
# Doxygen options
#
DX_PS_FEATURE(OFF)
DX_HTML_FEATURE(ON)
DX_MAN_FEATURE(ON)
DX_PDF_FEATURE(ON)
DX_INIT_DOXYGEN([UCC],[docs/doxygen/ucc_doxygen.conf],[docs/doxygen-doc])
AS_IF([test "x$with_docs_only" = xyes],
[AS_MESSAGE([Documents only requested])
AS_IF([DX_TEST_FEATURE(doc)],
[],
[AC_MSG_ERROR([--with-only-docs was requested, but doxygen was not found])])
UCC_DX_ENABLE_CHECK([html])
UCC_DX_ENABLE_CHECK([man])
UCC_DX_ENABLE_CHECK([pdf])
AM_CONDITIONAL([DOCS_ONLY], [true])
AM_CONDITIONAL([HAVE_GTEST], [false])
AM_CONDITIONAL([HAVE_CXX11], [false])
AM_CONDITIONAL([HAVE_GNUXX11], [false])
AM_CONDITIONAL([HAVE_GLIBCXX_NOTHROW], [false])
AM_CONDITIONAL([HAVE_AARCH64_THUNDERX2], [false])
AM_CONDITIONAL([HAVE_AARCH64_THUNDERX1], [false])
AM_CONDITIONAL([HAVE_AARCH64_HI1620], [false])
AM_CONDITIONAL([HAVE_UCX], [false])
AM_CONDITIONAL([HAVE_CUDA], [false])
],
[
AM_CONDITIONAL([DOCS_ONLY], [false])
m4_include([config/m4/compiler.m4])
m4_include([config/m4/gtest.m4])
m4_include([config/m4/sysdep.m4])
m4_include([config/m4/ucx.m4])
m4_include([config/m4/cuda.m4])
m4_include([test/gtest/configure.m4])
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug], [Enable extra debugging code (default is NO).]),
[], [enable_debug=no])
if test $enable_debug = yes; then
AC_DEFINE([ENABLE_DEBUG], [1], [Enable debugging code])
CFLAGS="$CFLAGS -O0 -g3"
AC_DEFINE([UCS_MAX_LOG_LEVEL], [UCS_LOG_LEVEL_TRACE_POLL], [Highest log level])
else
AC_DEFINE([UCS_MAX_LOG_LEVEL], [UCS_LOG_LEVEL_INFO], [Highest log level])
CFLAGS="$CFLAGS -O3 -DNDEBUG"
fi
CHECK_UCX
AC_MSG_RESULT([UCX support: $ucx_happy])
if test $ucx_happy != "yes"; then
AC_MSG_ERROR([UCX is not available])
fi
CHECK_CUDA
AC_MSG_RESULT([CUDA support: $cuda_happy; $CUDA_CPPFLAGS $CUDA_LDFLAGS])
]) # Docs only
includes="-I${UCC_TOP_SRCDIR}/src -I${UCC_TOP_BUILDDIR}/src"
CFLAGS="$CFLAGS -std=gnu11"
CPPFLAGS="$UCS_CPPFLAGS $CPPFLAGS $includes -Wall -Werror"
LDFLAGS="$LDFLAGS $UCS_LDFLAGS $UCS_LIBADD"
AC_CONFIG_FILES([
Makefile
src/Makefile
tools/info/Makefile
src/ucc/api/ucc_version.h
src/core/ucc_version.c
src/components/cl/basic/Makefile
src/components/tl/ucp/Makefile
src/components/mc/cpu/Makefile
src/components/mc/cuda/Makefile
src/components/mc/cuda/kernel/Makefile
test/mpi/Makefile
])
AC_OUTPUT