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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Tue Jul 17 13:44:50 2007 UTC (13 years ago) by corsair
Branch: MAIN
Changes since 1.6: +2 -2 lines
Stable on ppc64; bug #180713
(Portage version: 2.1.2.9)

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

  ViewVC Help
Powered by ViewVC 1.1.20