aboutsummaryrefslogtreecommitdiff
path: root/sysutils/slurm-wlm/Makefile
blob: ee3014a9f0191000ddd7fecedf29487cbeae475e (plain) (blame)
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
PORTNAME=	slurm
DISTVERSION=	23.11.1
PORTREVISION=	2
CATEGORIES=	sysutils
MASTER_SITES=	https://download.schedmd.com/slurm/
PKGNAMESUFFIX=	-wlm

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Simple Linux Utility for Resource Management
WWW=		https://slurm.schedmd.com/

LICENSE=	GPLv2+
LICENSE_FILE=	${WRKSRC}/COPYING

NOT_FOR_ARCHS=		armv6 armv7 i386 mips powerpc powerpcspe
NOT_FOR_ARCHS_REASON=	32-bit support is deprecated

LIB_DEPENDS=	libjson-c.so:devel/json-c \
		libsysinfo.so:devel/libsysinfo \
		libmunge.so:security/munge \
		liblz4.so:archivers/liblz4 \
		libze_loader.so:devel/level-zero \
		libhttp_parser.so:www/http-parser \
		libunwind.so:devel/libunwind \
		librdkafka.so:net/librdkafka \
		libyaml.so:textproc/libyaml \
		libdbus-1.so:devel/dbus \
		libcheck.so:devel/check \
		libtbb.so:devel/onetbb \
		libjwt.so:www/libjwt

USES=		compiler:c11 cpe gmake gnome libtool localbase lua mysql:client	\
		perl5 pkgconfig python:build readline shebangfix ssl tar:bz2
USE_PERL5=	build
CPE_VENDOR=	schedmd
USE_LDCONFIG=	yes
USE_RC_SUBR=	slurmctld slurmd

USERS=		slurm
GROUPS=		${USERS}

GNU_CONFIGURE=	yes
GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
INSTALL_TARGET=	install-strip
TEST_TARGET=	check
PLIST_SUB=	PORTVERSION="${DISTVERSION}" VER="${DISTVERSION:R}"
SHEBANG_FILES=	doc/html/shtml2html.py doc/man/man2html.py

OPTIONS_DEFINE=		CURL DOCS GUI HDF5 HWLOC IPMI RRD
OPTIONS_DEFAULT=	HDF5 HWLOC
OPTIONS_SUB=		yes

CURL_DESC=	Require cURL for elasticsearch plugins
GUI_DESC=	Build sview GUI config tool
HDF5_DESC=	Job profiling using HDF5
HWLOC_DESC=	Portable hardware locality
IPMI_DESC=	IPMI energy consumption accounting
RRD_DESC=	RRD external sensor data collection

DOCS_BUILD_DEPENDS=	man2html:textproc/man2html

CURL_LIB_DEPENDS=	libcurl.so:ftp/curl
CURL_CONFIGURE_WITH=	libcurl

GUI_USE=		GNOME=cairo,gdkpixbuf2,glib20,gtk20,pango
GUI_LIB_DEPENDS=	libfontconfig.so:x11-fonts/fontconfig \
			libfreetype.so:print/freetype2 \
			libharfbuzz.so:print/harfbuzz
GUI_USES=		gettext
GUI_CONFIGURE_ENABLE=	glibtest gtktest x11

HDF5_LIB_DEPENDS=	libhdf5_cpp.so:science/hdf5 \
			libsz.so:science/libaec
HDF5_CONFIGURE_WITH=	hdf5
HDF5_CONFIGURE_ENV=	H5CC=${LOCALBASE}/bin/h5cc

HWLOC_LIB_DEPENDS=	libhwloc.so.15:devel/hwloc2
HWLOC_CONFIGURE_WITH=	hwloc

IPMI_LIB_DEPENDS=	libfreeipmi.so:sysutils/freeipmi
IPMI_CONFIGURE_WITH=	freeipmi

RRD_LIB_DEPENDS=	librrd.so:databases/rrdtool
RRD_CONFIGURE_WITH=	rrdtool

# FreeBSD Infiniband support is still experimental
# slurmrestd does not build on FreeBSD
CONFIGURE_ARGS=	--disable-slurmrestd --with-mysql_config=${LOCALBASE}/bin \
		--docdir=${DOCSDIR} --htmldir=${DOCSDIR}

CFLAGS+=	-I${WRKSRC}/slurm -I${LOCALBASE}/include	\
		-I${LOCALBASE}/include/level_zero		\
		-I${LOCALBASE}/include/librdkafka		\
		-fcommon -D__BSD_VISIBLE=1
LDFLAGS+=	-L${LOCALBASE}/lib -lsysinfo -lprocstat -fcommon

PROC2FIX=	common/callerid.c common/fd.c common/fetch_config.c	\
		interfaces/proctrack.c	\
		plugins/acct_gather_energy/rapl/acct_gather_energy_rapl.c	\
		plugins/acct_gather_filesystem/lustre/acct_gather_filesystem_lustre.c	\
		plugins/burst_buffer/common/burst_buffer_common.c	\
		plugins/cgroup/v1/xcgroup.c plugins/cgroup/v2/cgroup_v2.c	\
		plugins/gpu/nvml/gpu_nvml.c	\
		plugins/job_container/tmpfs/job_container_tmpfs.c	\
		plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.c	\
		plugins/jobacct_gather/common/common_jag.c	\
		plugins/jobacct_gather/linux/jobacct_gather_linux.c	\
		plugins/node_features/knl_generic/node_features_knl_generic.c	\
		plugins/proctrack/cgroup/proctrack_cgroup.c	\
		plugins/proctrack/cray_aries/proctrack_cray_aries.c	\
		plugins/proctrack/linuxproc/kill_tree.c	\
		plugins/proctrack/pgid/proctrack_pgid.c	\
		plugins/switch/cray_aries/scaling.c	\
		plugins/task/affinity/affinity.c slurmd/common/set_oomadj.c	\
		slurmd/common/xcpuinfo.c slurmd/slurmstepd/pdebug.c	\
		slurmd/slurmstepd/req.c

LLD2FIX=	api plugins/openapi sacctmgr sackd scontrol scrontab scrun	\
		slurmctld slurmd/slurmd squeue

.include <bsd.port.options.mk>

# Hack around nonfunctional --disable-gtktest flag
pre-configure-GUI-off:
	${REINPLACE_CMD} -e 's|min_gtk_version=.*|min_gtk_version=2000.0.0|' \
		${WRKSRC}/configure

# SLURM's configure enables interactive jobs if pty.h exists.  Replacing
# #include <pty.h> with appropriate headers will therefore not work, so instead
# add a pty.h for the build.
pre-configure:
	${CP} ${FILESDIR}/pty.h ${WRKSRC}/slurm
	${REINPLACE_CMD} -e 's|sched_setaffinity|cpuset_setaffinity|g' \
		-e 's|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/configure
.for src in ${PROC2FIX}
	${REINPLACE_CMD} -e 's|"/proc|"/compat/linux/proc|g' \
		-e 's|(/proc)|(/compat/linux/proc)|g' \
		${WRKSRC}/src/${src}
.endfor
	@if ${WHICH} sbatch > /dev/null; then \
		${ECHO_CMD} "********************************************"; \
		${ECHO_CMD} "Build may fail while slurm-wlm is installed."; \
		${ECHO_CMD} "Deinstall slurm-wlm and run make again."; \
		${ECHO_CMD} "********************************************"; \
		false; \
	fi
.if ${ARCH} == powerpc64le
	${FIND} ${LLD2FIX:C|^|${WRKSRC}/src/|} -name Makefile.in | ${XARGS}	\
		${REINPLACE_CMD} -e 's|-r -o|-r -m elf64lppc -o|'
.elif ${ARCH} == powerpc64
	${FIND} ${LLD2FIX:C|^|${WRKSRC}/src/|} -name Makefile.in | ${XARGS}	\
		${REINPLACE_CMD} -e 's|-r -o|-r -m elf64ppc -o|'
.else
	${FIND} ${LLD2FIX:C|^|${WRKSRC}/src/|} -name Makefile.in | ${XARGS}	\
		${REINPLACE_CMD} -e 's|-r -o|-r -m elf_${ARCH} -o|'
.endif
	${FIND} ${WRKSRC} -name Makefile.in | ${XARGS}	\
		${REINPLACE_CMD} -e 's|htmldir = \$${datadir.*$$|htmldir = @htmldir@|'

post-install:
	${INSTALL_DATA} ${WRKSRC}/etc/slurm.conf.example \
		${STAGEDIR}${PREFIX}/etc/slurm.conf.sample

.include <bsd.port.mk>