-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathnccl-rdma-sharp-plugins.spec.in
134 lines (110 loc) · 3.98 KB
/
nccl-rdma-sharp-plugins.spec.in
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
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 2019-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
%global rel @RPM_RELEASE@
%global version @VERSION@
%global pkgname @PACKAGE@
%global prefix @prefix@
%global __check_files %{nil}
%global _libdir %{prefix}/lib
%{!?configure_opts: %global configure_opts %{nil}}
%global debug_package %{nil}
%bcond_with valgrind
%global _binary_filedigest_algorithm 1
%global _source_filedigest_algorithm 1
%global lt_release @LT_RELEASE@
%global lt_version @LT_CURRENT@.@LT_REVISION@.@LT_AGE@
Name: %{pkgname}
Summary: RDMA and SHARP plugins for NCCL
Version: %{version}
Release: %{rel}
License: Proprietary
Group: Applications
Source: %{pkgname}-%{version}.tar.gz
Requires: libibverbs
%if 0%{?suse_version} < 1100
BuildRequires: gcc-c++ libibverbs-devel binutils
%else
BuildRequires: gcc-c++ libibverbs-devel binutils-devel
%endif
%if %{with valgrind}
BuildRequires: valgrind-devel
%endif
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
URL: http://www.mellanox.com
Prefix: %{prefix}
Provides: nccl-rdma-sharp-plugins
Vendor: mellanox
%description
Provides RDMA and SHARP plugins for NCCL Collective library
%prep
rm -rf $RPM_BUILD_ROOT
%setup -q
%build
./configure
make %{?_smp_mflags}
%install
rm -rf "$RPM_BUILD_ROOT"
# Strip out some dependencies
cat > find-requires.sh <<'EOF'
exec %{__find_requires} "$@" | egrep -v '^perl'
EOF
chmod +x find-requires.sh
%global _use_internal_dependency_generator 0
%global __find_requires %{_builddir}/%{buildsubdir}/find-requires.sh
make DESTDIR="$RPM_BUILD_ROOT" install
mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d/
echo %{_libdir} > $RPM_BUILD_ROOT/etc/ld.so.conf.d/nccl-rdma-sharp-plugins.conf
mkdir -p $RPM_BUILD_ROOT/usr/lib64/pkgconfig
cp nccl-rdma-sharp-plugins.pc $RPM_BUILD_ROOT/usr/lib64/pkgconfig
%clean
# We may be in the directory that we're about to remove, so cd out of
# there before we remove it
cd /tmp
# Remove installed driver after rpm build finished
chmod -R o+w $RPM_BUILD_DIR/%{name}-%{version}
rm -rf $RPM_BUILD_DIR/%{name}-%{version}
test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
%files
%defattr(-, root, root)
%{prefix}
/etc/ld.so.conf.d/nccl-rdma-sharp-plugins.conf
/usr/lib64/pkgconfig/nccl-rdma-sharp-plugins.pc
# Your application file list goes here
# %{prefix}/lib/lib*.so*
#%doc COPYRIGHT ChangeLog README AUTHORS NEWS
#%doc doc/*
# If you install a library
%post
/sbin/ldconfig || exit 1
# If you install a library
%postun
/sbin/ldconfig
exit 0