/[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.1 - (hide annotations) (download)
Mon Jul 3 08:04:29 2006 UTC (14 years, 1 month ago) by spyderous
Branch: MAIN
Bumps to switch to new eselect modules.
(Portage version: 2.1.1_pre1-r5)

1 spyderous 1.1 # Copyright 1999-2006 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.11 2006/06/17 00:34:47 lu_zero 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    
24     PROVIDE="virtual/blas"
25    
26     S=${WORKDIR}/ATLAS
27    
28     # Libraries will be installed in ${RPATH}/atlas
29     # and ${RPATH}/threaded-atlas:
30     RPATH="${DESTTREE}/lib/blas"
31    
32    
33     pkg_setup() {
34     if [ -z `which g77` ]; then
35     eerror "No fortran compiler found on the system!"
36     eerror "Please add fortran to your USE flags and reemerge gcc!"
37     die
38     fi
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     eselect blas add $(get_libdir) ${FILESDIR}/eselect.blas atlas
134     eselect cblas add $(get_libdir) ${FILESDIR}/eselect.cblas 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     eselect blas add $(get_libdir) ${FILESDIR}/eselect.blas-threaded threaded-atlas
142     eselect cblas add $(get_libdir) ${FILESDIR}/eselect.cblas-threaded threaded-atlas
143     fi
144    
145     insinto ${DESTTREE}/include/atlas
146     doins ${S}/include/cblas.h ${S}/include/atlas_misc.h
147     doins ${S}/include/atlas_enum.h
148    
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     doins ${S}/include/${ATLAS_ARCH}/*.h
153    
154     #some docs
155     cd ${S}
156     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     einfo
175     einfo "Fortran users link using -lblas"
176     einfo
177     einfo "C users compile against the header ${ROOT}usr/include/atlas/cblas.h and"
178     einfo "link using -lcblas"
179     einfo
180     einfo "If using threaded ATLAS, you may also need to link with -lpthread."
181     }

  ViewVC Help
Powered by ViewVC 1.1.20