forked from memkind/memkind
-
Notifications
You must be signed in to change notification settings - Fork 0
/
memkind.spec.mk
269 lines (238 loc) · 8.65 KB
/
memkind.spec.mk
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
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (C) 2014 - 2021 Intel Corporation.
# targets for building rpm
version ?= 0.0.0
release ?= 1
arch = $(shell uname -p)
name ?= memkind
rpm: $(name)-$(version).tar.gz
rpmbuild $(rpmbuild_flags) $^ -ta
memkind-$(version).spec:
@echo "$$memkind_spec" > $@
cat ChangeLog >> $@
.PHONY: rpm
define memkind_spec
Summary: User Extensible Heap Manager
Name: $(name)
Version: $(version)
Release: $(release)
License: BSD-2-Clause
Group: System Environment/Libraries
URL: http://memkind.github.io/memkind
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: automake libtool gcc-c++ unzip
%if %{defined suse_version}
BuildRequires: libnuma-devel
%else
BuildRequires: numactl-devel
%endif
%define daxctl_min_version 66
%if %{defined suse_version}
BuildRequires: libndctl-devel >= %{daxctl_min_version}
%else
BuildRequires: daxctl-devel >= %{daxctl_min_version}
%endif
%define hwloc_min_version 2.3.0
%if %{defined suse_version}
BuildRequires: libhwloc-devel >= %{hwloc_min_version}
%else
BuildRequires: hwloc-devel >= %{hwloc_min_version}
%endif
Prefix: %{_prefix}
Prefix: %{_unitdir}
%if %{undefined suse_version}
Obsoletes: memkind
Provides: memkind libmemkind0
%endif
%define namespace memkind
%if %{defined suse_version}
%define docdir %{_defaultdocdir}/%{namespace}
%else
%define docdir %{_defaultdocdir}/%{namespace}-%{version}
%endif
# Upstream testing of memkind is done exclusively on x86_64; other archs
# are unsupported but may work.
ExclusiveArch: x86_64 ppc64 ppc64le s390x aarch64
# default values if version is a tagged release on github
%{!?commit: %define commit %{version}}
%{!?buildsubdir: %define buildsubdir %{namespace}-%{commit}}
Source0: https://github.com/%{namespace}/%{namespace}/archive/v%{commit}/%{buildsubdir}.tar.gz
%description
The memkind library is an user extensible heap manager built on top of
jemalloc which enables control of memory characteristics and a
partitioning of the heap between kinds of memory. The kinds of memory
are defined by operating system memory policies that have been applied
to virtual address ranges. Memory characteristics supported by
memkind without user extension include control of NUMA and page size
features. The jemalloc non-standard interface has been extended to
enable specialized arenas to make requests for virtual memory from the
operating system through the memkind partition interface. Through the
other memkind interfaces the user can control and extend memory
partition features and allocate memory while selecting enabled
features. This software is being made available for early evaluation.
Feedback on design or implementation is greatly appreciated.
%package devel
Summary: Memkind User Extensible Heap Manager development lib and tools
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%if %{undefined suse_version}
Obsoletes: memkind-devel
Provides: memkind-devel
%endif
%description devel
Install header files and development aids to link memkind library into
applications.
%package tests
Summary: Extension to libnuma for kinds of memory - validation
Group: Validation/Libraries
Requires: %{name} = %{version}-%{release}
%description tests
memkind functional tests
%prep
%setup -q -a 0 -n $(name)-%{version}
%build
# It is required that we configure and build the jemalloc subdirectory
# before we configure and start building the top level memkind directory.
# To ensure the memkind build step is able to discover the output
# of the jemalloc build we must create an 'obj' directory, and build
# from within that directory.
cd %{_builddir}/%{buildsubdir}
echo %{version} > %{_builddir}/%{buildsubdir}/VERSION
./build.sh --prefix=%{_prefix} --includedir=%{_includedir} --libdir=%{_libdir} \
--bindir=%{_bindir} --docdir=%{_docdir}/%{namespace} --mandir=%{_mandir} --sbindir=%{_sbindir}
%install
cd %{_builddir}/%{buildsubdir}
%{__make} DESTDIR=%{buildroot} install
%{__install} -d %{buildroot}$(memkind_test_dir)
%{__install} -d %{buildroot}/%{_unitdir}
%{__install} -d %{buildroot}/$(memkind_test_dir)/python_framework
%{__install} test/.libs/* test/*.sh test/*.ts test/*.py %{buildroot}$(memkind_test_dir)
%{__install} test/python_framework/*.py %{buildroot}/$(memkind_test_dir)/python_framework
rm -f %{buildroot}$(memkind_test_dir)/libautohbw.*
rm -f %{buildroot}$(memkind_test_dir)/libmemtier.*
rm -f %{buildroot}/%{_libdir}/lib%{namespace}.{l,}a
rm -f %{buildroot}/%{_libdir}/libautohbw.{l,}a
rm -f %{buildroot}/%{_libdir}/libmemtier.{l,}a
%pre
%post
/sbin/ldconfig
%preun
%postun
/sbin/ldconfig
%files
%defattr(-,root,root,-)
%license %{_docdir}/%{namespace}/COPYING
%doc %{_docdir}/%{namespace}/README
%doc %{_docdir}/%{namespace}/VERSION
%dir %{_docdir}/%{namespace}
%{_libdir}/lib%{namespace}.so.*
%{_libdir}/libautohbw.so.*
%{_libdir}/libmemtier.so.*
%{_bindir}/%{namespace}-auto-dax-kmem-nodes
%{_bindir}/%{namespace}-hbw-nodes
%{_bindir}/memtier
%files devel
%defattr(-,root,root,-)
%{_includedir}
%{_includedir}/hbwmalloc.h
%{_includedir}/hbw_allocator.h
%{_includedir}/memkind_allocator.h
%{_includedir}/pmem_allocator.h
%{_includedir}/fixed_allocator.h
%{_libdir}/lib%{namespace}.so
%{_libdir}/libautohbw.so
%{_libdir}/libmemtier.so
%{_libdir}/pkgconfig/memkind.pc
%{_includedir}/%{namespace}.h
%{_mandir}/man1/memkind-auto-dax-kmem-nodes.1.*
%{_mandir}/man1/memkind-hbw-nodes.1.*
%{_mandir}/man1/*memtier.1.*
%{_mandir}/man3/fixedallocator.3.*
%{_mandir}/man3/hbwmalloc.3.*
%{_mandir}/man3/hbwallocator.3.*
%{_mandir}/man3/libmemtier.3.*
%{_mandir}/man3/pmemallocator.3.*
%{_mandir}/man3/%{namespace}*.3.*
%{_mandir}/man7/autohbw.7.*
%{_mandir}/man7/*memtier.7.*
%files tests
%defattr(-,root,root,-)
$(memkind_test_dir)/all_tests
$(memkind_test_dir)/background_threads_test
${memkind_test_dir}/environ_err_dax_kmem_malloc_positive_test
${memkind_test_dir}/environ_err_dax_kmem_malloc_test
$(memkind_test_dir)/environ_err_hbw_malloc_test
$(memkind_test_dir)/environ_err_hbw_threshold_test
$(memkind_test_dir)/environ_max_bg_threads_test
${memkind_test_dir}/dax_kmem_test
$(memkind_test_dir)/decorator_test
$(memkind_test_dir)/locality_test
$(memkind_test_dir)/freeing_memory_segfault_test
${memkind_test_dir}/get_capacity_test
$(memkind_test_dir)/filter_memkind
$(memkind_test_dir)/hello_hbw
$(memkind_test_dir)/hello_memkind
$(memkind_test_dir)/hello_memkind_debug
${memkind_test_dir}/hmat_test
$(memkind_test_dir)/memkind_allocated
$(memkind_test_dir)/memkind_cpp_allocator
$(memkind_test_dir)/memkind_get_stat
${memkind_test_dir}/memkind_highcapacity_test
${memkind_test_dir}/memkind_memtier_dax_kmem_test
${memkind_test_dir}/memkind_memtier_test
$(memkind_test_dir)/memkind_stat_test
$(memkind_test_dir)/autohbw_candidates
${memkind_test_dir}/pmem_kinds
${memkind_test_dir}/pmem_malloc
${memkind_test_dir}/pmem_malloc_unlimited
${memkind_test_dir}/pmem_usable_size
${memkind_test_dir}/pmem_alignment
${memkind_test_dir}/pmem_and_dax_kmem_kind
${memkind_test_dir}/pmem_and_default_kind
${memkind_test_dir}/pmem_config
$(memkind_test_dir)/pmem_detect_kind
${memkind_test_dir}/pmem_multithreads
${memkind_test_dir}/pmem_multithreads_onekind
$(memkind_test_dir)/pmem_free_with_unknown_kind
${memkind_test_dir}/pmem_cpp_allocator
${memkind_test_dir}/fixed_cpp_allocator
${memkind_test_dir}/pmem_test
${memkind_test_dir}/allocator_perf_tool_tests
${memkind_test_dir}/perf_tool
${memkind_test_dir}/autohbw_test_helper
$(memkind_test_dir)/stats_print_test_helper
${memkind_test_dir}/trace_mechanism_test_helper
$(memkind_test_dir)/memkind-afts.ts
$(memkind_test_dir)/memkind-afts-ext.ts
$(memkind_test_dir)/memkind-slts.ts
$(memkind_test_dir)/memkind-perf.ts
$(memkind_test_dir)/memkind-perf-ext.ts
$(memkind_test_dir)/memkind-pytests.ts
$(memkind_test_dir)/performance_test
$(memkind_test_dir)/test.sh
$(memkind_test_dir)/test_dax_kmem.sh
$(memkind_test_dir)/hbw_detection_test.py
$(memkind_test_dir)/hbw_env_var_test.py
$(memkind_test_dir)/dax_kmem_env_var_test.py
$(memkind_test_dir)/autohbw_test.py
$(memkind_test_dir)/trace_mechanism_test.py
$(memkind_test_dir)/python_framework
$(memkind_test_dir)/python_framework/cmd_helper.py
$(memkind_test_dir)/python_framework/huge_page_organizer.py
$(memkind_test_dir)/python_framework/__init__.py
$(memkind_test_dir)/draw_plots.py
$(memkind_test_dir)/tiering_tests.py
$(memkind_test_dir)/run_alloc_benchmark.sh
$(memkind_test_dir)/alloc_benchmark_hbw
$(memkind_test_dir)/alloc_benchmark_glibc
$(memkind_test_dir)/alloc_benchmark_tbb
$(memkind_test_dir)/alloc_benchmark_pmem
$(memkind_test_dir)/fragmentation_benchmark_pmem
$(memkind_test_dir)/defrag_reallocate
%exclude $(memkind_test_dir)/*.pyo
%exclude $(memkind_test_dir)/*.pyc
%exclude $(memkind_test_dir)/python_framework/*.pyo
%exclude $(memkind_test_dir)/python_framework/*.pyc
%changelog
endef
export memkind_spec