blob: 77350eb9c886b310424f45780e9d73e4a930361d (
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
|
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake flag-o-matic fortran-2 toolchain-funcs
DESCRIPTION="Subset of LAPACK routines redesigned for heterogenous (MPI) computing"
HOMEPAGE="https://www.netlib.org/scalapack/"
SRC_URI="https://github.com/Reference-ScaLAPACK/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~riscv ~x86"
IUSE="static-libs test"
RESTRICT="!test? ( test )"
BDEPEND="virtual/pkgconfig"
RDEPEND="
virtual/lapack
virtual/mpi[fortran]
"
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}"/${PN}-2.2.0-cmake.patch
)
src_prepare() {
cmake_src_prepare
if use static-libs; then
mkdir "${WORKDIR}/${PN}_static" || die
fi
# mpi does not have a pc file
# fix missing -L path
sed -i \
-e 's/mpi//' \
-e "/^libdir/s|@libdir@|${EPREFIX}/usr/$(get_libdir)|" \
scalapack.pc.in \
|| die
}
src_configure() {
# -Werror=strict-aliasing
# https://bugs.gentoo.org/862924
# https://github.com/Reference-ScaLAPACK/scalapack/issues/95
#
# Do not trust it for LTO either.
append-flags -fno-strict-aliasing
filter-lto
# https://github.com/Reference-ScaLAPACK/scalapack/issues/31
append-cflags -std=gnu89
scalapack_configure() {
local mycmakeargs=(
-DUSE_OPTIMIZED_LAPACK_BLAS=ON
-DBLAS_LIBRARIES="$($(tc-getPKG_CONFIG) --libs blas)"
-DLAPACK_LIBRARIES="$($(tc-getPKG_CONFIG) --libs lapack)"
-DBUILD_TESTING=$(usex test)
$@
)
cmake_src_configure
}
scalapack_configure -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF
use static-libs && \
CMAKE_BUILD_DIR="${WORKDIR}/${PN}_static" scalapack_configure \
-DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON
}
src_compile() {
cmake_src_compile
use static-libs && \
CMAKE_BUILD_DIR="${WORKDIR}/${PN}_static" cmake_src_compile
}
src_install() {
cmake_src_install
use static-libs && \
CMAKE_BUILD_DIR="${WORKDIR}/${PN}_static" cmake_src_install
insinto /usr/include/blacs
doins BLACS/SRC/*.h
insinto /usr/include/scalapack
doins PBLAS/SRC/*.h
}
|