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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Wed Oct 10 10:02:14 2007 UTC (12 years, 9 months ago) by markusle
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +1 -1 lines
FILE REMOVED
Version bump and removed old ebuilds. Also fixed missing quoting in all ebuilds.
(Portage version: 2.1.3.12)

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

  ViewVC Help
Powered by ViewVC 1.1.20