/[gentoo-x86]/sci-libs/arpack/arpack-96-r3.ebuild
Gentoo

Contents of /sci-libs/arpack/arpack-96-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Wed Feb 29 22:33:46 2012 UTC (8 years, 3 months ago) by ranger
Branch: MAIN
Changes since 1.10: +2 -2 lines
Marking arpack-96-r3 ppc for bug 388475

(Portage version: 2.1.10.11/cvs/Linux ppc64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-libs/arpack/arpack-96-r3.ebuild,v 1.10 2012/01/23 15:29:58 klausman Exp $
4
5 EAPI=4
6
7 inherit autotools eutils flag-o-matic fortran-2 toolchain-funcs
8
9 DESCRIPTION="Arnoldi package library to solve large scale eigenvalue problems."
10 HOMEPAGE="http://www.caam.rice.edu/software/ARPACK/"
11 SRC_URI="
12 http://www.caam.rice.edu/software/ARPACK/SRC/${PN}${PV}.tar.gz
13 http://www.caam.rice.edu/software/ARPACK/SRC/p${PN}${PV}.tar.gz
14 http://dev.gentoo.org/~bicatali/${P}-patches-2.tar.bz2
15 doc? (
16 http://www.caam.rice.edu/software/ARPACK/SRC/ug.ps.gz
17 http://www.caam.rice.edu/software/ARPACK/DOCS/tutorial.ps.gz )"
18
19 LICENSE="BSD"
20 SLOT="0"
21 KEYWORDS="alpha amd64 hppa ppc ~ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
22 IUSE="doc examples mpi static-libs"
23
24 RDEPEND="
25 virtual/fortran
26 virtual/blas
27 virtual/lapack
28 mpi? ( virtual/mpi[fortran] )"
29 DEPEND="${RDEPEND}
30 dev-util/pkgconfig"
31
32 S="${WORKDIR}/ARPACK"
33
34 src_unpack() {
35 unpack ${A}
36 unpack ./*patch.tar.gz
37 }
38
39 src_prepare() {
40 cd "${WORKDIR}"
41 epatch "${WORKDIR}"/${PN}-arscnd.patch
42 # http://savannah.gnu.org/bugs/?func=detailitem&item_id=31479
43 epatch "${WORKDIR}"/${PN}-neupd.patch
44 epatch "${WORKDIR}"/${PN}-autotools.patch
45
46 cd "${S}"
47 # fix examples library paths
48 sed -i \
49 -e '/^include/d' \
50 -e "s:\$(ALIBS):-larpack $(pkg-config --libs blas lapack):g" \
51 -e 's:$(FFLAGS):$(FFLAGS) $(LDFLAGS):g' \
52 EXAMPLES/*/makefile || die "sed failed"
53
54 sed -i \
55 -e '/^include/d' \
56 -e "s:\$(PLIBS):-larpack -lparpack $(pkg-config --libs blas lapack):g" \
57 -e 's:_$(PLAT)::g' \
58 -e 's:$(PFC):mpif77:g' \
59 -e 's:$(PFFLAGS):$(FFLAGS) $(LDFLAGS) $(EXTOBJS):g' \
60 PARPACK/EXAMPLES/MPI/makefile || die "sed failed"
61
62 # bug #354993
63 rm -f PARPACK/{SRC,UTIL,EXAMPLES}/MPI/mpif.h
64 #ln -s "${EPREFIX}"/usr/include/mpif*.h PARPACK/SRC/MPI/
65 eautoreconf
66 }
67
68 src_configure() {
69 econf \
70 --with-blas="$(pkg-config --libs blas)" \
71 --with-lapack="$(pkg-config --libs lapack)" \
72 $(use_enable static-libs static) \
73 $(use_enable mpi)
74 }
75
76 src_test() {
77 pushd EXAMPLES/SIMPLE
78 emake simple FC=$(tc-getFC) LDFLAGS="${LDFLAGS} -L${S}/.libs"
79 local prog=
80 for p in ss ds sn dn cn zn; do
81 prog=${p}simp
82 LD_LIBRARY_PATH="${S}/.libs" ./${prog} \
83 || die "${prog} test failed"
84 rm -f ${prog} *.o
85 done
86 popd
87
88 if use mpi; then
89 pushd PARPACK/EXAMPLES/MPI
90 mpif77 ${FFLAGS} -c ../../../LAPACK/dpttr{f,s}.f \
91 || die "compiling dpttrf,s failed"
92 emake \
93 FC=mpif77 \
94 EXTOBJS="dpttr{f,s}.o" \
95 LDFLAGS="${LDFLAGS} -L${S}/.libs -L${S}/PARPACK/.libs" \
96 pdndrv || die "emake pdndrv failed"
97 for p in 1 3; do
98 prog=pdndrv${p}
99 LD_LIBRARY_PATH="${S}/.libs:${S}/PARPACK/.libs" \
100 ./${prog} || die "${prog} test failed"
101 rm -f ${prog} *.o
102 done
103 popd
104 fi
105 }
106
107 src_install() {
108 emake DESTDIR="${D}" install
109
110 dodoc README DOCUMENTS/*.doc
111 newdoc DOCUMENTS/README README.doc
112 use doc && dodoc "${WORKDIR}"/*.ps
113 if use examples; then
114 insinto /usr/share/doc/${PF}
115 doins -r EXAMPLES
116 if use mpi; then
117 insinto /usr/share/doc/${PF}/EXAMPLES/PARPACK
118 doins -r PARPACK/EXAMPLES/MPI
119 fi
120 fi
121 }

  ViewVC Help
Powered by ViewVC 1.1.20