3 |
3 |
|
4 |
4 |
EAPI=7
|
5 |
5 |
|
6 |
|
inherit fortran-2 toolchain-funcs
|
|
6 |
PYTHON_COMPAT=( python3_{9..11} )
|
7 |
7 |
|
8 |
|
# TODO:
|
9 |
|
# testing: emake examples?
|
10 |
|
# better doc instalation and building
|
11 |
|
# pypastix (separate package?)
|
12 |
|
# multilib with eselect?
|
13 |
|
# static libs building without pic
|
14 |
|
# metis?
|
|
8 |
inherit cmake fortran-2 python-single-r1
|
15 |
9 |
|
16 |
|
# package id: change every version, see the link on inriaforge
|
17 |
|
PID=218
|
|
10 |
# package id: changes every version, see the link on inriaforge
|
|
11 |
PID=38205
|
18 |
12 |
DESCRIPTION="Parallel solver for very large sparse linear systems"
|
19 |
13 |
HOMEPAGE="https://solverstack.gitlabpages.inria.fr/pastix/ https://gitlab.inria.fr/solverstack/pastix"
|
20 |
|
SRC_URI="https://gforge.inria.fr/frs/download.php/latestfile/${PID}/${PN}_${PV}.tar.bz2"
|
21 |
|
S="${WORKDIR}/${PN}_${PV}/src"
|
|
14 |
SRC_URI="https://files.inria.fr/pastix/releases/v$(ver_cut 1)/${P}.tar.gz"
|
22 |
15 |
|
23 |
16 |
LICENSE="CeCILL-C"
|
24 |
17 |
SLOT="0"
|
25 |
|
KEYWORDS="amd64 arm arm64 ~ia64 ~ppc ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
|
26 |
|
IUSE="doc int64 mpi +smp starpu static-libs"
|
|
18 |
KEYWORDS="amd64 arm arm64 ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
|
|
19 |
IUSE="cuda examples +fortran int64 metis mpi +python +scotch starpu test"
|
27 |
20 |
|
28 |
|
RDEPEND="
|
29 |
|
sci-libs/scotch:0=[int64?,mpi?]
|
30 |
|
sys-apps/hwloc:0=
|
|
21 |
RESTRICT="!test? ( test )"
|
|
22 |
|
|
23 |
# REQUIRED_USE explanation:
|
|
24 |
# 1. Not a typo, Python is needed at build time regardless of whether
|
|
25 |
# the bindings are to be installed or not
|
|
26 |
# 2. While not enforced by upstream build scripts, having no ordering at all
|
|
27 |
# results in rather spectacular test and runtime failures.
|
|
28 |
REQUIRED_USE="${PYTHON_REQUIRED_USE}
|
|
29 |
|| ( metis scotch )"
|
|
30 |
|
|
31 |
RDEPEND="sys-apps/hwloc:0=
|
31 |
32 |
virtual/blas
|
32 |
|
mpi? ( virtual/mpi )
|
33 |
|
starpu? ( dev-libs/starpu:0= )"
|
|
33 |
virtual/cblas
|
|
34 |
virtual/lapack
|
|
35 |
virtual/lapacke
|
|
36 |
cuda? ( dev-util/nvidia-cuda-toolkit )
|
|
37 |
metis? ( sci-libs/metis[int64(+)=] )
|
|
38 |
mpi? (
|
|
39 |
virtual/mpi[fortran]
|
|
40 |
metis? ( sci-libs/parmetis )
|
|
41 |
)
|
|
42 |
python? (
|
|
43 |
${PYTHON_DEPS}
|
|
44 |
$(python_gen_cond_dep '
|
|
45 |
dev-python/numpy[${PYTHON_USEDEP}]
|
|
46 |
dev-python/scipy[${PYTHON_USEDEP}]
|
|
47 |
')
|
|
48 |
)
|
|
49 |
scotch? ( >=sci-libs/scotch-6.1.0-r1:0=[int64=,mpi?] )
|
|
50 |
starpu? ( >=dev-libs/starpu-1.3.0:0= )"
|
34 |
51 |
DEPEND="${RDEPEND}"
|
35 |
|
BDEPEND="virtual/pkgconfig"
|
|
52 |
BDEPEND="${PYTHON_DEPS}
|
|
53 |
virtual/pkgconfig
|
|
54 |
test? ( ${RDEPEND} )"
|
|
55 |
|
|
56 |
PATCHES=(
|
|
57 |
"${FILESDIR}"/${PN}-6.0.3-cmake-installdirs.patch
|
|
58 |
"${FILESDIR}"/${PN}-6.0.3-cmake-examples-optional.patch
|
|
59 |
"${FILESDIR}"/${PN}-6.0.3-cmake-python-optional.patch
|
|
60 |
"${FILESDIR}"/${PN}-6.0.3-cmake-spm-project.patch
|
|
61 |
"${FILESDIR}"/${PN}-6.0.3-multiple-coeftabMemory.patch
|
|
62 |
)
|
36 |
63 |
|
37 |
|
PATCHES=( "${FILESDIR}"/${P}-MPI-3.0.patch )
|
38 |
|
|
39 |
|
src_prepare() {
|
40 |
|
default
|
41 |
|
sed -e 's/^\(HOSTARCH\s*=\).*/\1 ${HOST}/' \
|
42 |
|
-e "s:^\(CCPROG\s*=\).*:\1 $(tc-getCC):" \
|
43 |
|
-e "s:^\(CFPROG\s*=\).*:\1 $(tc-getFC):" \
|
44 |
|
-e "s:^\(CF90PROG\s*=\).*:\1 $(tc-getFC):" \
|
45 |
|
-e "s:^\(ARPROG\s*=\).*:\1 $(tc-getAR):" \
|
46 |
|
-e "s:^\(CCFOPT\s*=\).*:\1 ${FFLAGS}:" \
|
47 |
|
-e "s:^\(CCFDEB\s*=\).*:\1 ${FFLAGS}:" \
|
48 |
|
-e 's:^\(EXTRALIB\s*=\).*:\1 -lm -lrt:' \
|
49 |
|
-e "s:^#\s*\(ROOT\s*=\).*:\1 \$(DESTDIR)${EPREFIX}/usr:" \
|
50 |
|
-e 's:^#\s*\(INCLUDEDIR\s*=\).*:\1 $(ROOT)/include:' \
|
51 |
|
-e 's:^#\s*\(BINDIR\s*=\).*:\1 $(ROOT)/bin:' \
|
52 |
|
-e "s:^#\s*\(LIBDIR\s*=\).*:\1 \$(ROOT)/$(get_libdir):" \
|
53 |
|
-e 's:^#\s*\(SHARED\s*=\).*:\1 1:' \
|
54 |
|
-e 's:^#\s*\(SOEXT\s*=\).*:\1 .so:' \
|
55 |
|
-e '/fPIC/s/^#//g' \
|
56 |
|
-e "s:^#\s*\(SHARED_FLAGS\s*=.*\):\1 ${LDFLAGS}:" \
|
57 |
|
-e "s:pkg-config:$(tc-getPKG_CONFIG):g" \
|
58 |
|
-e "s:^\(BLASLIB\s*=\).*:\1 $($(tc-getPKG_CONFIG) --libs blas):" \
|
59 |
|
-e "s:^\s*\(HWLOC_HOME\s*?=\).*:\1 ${EPREFIX}/usr:" \
|
60 |
|
-e "s:-I\$(HWLOC_INC):$($(tc-getPKG_CONFIG) --cflags hwloc):" \
|
61 |
|
-e "s:-L\$(HWLOC_LIB) -lhwloc:$($(tc-getPKG_CONFIG) --libs hwloc):" \
|
62 |
|
-e "s:^\s*\(SCOTCH_HOME\s*?=\).*:\1 ${EPREFIX}/usr:" \
|
63 |
|
-e "s:^\s*\(SCOTCH_INC\s*?=.*\):\1/scotch:" \
|
64 |
|
-e "s:^\s*\(SCOTCH_LIB\s*?=.*\)lib:\1$(get_libdir):" \
|
65 |
|
config/LINUX-GNU.in > config.in || die
|
66 |
|
sed -e 's/__SO_NAME__,$@/__SO_NAME__,$(notdir $@)/g' -i Makefile || die
|
|
64 |
pkg_setup() {
|
|
65 |
python-single-r1_pkg_setup
|
67 |
66 |
}
|
68 |
67 |
|
69 |
68 |
src_configure() {
|
70 |
|
if use amd64; then
|
71 |
|
sed -e 's/^\(VERSIONBIT\s*=\).*/\1 _64bit/' \
|
72 |
|
-i config.in || die
|
73 |
|
fi
|
74 |
|
|
75 |
|
if use int64; then
|
76 |
|
sed -e '/VERSIONINT.*_int64/s/#//' \
|
77 |
|
-e '/CCTYPES.*INTSSIZE64/s/#//' \
|
78 |
|
-i config.in || die
|
79 |
|
fi
|
80 |
|
|
81 |
|
if ! use mpi; then
|
82 |
|
sed -e '/VERSIONMPI.*_nompi/s/#//' \
|
83 |
|
-e '/CCTYPES.*NOMPI/s/#//' \
|
84 |
|
-e '/MPCCPROG\s*= $(CCPROG)/s/#//' \
|
85 |
|
-e '/MCFPROG\s*= $(CFPROG)/s/#//' \
|
86 |
|
-e 's/-DDISTRIBUTED//' \
|
87 |
|
-e 's/-lptscotch/-lscotch/g' \
|
88 |
|
-i config.in || die
|
89 |
|
fi
|
90 |
|
|
91 |
|
if ! use smp; then
|
92 |
|
sed -e '/VERSIONSMP.*_nosmp/s/#//' \
|
93 |
|
-e '/CCTYPES.*NOSMP/s/#//' \
|
94 |
|
-i config.in || die
|
95 |
|
fi
|
96 |
|
|
97 |
|
if use starpu; then
|
98 |
|
sed -e '/libstarpu/s/#//g' -i config.in || die
|
99 |
|
fi
|
100 |
|
}
|
101 |
|
|
102 |
|
src_compile() {
|
103 |
|
emake all drivers
|
104 |
|
}
|
105 |
|
|
106 |
|
src_test() {
|
107 |
|
# both test and tests targets are defined and do not work
|
108 |
|
emake examples
|
109 |
|
echo
|
|
69 |
local mycmakeargs=(
|
|
70 |
-DBUILD_SHARED_LIBS=yes
|
|
71 |
-DINSTALL_EXAMPLES=$(usex examples)
|
|
72 |
-DPASTIX_INT64=$(usex int64)
|
|
73 |
-DPASTIX_ORDERING_METIS=$(usex metis)
|
|
74 |
-DPASTIX_ORDERING_SCOTCH=$(usex scotch)
|
|
75 |
-DPASTIX_WITH_CUDA=$(usex cuda)
|
|
76 |
-DPASTIX_WITH_FORTRAN=$(usex fortran)
|
|
77 |
-DPASTIX_WITH_MPI=$(usex mpi)
|
|
78 |
-DPASTIX_WITH_PYTHON=$(usex python)
|
|
79 |
-DPASTIX_WITH_STARPU=$(usex starpu)
|
|
80 |
)
|
|
81 |
cmake_src_configure
|
110 |
82 |
}
|
111 |
83 |
|
112 |
84 |
src_install() {
|
113 |
|
default
|
114 |
|
sed -e "s:${D}::g" -i "${ED}"/usr/bin/pastix-conf || die
|
115 |
|
# quick and dirty (static libs should really be built without pic)
|
116 |
|
cd .. || die
|
117 |
|
dodoc README.txt doc/refcard/refcard.pdf
|
|
85 |
cmake_src_install
|
|
86 |
use python && python_optimize
|
118 |
87 |
}
|