/[gentoo-x86]/sci-libs/mumps/mumps-4.10.0.ebuild
Gentoo

Contents of /sci-libs/mumps/mumps-4.10.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Fri Mar 6 09:56:13 2015 UTC (4 years, 11 months ago) by bircoph
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
revbump after bugfix 541830

Signed-off-by: Andrew Savchenko <bircoph@gentoo.org>
(Portage version: 2.2.17/cvs/Linux i686, signed Manifest commit with key 565953B95372756C)

1 bircoph 1.2 # Copyright 1999-2015 Gentoo Foundation
2 bicatali 1.1 # Distributed under the terms of the GNU General Public License v2
3 bircoph 1.3 # $Header: /var/cvsroot/gentoo-x86/sci-libs/mumps/mumps-4.10.0.ebuild,v 1.2 2015/03/06 09:51:21 bircoph Exp $
4 bicatali 1.1
5     EAPI=5
6    
7     inherit eutils toolchain-funcs flag-o-matic versionator fortran-2 multilib
8    
9     MYP=MUMPS_${PV}
10    
11     DESCRIPTION="MUltifrontal Massively Parallel sparse direct matrix Solver"
12     HOMEPAGE="http://mumps.enseeiht.fr/"
13     SRC_URI="${HOMEPAGE}${MYP}.tar.gz"
14    
15     LICENSE="public-domain"
16     SLOT="0"
17     KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
18     IUSE="doc examples metis mpi +scotch static-libs"
19    
20     RDEPEND="
21     virtual/blas
22     metis? ( || ( sci-libs/metis <sci-libs/parmetis-4 )
23     mpi? ( <sci-libs/parmetis-4 ) )
24 bircoph 1.2 scotch? ( <sci-libs/scotch-6[mpi=] )
25 bicatali 1.1 mpi? ( sci-libs/scalapack )"
26    
27     DEPEND="${RDEPEND}
28     virtual/pkgconfig"
29    
30     S="${WORKDIR}/${MYP}"
31    
32     static_to_shared() {
33     local libstatic=${1}; shift
34     local libname=$(basename ${libstatic%.a})
35     local soname=${libname}$(get_libname $(get_version_component_range 1-2))
36     local libdir=$(dirname ${libstatic})
37    
38     einfo "Making ${soname} from ${libstatic}"
39     if [[ ${CHOST} == *-darwin* ]] ; then
40     ${LINK:-$(tc-getCC)} ${LDFLAGS} \
41     -dynamiclib -install_name "${EPREFIX}"/usr/lib/"${soname}" \
42     -Wl,-all_load -Wl,${libstatic} \
43     "$@" -o ${libdir}/${soname} || die "${soname} failed"
44     else
45     ${LINK:-$(tc-getCC)} ${LDFLAGS} \
46     -shared -Wl,-soname=${soname} \
47     -Wl,--whole-archive ${libstatic} -Wl,--no-whole-archive \
48     "$@" -o ${libdir}/${soname} || die "${soname} failed"
49     [[ $(get_version_component_count) -gt 1 ]] && \
50     ln -s ${soname} ${libdir}/${libname}$(get_libname $(get_major_version))
51     ln -s ${soname} ${libdir}/${libname}$(get_libname)
52     fi
53     }
54    
55     src_prepare() {
56     sed -e "s:^\(CC\s*=\).*:\1$(tc-getCC):" \
57     -e "s:^\(FC\s*=\).*:\1$(tc-getFC):" \
58     -e "s:^\(FL\s*=\).*:\1$(tc-getFC):" \
59     -e "s:^\(AR\s*=\).*:\1$(tc-getAR) cr :" \
60     -e "s:^\(RANLIB\s*=\).*:\1$(tc-getRANLIB):" \
61     -e "s:^\(LIBBLAS\s*=\).*:\1$($(tc-getPKG_CONFIG) --libs blas):" \
62     -e "s:^\(INCPAR\s*=\).*:\1:" \
63     -e 's:^\(LIBPAR\s*=\).*:\1$(SCALAP):' \
64     -e "s:^\(OPTF\s*=\).*:\1${FFLAGS} -DALLOW_NON_INIT \$(PIC):" \
65     -e "s:^\(OPTC\s*=\).*:\1${CFLAGS} \$(PIC):" \
66     -e "s:^\(OPTL\s*=\).*:\1${LDFLAGS}:" \
67     Make.inc/Makefile.inc.generic > Makefile.inc || die
68     # fixed a missing copy of libseq to libdir
69     }
70    
71     src_configure() {
72     LIBADD="$($(tc-getPKG_CONFIG) --libs blas) -Llib -lpord"
73     local ord="-Dpord"
74     if use metis && use mpi; then
75     sed -i \
76     -e "s:#\s*\(LMETIS\s*=\).*:\1$($(tc-getPKG_CONFIG) --libs parmetis):" \
77     -e "s:#\s*\(IMETIS\s*=\).*:\1$($(tc-getPKG_CONFIG) --cflags parmetis):" \
78     Makefile.inc || die
79     LIBADD="${LIBADD} $($(tc-getPKG_CONFIG) --libs parmetis)"
80     ord="${ord} -Dparmetis"
81     elif use metis; then
82     sed -i \
83     -e "s:#\s*\(LMETIS\s*=\).*:\1$($(tc-getPKG_CONFIG) --libs metis):" \
84     -e "s:#\s*\(IMETIS\s*=\).*:\1$($(tc-getPKG_CONFIG) --cflags metis):" \
85     Makefile.inc || die
86     LIBADD="${LIBADD} $($(tc-getPKG_CONFIG) --libs metis)"
87     ord="${ord} -Dmetis"
88     fi
89     if use scotch && use mpi; then
90     sed -i \
91     -e "s:#\s*\(LSCOTCH\s*=\).*:\1-lptesmumps -lptscotch -lptscotcherr:" \
92     -e "s:#\s*\(ISCOTCH\s*=\).*:\1-I${EROOT}usr/include/scotch:" \
93     Makefile.inc || die
94     LIBADD="${LIBADD} -lptesmumps -lptscotch -lptscotcherr"
95     ord="${ord} -Dptscotch"
96     elif use scotch; then
97     sed -i \
98     -e "s:#\s*\(LSCOTCH\s*=\).*:\1-lesmumps -lscotch -lscotcherr:" \
99     -e "s:#\s*\(ISCOTCH\s*=\).*:\1-I${EROOT}usr/include/scotch:" \
100     Makefile.inc || die
101     LIBADD="${LIBADD} -lesmumps -lscotch -lscotcherr"
102     ord="${ord} -Dscotch"
103     fi
104     if use mpi; then
105     sed -i \
106     -e "s:^\(CC\s*=\).*:\1mpicc:" \
107     -e "s:^\(FC\s*=\).*:\1mpif90:" \
108     -e "s:^\(FL\s*=\).*:\1mpif90:" \
109     -e "s:^\(SCALAP\s*=\).*:\1$($(tc-getPKG_CONFIG) --libs scalapack):" \
110     Makefile.inc || die
111     export LINK=mpif90
112     LIBADD="${LIBADD} $($(tc-getPKG_CONFIG) --libs scalapack)"
113     else
114     sed -i \
115     -e 's:-Llibseq:-L$(topdir)/libseq:' \
116     -e 's:PAR):SEQ):g' \
117     -e "s:^\(SCALAP\s*=\).*:\1:" \
118     -e 's:^LIBSEQNEEDED =:LIBSEQNEEDED = libseqneeded:g' \
119     Makefile.inc || die
120     export LINK="$(tc-getFC)"
121     fi
122     sed -i -e "s:^\s*\(ORDERINGSF\s*=\).*:\1 ${ord}:" Makefile.inc || die
123     }
124    
125     src_compile() {
126     # Workaround #462602
127     export FAKEROOTKEY=1
128    
129     # -j1 because of static archive race
130     emake -j1 alllib PIC="-fPIC"
131     if ! use mpi; then
132     #$(tc-getAR) crs lib/libmumps_common.a libseq/*.o || die
133     LIBADD+=" -Llibseq -lmpiseq"
134     static_to_shared libseq/libmpiseq.a
135     fi
136     static_to_shared lib/libpord.a ${LIBADD}
137     static_to_shared lib/libmumps_common.a ${LIBADD}
138    
139     local i
140     for i in c d s z; do
141     static_to_shared lib/lib${i}mumps.a -Llib -lmumps_common ${LIBADD}
142     done
143     if use static-libs; then
144     emake clean
145     emake -j1 alllib
146     fi
147     }
148    
149     src_test() {
150     emake all
151     local dotest
152     if use mpi; then
153     dotest="mpirun -np 2"
154     else
155     export LD_LIBRARY_PATH="${S}/libseq:${LD_LIBRARY_PATH}"
156     fi
157     cd examples
158     ${dotest} ./ssimpletest < input_simpletest_real || die
159     ${dotest} ./dsimpletest < input_simpletest_real || die
160     ${dotest} ./csimpletest < input_simpletest_cmplx || die
161     ${dotest} ./zsimpletest < input_simpletest_cmplx || die
162     einfo "The solutions should be close to (1,2,3,4,5)"
163     ${dotest} ./c_example || die
164     einfo "The solution should be close to (1,2)"
165     make clean
166     }
167    
168     src_install() {
169     dolib.so lib/lib*$(get_libname)*
170     use static-libs && dolib.a lib/lib*.a
171     insinto /usr
172     doins -r include
173     if ! use mpi; then
174     dolib.so libseq/lib*$(get_libname)*
175     insinto /usr/include/mpiseq
176     doins libseq/*.h
177     use static-libs && dolib.a libseq/libmpiseq.a
178     fi
179     dodoc README ChangeLog VERSION
180     use doc && dodoc doc/*.pdf
181     if use examples; then
182     insinto /usr/share/doc/${PF}
183     doins -r examples
184     fi
185     }

  ViewVC Help
Powered by ViewVC 1.1.20