aboutsummaryrefslogtreecommitdiff
blob: d88bbd903b6bb3231482d4243b40ffd010980767 (plain)
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
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DISTUTILS_USE_SETUPTOOLS=no
PYTHON_COMPAT=( python3_{8..11} )

inherit cmake distutils-r1

DESCRIPTION="Very-Low Overhead Checkpointing System"
HOMEPAGE="https://github.com/ECP-VeloC/VELOC"
SRC_URI="https://github.com/ECP-VeloC/VELOC/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${PN^^}-${PV}"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"

IUSE_COMM_QUEUE="
	+comm_queue_ipc
	comm_queue_socket
"
#	comm_queue_thallium
IUSE="${IUSE_COMM_QUEUE} python +slurm"

# AXL is optional
RDEPEND="
	comm_queue_ipc? ( dev-libs/boost )
	slurm? ( sys-cluster/slurm )

	dev-libs/openssl
	~sys-cluster/AXL-0.5.0
	sys-cluster/er
	virtual/mpi
"
#	comm_queue_thallium? ( thallium )
DEPEND="${RDEPEND}"

PATCHES=( "${FILESDIR}/${P}-strip-cflags.patch" )
REQUIRED_USE="
	^^ ( ${IUSE_COMM_QUEUE/+/} )
"

distutils_enable_sphinx "${S}/docs" --no-autodoc
distutils_enable_tests pytest

src_prepare() {
	cmake_src_prepare
}

src_configure() {
	local resman="NONE"
	use slurm && resman="SLURM"

	local queue
	use comm_queue_ipc && queue="ipc_queue"
	use comm_queue_socket && queue="socket_queue"
#	use comm_queue_thallium && queue="thallium_queue"

	local mycmakeargs=(
		-DCMAKE_INSTALL_LIBDIR="$(get_libdir)"
		-DCOMM_QUEUE="${queue}"
		-DVELOC_RESOURCE_MANAGER="${resman}"
		-DX_LIBDIR="$(get_libdir)"
	)
	cmake_src_configure
}

src_compile() {
	cmake_src_compile
	if use python; then
		pushd "src/bindings/python" || die
		distutils-r1_src_compile
		popd || die
	else
		# If USE="-python doc" we still
		# want to compile the doc files
		sphinx_compile_all
	fi
}

src_install() {
	cmake_src_install
	if use python; then
		pushd "${S}/src/bindings/python" || die
		distutils-r1_src_install
		popd || die
	fi
}

src_test() {
	cd test
	default
	if use python; then
		pushd "${S}/src/bindings/python" || die
#		python_test() {
#			"${EPYTHON}" test.py -v || die
#		}
		distutils-r1_src_test
		popd || die
	fi
}