/[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.4 - (show annotations) (download)
Sat May 19 02:21:03 2007 UTC (13 years, 4 months ago) by markusle
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Version bump and removed old version.
(Portage version: 2.1.2.7)

1 # Copyright 1999-2007 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.24.ebuild,v 1.3 2007/03/03 15:45:17 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 "For users of <=gcc-4.1.1 only:"
41 ewarn "If you experience failing SANITY tests during"
42 ewarn "atlas' compile please try passing -mfpmath=387; this"
43 ewarn "option might also result in much better performance"
44 ewarn "than using then sse instruction set depending on your"
45 ewarn "CPU."
46 echo
47 epause 10
48 }
49
50 src_unpack() {
51 unpack ${A}
52 cd ${S}
53
54 epatch "${DISTDIR}"/${MY_PN}-3.7.23-shared-libs.patch.bz2
55 epatch "${FILESDIR}"/${MY_PN}-asm-gentoo.patch
56
57 # make sure shared libs link against proper libraries
58 if [[ ${FORTRANC} == "gfortran" ]]; then
59 libs="${LDFLAGS} -lpthread -lgfortran"
60 else
61 libs="${LDFLAGS} -lpthread -lg2c"
62 fi
63 sed -e "s/SHRD_LNK/${libs}/g" -i Make.top || \
64 die "Failed to add addtional libs to shared object build"
65
66 mkdir ${BLD_DIR} || die "failed to generate build directory"
67 cp "${FILESDIR}"/war ${BLD_DIR} && chmod a+x ${BLD_DIR}/war || \
68 die "failed to install war"
69
70 # force proper 32/64bit libs
71 local archselect
72 if [[ "${ARCH}" == "amd64" || "${ARCH}" == "ppc64" ]]; then
73 archselect="-b 64"
74 elif [ "${ARCH}" == "alpha" ]; then
75 archselect=""
76 else
77 archselect="-b 32"
78 fi
79
80 # set up compiler/flags using atlas' native configure
81 local compdefs
82 compdefs="${compdefs} -C xc '$(tc-getCC)' -F xc '${CFLAGS}'"
83 compdefs="${compdefs} -C ic '$(tc-getCC)' -F ic '${CFLAGS}'"
84 compdefs="${compdefs} -C sk '$(tc-getCC)' -F sk '${CFLAGS}'"
85 compdefs="${compdefs} -C dk '$(tc-getCC)' -F dk '${CFLAGS}'"
86 compdefs="${compdefs} -C sm '$(tc-getCC)' -F sm '${CFLAGS}'"
87 compdefs="${compdefs} -C dm '$(tc-getCC)' -F dm '${CFLAGS}'"
88 compdefs="${compdefs} -C if '${FORTRANC}' -F if '${FFLAGS}'"
89 compdefs="${compdefs} -Ss pmake '\$(MAKE) ${MAKEOPTS}'"
90 compdefs="${compdefs} -Si cputhrchk 0 ${archselect}"
91
92 cd ${BLD_DIR} && ../configure ${compdefs} \
93 || die "configure failed"
94 }
95
96 src_compile() {
97 cd ${BLD_DIR}
98 emake -j1 || die "make failed"
99
100 make shared-strip RPATH=${RPATH}/atlas || \
101 die "failed to build shared libraries"
102
103 # build shared libraries of threaded libraries if applicable
104 if [ -d gentoo/libptf77blas.a ]; then
105 make ptshared-strip RPATH=${RPATH}/threaded-atlas || \
106 die "failed to build threaded shared libraries"
107 fi
108 }
109
110 src_install () {
111 dodir "${RPATH}"/atlas
112 cd ${BLD_DIR}/gentoo/libs
113 cp -P libatlas* "${D}/${DESTTREE}/$(get_libdir)" || \
114 die "Failed to install libatlas"
115 cp -P *blas* "${D}/${RPATH}"/atlas || \
116 die "Failed to install blas/cblas"
117
118 eselect blas add $(get_libdir) ${FILESDIR}/eselect.blas atlas
119 eselect cblas add $(get_libdir) ${FILESDIR}/eselect.cblas atlas
120
121 if [ -d ${BLD_DIR}/gentoo/threaded-libs ]
122 then
123 dodir "${RPATH}"/threaded-atlas
124 cd ${BLD_DIR}/gentoo/threaded-libs
125 cp -P * "${D}/${RPATH}"/threaded-atlas || \
126 die "Failed to install threaded atlas"
127
128 eselect blas add $(get_libdir) ${FILESDIR}/eselect.blas-threaded threaded-atlas
129 eselect cblas add $(get_libdir) ${FILESDIR}/eselect.cblas-threaded threaded-atlas
130 fi
131
132 insinto "${DESTTREE}"/include/atlas
133 doins "${S}"/include/cblas.h "${S}"/include/atlas_misc.h \
134 "${S}"/include/atlas_enum.h || \
135 die "failed to install headers"
136
137 # These headers contain the architecture-specific
138 # optimizations determined by ATLAS. The atlas-lapack build
139 # is much shorter if they are available, so save them:
140 doins ${BLD_DIR}/include/*.h || \
141 die "failed to install timing headers"
142
143 #some docs
144 cd "${S}"
145 dodoc README doc/{AtlasCredits.txt,ChangeLog}
146 use doc && dodoc doc/*.ps
147 }
148
149 pkg_postinst() {
150 local THREADED
151
152 if [ -d "${RPATH}"/threaded-atlas ]
153 then
154 THREADED="threaded-"
155 fi
156 if [[ -z "$(eselect blas show)" ]]; then
157 eselect blas set ${THREADED}atlas
158 fi
159 if [[ -z "$(eselect cblas show)" ]]; then
160 eselect cblas set ${THREADED}atlas
161 fi
162
163 elog
164 elog "Fortran users link using -lblas"
165 elog
166 elog "C users compile against the header ${ROOT}usr/include/atlas/cblas.h and"
167 elog "link using -lcblas"
168 elog
169 elog "If using threaded ATLAS, you may also need to link with -lpthread."
170 elog
171 elog "Configuration now uses eselect rather than blas-config."
172 }

  ViewVC Help
Powered by ViewVC 1.1.20