/[gentoo-x86]/sci-libs/blas-atlas/blas-atlas-3.7.19.ebuild
Gentoo

Contents of /sci-libs/blas-atlas/blas-atlas-3.7.19.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Dec 19 23:09:33 2006 UTC (13 years, 6 months ago) by markusle
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Version bump.
(Portage version: 2.1.2_rc3-r4)
 (Unsigned Manifest commit)

1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-libs/blas-atlas/blas-atlas-3.7.19.ebuild,v 1.1 2006/10/29 22:35:32 markusle Exp $
4
5 inherit eutils toolchain-funcs fortran
6
7 DESCRIPTION="Automatically Tuned Linear Algebra Software BLAS implementation"
8 HOMEPAGE="http://math-atlas.sourceforge.net/"
9 MY_PN=${PN/blas-/}
10 SRC_URI="mirror://sourceforge/math-atlas/${MY_PN}${PV}.tar.bz2
11 mirror://gentoo/${MY_PN}-${PV}-shared-libs.patch.bz2"
12
13 LICENSE="BSD"
14 SLOT="0"
15 KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
16 IUSE="doc"
17
18
19 RDEPEND="app-admin/eselect-blas
20 app-admin/eselect-cblas"
21 DEPEND="${RDEPEND}
22 >=sys-devel/libtool-1.5"
23 PROVIDE="virtual/blas"
24
25
26 S="${WORKDIR}/ATLAS"
27 BLD_DIR="${S}/gentoo-build"
28 RPATH="${DESTTREE}/$(get_libdir)/blas"
29 FORTRAN="g77 gfortran"
30
31 pkg_setup() {
32 fortran_pkg_setup
33 echo
34 ewarn "Please make sure to disable CPU throttling completely"
35 ewarn "during the compile of blas-atlas. Otherwise, all atlas"
36 ewarn "generated timings will be completely random and the"
37 ewarn "performance of the resulting libraries will be degraded"
38 ewarn "considerably."
39 echo
40 ewarn "Also, if you experience failing SANITY tests during"
41 ewarn "atlas' compile please try passing -mfpmath=387; this"
42 ewarn "option might also result in much better performance"
43 ewarn "than using then sse instruction set depending on your"
44 ewarn "CPU."
45 echo
46 epause 10
47 }
48
49 src_unpack() {
50 unpack ${A}
51 cd ${S}
52
53 epatch "${DISTDIR}"/${MY_PN}-${PV}-shared-libs.patch.bz2
54 epatch "${FILESDIR}"/${MY_PN}-asm-gentoo.patch
55
56 # make sure shared libs link against proper libraries
57 if [[ ${FORTRANC} == "gfortran" ]]; then
58 libs="${LDFLAGS} -lpthread -lgfortran"
59 else
60 libs="${LDFLAGS} -lpthread -lg2c"
61 fi
62 sed -e "s/SHRD_LNK/${libs}/g" -i Make.top || \
63 die "Failed to add addtional libs to shared object build"
64
65 mkdir ${BLD_DIR} || die "failed to generate build directory"
66 cp "${FILESDIR}"/war ${BLD_DIR} && chmod a+x ${BLD_DIR}/war || \
67 die "failed to install war"
68
69 # force proper 32/64bit libs
70 local archselect
71 if [[ "${ARCH}" == "amd64" || "${ARCH}" == "ppc64" ]]; then
72 archselect="-b 64"
73 else
74 archselect="-b 32"
75 fi
76
77 # set up compiler/flags using atlas' native configure
78 local compdefs
79 compdefs="${compdefs} -C xc '$(tc-getCC)' -F xc '${CFLAGS}'"
80 compdefs="${compdefs} -C ic '$(tc-getCC)' -F ic '${CFLAGS}'"
81 compdefs="${compdefs} -C sk '$(tc-getCC)' -F sk '${CFLAGS}'"
82 compdefs="${compdefs} -C dk '$(tc-getCC)' -F dk '${CFLAGS}'"
83 compdefs="${compdefs} -C sm '$(tc-getCC)' -F sm '${CFLAGS}'"
84 compdefs="${compdefs} -C dm '$(tc-getCC)' -F dm '${CFLAGS}'"
85 compdefs="${compdefs} -C if '${FORTRANC}' -F if '${FFLAGS}'"
86 compdefs="${compdefs} -Si cputhrchk 0 ${archselect}"
87
88 cd ${BLD_DIR} && ../configure ${compdefs} \
89 || die "configure failed"
90 }
91
92 src_compile() {
93 cd ${BLD_DIR}
94 make || die "make failed"
95
96 make shared-strip RPATH=${RPATH}/atlas || \
97 die "failed to build shared libraries"
98
99 # build shared libraries of threaded libraries if applicable
100 if [ -d gentoo/libptf77blas.a ]; then
101 make ptshared-strip RPATH=${RPATH}/threaded-atlas || \
102 die "failed to build threaded shared libraries"
103 fi
104 }
105
106 src_install () {
107 dodir "${RPATH}"/atlas
108 cd ${BLD_DIR}/gentoo/libs
109 cp -P libatlas* "${D}/${DESTTREE}/$(get_libdir)" || \
110 die "Failed to install libatlas"
111 cp -P *blas* "${D}/${RPATH}"/atlas || \
112 die "Failed to install blas/cblas"
113
114 eselect blas add $(get_libdir) ${FILESDIR}/eselect.blas atlas
115 eselect cblas add $(get_libdir) ${FILESDIR}/eselect.cblas atlas
116
117 if [ -d ${BLD_DIR}/gentoo/threaded-libs ]
118 then
119 dodir "${RPATH}"/threaded-atlas
120 cd ${BLD_DIR}/gentoo/threaded-libs
121 cp -P * "${D}/${RPATH}"/threaded-atlas || \
122 die "Failed to install threaded atlas"
123
124 eselect blas add $(get_libdir) ${FILESDIR}/eselect.blas-threaded threaded-atlas
125 eselect cblas add $(get_libdir) ${FILESDIR}/eselect.cblas-threaded threaded-atlas
126 fi
127
128 insinto "${DESTTREE}"/include/atlas
129 doins "${S}"/include/cblas.h "${S}"/include/atlas_misc.h \
130 "${S}"/include/atlas_enum.h || \
131 die "failed to install headers"
132
133 # These headers contain the architecture-specific
134 # optimizations determined by ATLAS. The atlas-lapack build
135 # is much shorter if they are available, so save them:
136 doins ${BLD_DIR}/include/*.h || \
137 die "failed to install timing headers"
138
139 #some docs
140 cd "${S}"
141 dodoc README doc/{AtlasCredits.txt,ChangeLog}
142 use doc && dodoc doc/*.ps
143 }
144
145 pkg_postinst() {
146 local THREADED
147
148 if [ -d "${RPATH}"/threaded-atlas ]
149 then
150 THREADED="threaded-"
151 fi
152 if [[ -z "$(eselect blas show)" ]]; then
153 eselect blas set ${THREADED}atlas
154 fi
155 if [[ -z "$(eselect cblas show)" ]]; then
156 eselect cblas set ${THREADED}atlas
157 fi
158
159 elog
160 elog "Fortran users link using -lblas"
161 elog
162 elog "C users compile against the header ${ROOT}usr/include/atlas/cblas.h and"
163 elog "link using -lcblas"
164 elog
165 elog "If using threaded ATLAS, you may also need to link with -lpthread."
166 elog
167 elog "Configuration now uses eselect rather than blas-config."
168 }

  ViewVC Help
Powered by ViewVC 1.1.20