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

Contents of /sci-libs/blas-atlas/blas-atlas-3.6.0-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.16 - (show annotations) (download)
Fri Sep 5 20:49:03 2008 UTC (11 years, 10 months ago) by bicatali
Branch: MAIN
CVS Tags: HEAD
Changes since 1.15: +1 -1 lines
FILE REMOVED
Removed old versions
(Portage version: 2.2_rc8/cvs/Linux 2.6.23-gentoo-r9 x86_64)

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.6.0-r1.ebuild,v 1.15 2007/10/11 17:03:20 bicatali Exp $
4
5 inherit eutils toolchain-funcs
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/atlas${PV}-shared-libs.1.patch.bz2"
12
13 LICENSE="BSD"
14 SLOT="0"
15 KEYWORDS="alpha amd64 ppc ppc64 sparc x86"
16 IUSE="doc"
17
18 DEPEND="sci-libs/blas-config
19 >=sys-devel/libtool-1.5"
20
21 RDEPEND=""
22
23 S="${WORKDIR}/ATLAS"
24
25 # Libraries will be installed in ${RPATH}/atlas
26 # and ${RPATH}/threaded-atlas:
27 RPATH="${DESTTREE}/lib/blas"
28
29 pkg_setup() {
30 if [[ -z `type -P g77` ]]; then
31 eerror "No fortran compiler found on the system!"
32 eerror "Please add fortran to your USE flags and reemerge gcc!"
33 die
34 fi
35 ewarn "You probably want to go for testing ${PN}, this version"
36 ewarn "is particurlaly buggy, does not provide virtuals, and will go away soon."
37 ewarn "Try ${PN} >= 3.7.39 for a working blas/cblas"
38 epause 5
39 }
40
41 src_unpack() {
42 unpack ${A}
43
44 cd "${S}"
45
46 epatch "${FILESDIR}"/unbuffered.patch
47 epatch "${DISTDIR}"/atlas3.6.0-shared-libs.1.patch.bz2
48 epatch "${FILESDIR}"/${PV}-ppc-configure.patch
49 sed -i -e "s:ASM:ASM VOLATILE:" include/contrib/camm_dpa.h || die "sed failed to fix clobbering"
50 cp "${FILESDIR}"/war "${S}"
51 chmod a+x "${S}"/war
52 }
53
54 atlas_fail() {
55 eerror
56 eerror "ATLAS auto-config failed."
57 eerror "Please run 'interactive=1 emerge blas-atlas' to configure manually."
58 eerror
59 die "ATLAS auto-config failed."
60 }
61
62 # Added to allow compilation on sparc architecture. The default CCFLAG0
63 # and MMFLAGS are *bad*.
64 # Danny van Dyk <kugelfang@gentoo.org> 2004/07/02
65 #
66 reconfigure() {
67 case "`uname -p`" in
68 "sun4m")
69 MY_CCFLAGS="-O3 -mcpu=v8"
70 MY_CXXFLAGS="${MY_CCFLAGS}"
71 MY_MMFLAGS="-O -mcpu=v8"
72 MY_LDFLAGS=""
73 ;;
74 "sun4u")
75 MY_CCFLAGS="-O3 -mcpu=ultrasparc"
76 MY_CXXFLAGS="${MY_CCFLAGS}"
77 MY_MMFLAGS="-O -mcpu=ultrasparc"
78 MY_LDFLAGS=""
79 ;;
80 *)
81 MY_CCFLAGS="${CFLAGS}"
82 MY_CXXFLAGS="${CXXFLAGS}"
83 MY_MMFLAGS="${CFLAGS}"
84 MY_LDFLAGS="${LDFLAGS}"
85 ;;
86 esac
87
88 MY_FILE="`find -name Make.Linux*`"
89
90 sed -i -e "s/CCFLAG0 =.*/CCFLAG0 = \$(CDEFS) ${MY_CCFLAGS}/" \
91 -e "s/CCFLAGS =.*/CCFLAGS = \$(CDEFS) ${MY_CCFLAGS}/" \
92 -e "s/CLINKFLAGS =.*/CLINKFLAGS =\$(CDEFS) ${MY_LDFLAGS}/" \
93 -e "s/XCCFLAGS =.*/XCCFLAGS =\$(CDEFS) ${MY_CXXFLAGS}/" \
94 -e "s/MMFLAGS =.*/MMFLAGS = ${MY_MMFLAGS}/" \
95 ${MY_FILE} || die "sed didnt complete"
96
97 }
98
99 src_compile() {
100 if [ -n "${interactive}" ]
101 then
102 echo "${interactive}"
103 make config CC="$(tc-getCC) -DUSE_LIBTOOL -DINTERACTIVE" || die
104 else
105 # Use ATLAS defaults for all questions:
106 (echo | make config CC="$(tc-getCC) -DUSE_LIBTOOL") || atlas_fail
107 fi
108
109 reconfigure
110
111 TMPSTR=$(ls Make.Linux*)
112 ATLAS_ARCH=${TMPSTR#'Make.'}
113
114 make install arch=${ATLAS_ARCH} || die
115
116 make shared-strip arch=${ATLAS_ARCH} RPATH=${RPATH}/atlas || die
117
118 # Build shared versions of the threaded libs.
119 # ATLAS only compiles threaded libs on multiprocessor machines.
120 if [ -d gentoo/libptf77blas.a ]
121 then
122 make ptshared-strip \
123 arch=${ATLAS_ARCH} RPATH=${RPATH}/threaded-atlas || die
124 fi
125 }
126
127 src_install () {
128 dodir ${RPATH}/atlas
129 cd "${S}"/gentoo/libs
130 cp -P libatlas* "${D}/${DESTTREE}"/lib
131 cp -P *blas* "${D}/${RPATH}"/atlas #the rest really
132
133 insinto ${RPATH}
134 doins "${FILESDIR}"/c-ATLAS "${FILESDIR}"/f77-ATLAS
135
136 if [ -d "${S}"/gentoo/threaded-libs ]
137 then
138 dodir ${RPATH}/threaded-atlas
139 cd "${S}"/gentoo/threaded-libs
140 cp -P * "${D}/${RPATH}"/threaded-atlas
141 doins "${FILESDIR}"/c-threaded-ATLAS "${FILESDIR}"/f77-threaded-ATLAS
142 fi
143
144 insinto ${DESTTREE}/include/atlas
145 doins "${S}"/include/cblas.h "${S}"/include/atlas_misc.h
146 doins "${S}"/include/atlas_enum.h
147
148 # These headers contain the architecture-specific optimizations determined
149 # by ATLAS. The atlas-lapack build is much shorter if they are available,
150 # so save them:
151 doins "${S}"/include/${ATLAS_ARCH}/*.h
152
153 #some docs
154 cd "${S}"
155 dodoc README doc/{AtlasCredits.txt,ChangeLog}
156 use doc && dodoc doc/*.ps
157 }
158
159 pkg_postinst() {
160 if [ -d ${RPATH}/threaded-atlas ]
161 then
162 ${DESTTREE}/bin/blas-config threaded-ATLAS
163 else
164 ${DESTTREE}/bin/blas-config ATLAS
165 fi
166
167 einfo
168 einfo "Fortran users link using -lblas"
169 einfo
170 einfo "C users compile against the header /usr/include/atlas/cblas.h and"
171 einfo "link using -lcblas"
172 einfo
173 }

  ViewVC Help
Powered by ViewVC 1.1.20