/[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.11 - (hide annotations) (download)
Fri Sep 5 20:49:03 2008 UTC (11 years, 11 months ago) by bicatali
Branch: MAIN
CVS Tags: HEAD
Changes since 1.10: +1 -1 lines
FILE REMOVED
Removed old versions
(Portage version: 2.2_rc8/cvs/Linux 2.6.23-gentoo-r9 x86_64)

1 kugelfang 1.4 # Copyright 1999-2007 Gentoo Foundation
2 spyderous 1.1 # Distributed under the terms of the GNU General Public License v2
3 bicatali 1.11 # $Header: /var/cvsroot/gentoo-x86/sci-libs/blas-atlas/blas-atlas-3.6.0-r2.ebuild,v 1.10 2007/10/11 17:03:20 bicatali Exp $
4 spyderous 1.1
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 opfer 1.8 KEYWORDS="~alpha ~amd64 ~ppc ppc64 sparc x86"
16 spyderous 1.1 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 bicatali 1.10 S="${WORKDIR}/ATLAS"
24 spyderous 1.1
25 kugelfang 1.4 # Libraries will be installed in ${RPATH}/atlas
26 spyderous 1.1 # and ${RPATH}/threaded-atlas:
27     RPATH="${DESTTREE}/lib/blas"
28    
29     pkg_setup() {
30 kugelfang 1.4 if [[ -z `type -P g77` ]]; then
31 spyderous 1.1 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 bicatali 1.10 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 spyderous 1.1 }
40    
41     src_unpack() {
42     unpack ${A}
43    
44 markusle 1.9 cd "${S}"
45 spyderous 1.1
46 markusle 1.9 epatch "${FILESDIR}"/unbuffered.patch
47     epatch "${DISTDIR}"/atlas3.6.0-shared-libs.1.patch.bz2
48     epatch "${FILESDIR}"/${PV}-ppc-configure.patch
49 spyderous 1.1 sed -i -e "s:ASM:ASM VOLATILE:" include/contrib/camm_dpa.h || die "sed failed to fix clobbering"
50 markusle 1.9 cp "${FILESDIR}"/war "${S}"
51     chmod a+x "${S}"/war
52 spyderous 1.1 }
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 markusle 1.9 cd "${S}"/gentoo/libs
130     cp -P libatlas* "${D}/${DESTTREE}"/lib
131     cp -P *blas* "${D}/${RPATH}"/atlas #the rest really
132 spyderous 1.1
133 markusle 1.9 eselect blas add $(get_libdir) "${FILESDIR}"/eselect.blas atlas
134     eselect cblas add $(get_libdir) "${FILESDIR}"/eselect.cblas atlas
135 spyderous 1.1
136 markusle 1.9 if [ -d "${S}"/gentoo/threaded-libs ]
137 spyderous 1.1 then
138     dodir ${RPATH}/threaded-atlas
139 markusle 1.9 cd "${S}"/gentoo/threaded-libs
140     cp -P * "${D}/${RPATH}"/threaded-atlas
141     eselect blas add $(get_libdir) "${FILESDIR}"/eselect.blas-threaded threaded-atlas
142     eselect cblas add $(get_libdir) "${FILESDIR}"/eselect.cblas-threaded threaded-atlas
143 spyderous 1.1 fi
144    
145     insinto ${DESTTREE}/include/atlas
146 markusle 1.9 doins "${S}"/include/cblas.h "${S}"/include/atlas_misc.h
147     doins "${S}"/include/atlas_enum.h
148 spyderous 1.1
149     # These headers contain the architecture-specific optimizations determined
150     # by ATLAS. The atlas-lapack build is much shorter if they are available,
151     # so save them:
152 markusle 1.9 doins "${S}"/include/${ATLAS_ARCH}/*.h
153 spyderous 1.1
154     #some docs
155 markusle 1.9 cd "${S}"
156 spyderous 1.1 dodoc README doc/{AtlasCredits.txt,ChangeLog}
157     use doc && dodoc doc/*.ps
158     }
159    
160     pkg_postinst() {
161     local THREADED
162    
163     if [ -d ${RPATH}/threaded-atlas ]
164     then
165     THREADED="threaded-"
166     fi
167     if [[ -z "$(eselect blas show)" ]]; then
168     eselect blas set ${THREADED}atlas
169     fi
170     if [[ -z "$(eselect cblas show)" ]]; then
171     eselect cblas set ${THREADED}atlas
172     fi
173    
174 dberkholz 1.2 elog
175     elog "Fortran users link using -lblas"
176     elog
177 markusle 1.9 elog "C users compile against the header "${ROOT}"usr/include/atlas/cblas.h and"
178 dberkholz 1.2 elog "link using -lcblas"
179     elog
180     elog "If using threaded ATLAS, you may also need to link with -lpthread."
181 dberkholz 1.3 elog
182     elog "Configuration now uses eselect rather than blas-config."
183 spyderous 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20