Skip to content

Commit 4e446a3

Browse files
committed
numactl: add numactl package
It contains numactl program to run other programs with a specific NUMA policy and a libnuma to do allocations with NUMA policy in applications. Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
1 parent b1bd9b1 commit 4e446a3

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

utils/numactl/Makefile

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
#
3+
# Copyright (C) 2026 Bootlin
4+
5+
include $(TOPDIR)/rules.mk
6+
7+
PKG_NAME:=numactl
8+
PKG_VERSION:=2.0.19
9+
PKG_RELEASE:=1
10+
11+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12+
PKG_SOURCE_URL:=https://github.com/numactl/numactl/releases/download/v$(PKG_VERSION)
13+
PKG_HASH:=f2672a0381cb59196e9c246bf8bcc43d5568bc457700a697f1a1df762b9af884
14+
15+
PKG_MAINTAINER:=Thomas Richard <thomas.richard@bootlin.com>
16+
PKG_LICENSE:=GPL-2.0 (libnuma), LGPL-2.1 (programs)
17+
PKG_LICENSE_FILES:=LICENSE.GPL2 LICENSE.LGPL2.1
18+
19+
PKG_INSTALL:=1
20+
21+
include $(INCLUDE_DIR)/package.mk
22+
23+
define Package/numactl/Default
24+
SECTION:=utils
25+
CATEGORY:=Utilities
26+
URL:=https://github.com/numactl/numactl
27+
endef
28+
29+
define Package/libnuma
30+
TITLE:=libnuma
31+
ABI_VERSION:=1.0.0
32+
DEPENDS:= +libatomic
33+
endef
34+
35+
define Package/numactl
36+
TITLE=numactl and other utilities
37+
DEPENDS:= +libnuma
38+
endef
39+
40+
define Package/numactl/Default/description
41+
Simple NUMA policy support. It consists of a numactl program to run other
42+
programs with a specific NUMA policy and a libnuma to do allocations with NUMA
43+
policy in applications.
44+
endef
45+
46+
define Package/numactl/description
47+
$(call Package/numactl/Default/description)
48+
49+
This package provides the binaries.
50+
endef
51+
52+
define Package/libnuma/description
53+
$(call Package/numactl/Default/description)
54+
55+
This package provides the libnuma library.
56+
endef
57+
58+
define Build/InstallDev
59+
$(INSTALL_DIR) $(1)/usr/include
60+
$(INSTALL_DIR) $(1)/usr/lib
61+
$(CP) $(PKG_INSTALL_DIR)/usr/include/numaif.h $(1)/usr/include
62+
$(CP) $(PKG_INSTALL_DIR)/usr/include/numacompat1.h $(1)/usr/include
63+
$(CP) $(PKG_INSTALL_DIR)/usr/include/numa.h $(1)/usr/include
64+
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnuma.so.$(ABI_VERSION) $(1)/usr/lib/
65+
$(LN) libnuma.so.$(ABI_VERSION) $(1)/usr/lib/libnuma.so.1
66+
$(LN) libnuma.so.$(ABI_VERSION) $(1)/usr/lib/libnuma.so
67+
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnuma.a $(1)/usr/lib/
68+
endef
69+
70+
define Package/libnuma/install
71+
$(INSTALL_DIR) $(1)/usr/lib
72+
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libnuma.so.$(ABI_VERSION) $(1)/usr/lib/
73+
$(LN) libnuma.so.$(ABI_VERSION) $(1)/usr/lib/libnuma.so.1
74+
$(LN) libnuma.so.$(ABI_VERSION) $(1)/usr/lib/libnuma.so
75+
endef
76+
77+
define Package/numactl/install
78+
$(INSTALL_DIR) $(1)/usr/bin
79+
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/memhog $(1)/usr/bin
80+
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/migratepages $(1)/usr/bin
81+
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/migspeed $(1)/usr/bin
82+
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/numactl $(1)/usr/bin
83+
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/numademo $(1)/usr/bin
84+
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/numastat $(1)/usr/bin
85+
endef
86+
87+
$(eval $(call BuildPackage,libnuma))
88+
$(eval $(call BuildPackage,numactl))

0 commit comments

Comments
 (0)