-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathconfigure.ac
154 lines (131 loc) · 4.75 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
#
# Copyright (C) Mellanox Technologies Ltd. 2001-2020. 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([xccl_ver_major], 1)
define([xccl_ver_minor], 0)
define([xccl_ver_micro], esyscmd([sh -c "git rev-list HEAD | wc -l | sed -e 's/ *//g' | xargs -n1 printf"]))
define([xccl_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([libxccl_so_version], 1:0:0)
AC_INIT([xccl], [xccl_ver_major.xccl_ver_minor])
: ${CPPFLAGS=""}
: ${CFLAGS=""}
: ${CXXFLAGS=""}
AC_CONFIG_HEADERS([config.h])
XCCL_TOP_BUILDDIR="`pwd`"
AC_SUBST(XCCL_TOP_BUILDDIR)
cd "$srcdir"
XCCL_TOP_SRCDIR="`pwd`"
AC_SUBST(XCCL_TOP_SRCDIR)
cd "$XCCL_TOP_BUILDDIR"
AC_MSG_NOTICE([builddir: $XCCL_TOP_BUILDDIR])
AC_MSG_NOTICE([srcdir: $XCCL_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([xccl_prefix], [/opt/mellanox/xccl])
AC_PREFIX_DEFAULT([xccl_prefix])
RPM_RELEASE=1
MAJOR_VERSION=xccl_ver_major
MINOR_VERSION=xccl_ver_minor
MICRO_VERSION=xccl_ver_micro
XCCL_GIT_SHA=xccl_git_sha
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
SOVERSION=libxccl_so_version
AC_SUBST(MAJOR_VERSION)
AC_SUBST(MINOR_VERSION)
AC_SUBST(MICRO_VERSION)
AC_SUBST(RPM_RELEASE)
AC_SUBST(SOVERSION)
AC_SUBST(XCCL_GIT_SHA)
AC_MSG_RESULT([git sha: $xccl_git_sha])
CFLAGS_save="$CFLAGS"
AC_PROG_CC
AC_PROG_CXX
AM_PROG_AS
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_HEADER_STDC
CFLAGS="$CFLAGS_save"
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
AC_ARG_ENABLE([team-mrail],
AS_HELP_STRING([--enable-team-mrail], [Enable multirail team (default is NO).]),
[], [enable_team_mrail=no])
AM_CONDITIONAL([HAVE_TEAM_MRAIL], [test "x$enable_team_mrail" = xyes])
AM_CONDITIONAL([HAVE_UCX], [false])
m4_include([m4/ucx.m4])
XCCL_CHECK_UCX
if test $ucx_happy != "yes"; then
AC_MSG_ERROR([UCX is not available])
fi
AC_MSG_RESULT([UCX support: $ucx_happy])
AM_CONDITIONAL([HAVE_SHARP], [false])
m4_include([m4/sharp.m4])
XCCL_CHECK_SHARP
AC_MSG_RESULT([SHARP support: $sharp_happy])
AM_CONDITIONAL([HAVE_HMC], [false])
m4_include([m4/hmc.m4])
XCCL_CHECK_HMC
AC_MSG_RESULT([HMC support: $hmc_happy])
AC_ARG_WITH([cuda],
AC_HELP_STRING([--with-cuda=PATH], [Path to non-standard CUDA installation]),
[AS_IF([test -d $withval/lib64], [cuda_libdir="lib64"], [cuda_libdir="lib"])
AC_SUBST(CUDA_CPPFLAGS, "-I$withval/include")
AC_SUBST(CUDA_LDFLAGS, "-L$withval/$cuda_libdir -lcudart")
cuda_happy="yes"],
[cuda_happy="no"])
AM_CONDITIONAL([HAVE_CUDA], [test "x$cuda_happy" != xno])
AC_MSG_RESULT([CUDA support: $cuda_happy; $CUDA_CPPFLAGS $CUDA_LDFLAGS])
AM_CONDITIONAL([HAVE_NCCL], [false])
if test "x$cuda_happy" != xno; then
m4_include([m4/nccl.m4])
XCCL_CHECK_NCCL
AC_MSG_RESULT([NCCL support: $nccl_happy])
fi
AM_CONDITIONAL([HAVE_MPOD], [test "$nccl_happy" = "yes" -a "$ucx_happy" = "yes"])
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_LIB([pthread],[pthread_key_create],have_pthreads=yes)
if test "$have_pthreads" = "yes" ; then
LIBS="-lpthread $LIBS"
else
AC_ERROR([pthreads not found on the system])
fi
includes="-I${XCCL_TOP_SRCDIR}/src -I${XCCL_TOP_SRCDIR}/src/core -I${XCCL_TOP_SRCDIR}/src/utils"
CPPFLAGS="$UCS_CPPFLAGS $CPPFLAGS $includes"
LDFLAGS="$LDFLAGS $UCS_LDFLAGS $UCS_LIBADD"
AC_CONFIG_FILES([
Makefile
src/Makefile
src/team_lib/ucx/Makefile
src/team_lib/sharp/Makefile
src/team_lib/hmc/Makefile
src/team_lib/hier/Makefile
src/team_lib/multirail/Makefile
src/team_lib/nccl/Makefile
src/team_lib/mpod/Makefile
src/utils/cuda/Makefile
src/utils/cuda/kernels/Makefile
test/Makefile
])
AC_OUTPUT