summaryrefslogtreecommitdiff
blob: fe6d8deaf8f995cf809b5350e037a6b543196300 (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
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-cluster/hpl/hpl-1.0-r1.ebuild,v 1.1 2005/07/06 01:01:52 robbat2 Exp $

inherit eutils

DESCRIPTION="HPL - A Portable Implementation of the High-Performance Linpack Benchmark for Distributed-Memory Computers"
HOMEPAGE="http://www.netlib.org/benchmark/hpl/"
SRC_URI="http://www.netlib.org/benchmark/hpl/hpl.tgz"
LICENSE="HPL"
SLOT="0"
KEYWORDS="~x86"
IUSE=""
S="${WORKDIR}/${PN}"

DEPEND="virtual/mpi
	sci-libs/blas
	sci-libs/atlas"

src_unpack() {
	unpack ${A}
	cd ${S}
	cp setup/Make.Linux_PII_CBLAS Make.gentoo_hpl_cblas_x86
	sed -i \
		-e '/^HPL_OPTS\>/s,= .*,= -DHPL_CALL_CBLAS -DHPL_DETAILED_TIMING -DHPL_COPY_L,' \
		-e '/^ARCH\>/s,Linux_PII_CBLAS,gentoo_hpl_cblas_x86,' \
		-e '/^MPdir\>/s,= .*,=,' \
		-e '/^MPlib\>/s,= .*,=,' \
		-e "/^LAdir\>/s,= .*,= /usr/$(get_libdir)," \
		-e '/^LINKER\>/s,= .*,= mpicc,' \
		-e '/^CC\>/s,= .*,= mpicc,' \
		Make.gentoo_hpl_cblas_x86
}

src_compile() {
	# do NOT use emake here
	HOME=${WORKDIR} make arch=gentoo_hpl_cblas_x86 || die "Failed to build"
}

src_install() {
	doman man/man3/*.3
	dodoc INSTALL BUGS COPYRIGHT HISTORY README TUNING
	dobin bin/gentoo_hpl_cblas_x86/xhpl || die "Failed to install bins"
	insinto /usr/share/hpl
	doins bin/gentoo_hpl_cblas_x86/HPL.dat || die "Failed to install HPL parameters"
	dohtml -r www/*
	dolib lib/gentoo_hpl_cblas_x86/libhpl.a || die "Failed to install lib"
}

pkg_postinst() {
	einfo "Remember to copy /usr/share/hpl/HPL.dat to your working directory first!"
	einfo "For mpich, run linpack by executing this in your working directory"
	einfo "\"mpirun -np 4 /usr/bin/xhpl\""
	einfo "where -np specifies the number of processes."
	einfo "Other methods are needed lam-mpi etc."
}