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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Tue Dec 19 23:09:21 2006 UTC (13 years, 9 months ago) by markusle
Branch: MAIN
Version bump.
(Portage version: 2.1.2_rc3-r4)

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.23.ebuild,v 1.2 2006/12/12 13:20:57 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}-3.7.23-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}-3.7.23-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} -Ss pmake '\$(MAKE) ${MAKEOPTS}'"
87 compdefs="${compdefs} -Si cputhrchk 0 ${archselect}"
88
89 cd ${BLD_DIR} && ../configure ${compdefs} \
90 || die "configure failed"
91 }
92
93 src_compile() {
94 cd ${BLD_DIR}
95 emake -j1 || die "make failed"
96
97 make shared-strip RPATH=${RPATH}/atlas || \
98 die "failed to build shared libraries"
99
100 # build shared libraries of threaded libraries if applicable
101 if [ -d gentoo/libptf77blas.a ]; then
102 make ptshared-strip RPATH=${RPATH}/threaded-atlas || \
103 die "failed to build threaded shared libraries"
104 fi
105 }
106
107 src_install () {
108 dodir "${RPATH}"/atlas
109 cd ${BLD_DIR}/gentoo/libs
110 cp -P libatlas* "${D}/${DESTTREE}/$(get_libdir)" || \
111 die "Failed to install libatlas"
112 cp -P *blas* "${D}/${RPATH}"/atlas || \
113 die "Failed to install blas/cblas"
114
115 eselect blas add $(get_libdir) ${FILESDIR}/eselect.blas atlas
116 eselect cblas add $(get_libdir) ${FILESDIR}/eselect.cblas atlas
117
118 if [ -d ${BLD_DIR}/gentoo/threaded-libs ]
119 then
120 dodir "${RPATH}"/threaded-atlas
121 cd ${BLD_DIR}/gentoo/threaded-libs
122 cp -P * "${D}/${RPATH}"/threaded-atlas || \
123 die "Failed to install threaded atlas"
124
125 eselect blas add $(get_libdir) ${FILESDIR}/eselect.blas-threaded threaded-atlas
126 eselect cblas add $(get_libdir) ${FILESDIR}/eselect.cblas-threaded threaded-atlas
127 fi
128
129 insinto "${DESTTREE}"/include/atlas
130 doins "${S}"/include/cblas.h "${S}"/include/atlas_misc.h \
131 "${S}"/include/atlas_enum.h || \
132 die "failed to install headers"
133
134 # These headers contain the architecture-specific
135 # optimizations determined by ATLAS. The atlas-lapack build
136 # is much shorter if they are available, so save them:
137 doins ${BLD_DIR}/include/*.h || \
138 die "failed to install timing headers"
139
140 #some docs
141 cd "${S}"
142 dodoc README doc/{AtlasCredits.txt,ChangeLog}
143 use doc && dodoc doc/*.ps
144 }
145
146 pkg_postinst() {
147 local THREADED
148
149 if [ -d "${RPATH}"/threaded-atlas ]
150 then
151 THREADED="threaded-"
152 fi
153 if [[ -z "$(eselect blas show)" ]]; then
154 eselect blas set ${THREADED}atlas
155 fi
156 if [[ -z "$(eselect cblas show)" ]]; then
157 eselect cblas set ${THREADED}atlas
158 fi
159
160 elog
161 elog "Fortran users link using -lblas"
162 elog
163 elog "C users compile against the header ${ROOT}usr/include/atlas/cblas.h and"
164 elog "link using -lcblas"
165 elog
166 elog "If using threaded ATLAS, you may also need to link with -lpthread."
167 elog
168 elog "Configuration now uses eselect rather than blas-config."
169 }

  ViewVC Help
Powered by ViewVC 1.1.20