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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (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.3: +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.7.31.ebuild,v 1.3 2007/07/13 06:57:51 mr_bones_ Exp $
4
5 inherit eutils toolchain-funcs fortran
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/${MY_PN}-3.7.23-shared-libs.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 PROVIDE="virtual/blas"
23
24 S="${WORKDIR}/ATLAS"
25 BLD_DIR="${S}/gentoo-build"
26 RPATH="${DESTTREE}/$(get_libdir)/blas"
27 FORTRAN="g77 gfortran"
28
29 pkg_setup() {
30 fortran_pkg_setup
31 echo
32 ewarn "Please make sure to disable CPU throttling completely"
33 ewarn "during the compile of blas-atlas. Otherwise, all atlas"
34 ewarn "generated timings will be completely random and the"
35 ewarn "performance of the resulting libraries will be degraded"
36 ewarn "considerably."
37 echo
38 ewarn "For users of <=gcc-4.1.1 only:"
39 ewarn "If you experience failing SANITY tests during"
40 ewarn "atlas' compile please try passing -mfpmath=387; this"
41 ewarn "option might also result in much better performance"
42 ewarn "than using then sse instruction set depending on your"
43 ewarn "CPU."
44 echo
45 epause 10
46 }
47
48 src_unpack() {
49 unpack ${A}
50 cd ${S}
51
52 epatch "${DISTDIR}"/${MY_PN}-3.7.23-shared-libs.patch.bz2
53 epatch "${FILESDIR}"/${MY_PN}-asm-gentoo.patch
54
55 # make sure shared libs link against proper libraries
56 if [[ ${FORTRANC} == "gfortran" ]]; then
57 libs="${LDFLAGS} -lpthread -lgfortran"
58 else
59 libs="${LDFLAGS} -lpthread -lg2c"
60 fi
61
62 #increase amount of workspace to improve threaded performance
63 sed -e "s:16777216:167772160:" -i include/atlas_lvl3.h ||
64 die "Failed to fix ATL_MaxMalloc"
65
66 sed -e "s:SHRD_LNK:${libs}:g" -i Make.top || \
67 die "Failed to add addtional libs to shared object build"
68
69 sed -e "s:= gcc:= $(tc-getCC) ${CFLAGS}:" \
70 -i CONFIG/src/SpewMakeInc.c || die "Failed to fix Spewmake"
71
72 mkdir ${BLD_DIR} || die "failed to generate build directory"
73 cp "${FILESDIR}"/war ${BLD_DIR} && chmod a+x ${BLD_DIR}/war || \
74 die "failed to install war"
75
76 # force proper 32/64bit libs
77 local archselect
78 if [[ "${ARCH}" == "amd64" || "${ARCH}" == "ppc64" ]]; then
79 archselect="-b 64"
80 elif [ "${ARCH}" == "alpha" ]; then
81 archselect=""
82 else
83 archselect="-b 32"
84 fi
85
86 # set up compiler/flags using atlas' native configure
87 local compdefs
88 compdefs="${compdefs} -C xc '$(tc-getCC)' -F xc '${CFLAGS}'"
89 compdefs="${compdefs} -C ic '$(tc-getCC)' -F ic '${CFLAGS}'"
90 compdefs="${compdefs} -C sk '$(tc-getCC)' -F sk '${CFLAGS}'"
91 compdefs="${compdefs} -C dk '$(tc-getCC)' -F dk '${CFLAGS}'"
92 compdefs="${compdefs} -C sm '$(tc-getCC)' -F sm '${CFLAGS}'"
93 compdefs="${compdefs} -C dm '$(tc-getCC)' -F dm '${CFLAGS}'"
94 compdefs="${compdefs} -C if '${FORTRANC}' -F if '${FFLAGS}'"
95 compdefs="${compdefs} -Ss pmake '\$(MAKE) ${MAKEOPTS}'"
96 compdefs="${compdefs} -Si cputhrchk 0 ${archselect}"
97
98 cd ${BLD_DIR} && ../configure ${compdefs} \
99 || die "configure failed"
100 }
101
102 src_compile() {
103 cd ${BLD_DIR}
104 emake -j1 || die "make failed"
105
106 make shared-strip RPATH=${RPATH}/atlas || \
107 die "failed to build shared libraries"
108
109 # build shared libraries of threaded libraries if applicable
110 if [ -d gentoo/libptf77blas.a ]; then
111 make ptshared-strip RPATH=${RPATH}/threaded-atlas || \
112 die "failed to build threaded shared libraries"
113 fi
114 }
115
116 src_install () {
117 dodir "${RPATH}"/atlas
118 cd ${BLD_DIR}/gentoo/libs
119 cp -P libatlas* "${D}/${DESTTREE}/$(get_libdir)" || \
120 die "Failed to install libatlas"
121 cp -P *blas* "${D}/${RPATH}"/atlas || \
122 die "Failed to install blas/cblas"
123
124 eselect blas add $(get_libdir) ${FILESDIR}/eselect.blas atlas
125 eselect cblas add $(get_libdir) ${FILESDIR}/eselect.cblas atlas
126
127 if [ -d ${BLD_DIR}/gentoo/threaded-libs ]
128 then
129 dodir "${RPATH}"/threaded-atlas
130 cd ${BLD_DIR}/gentoo/threaded-libs
131 cp -P * "${D}/${RPATH}"/threaded-atlas || \
132 die "Failed to install threaded atlas"
133
134 eselect blas add $(get_libdir) ${FILESDIR}/eselect.blas-threaded threaded-atlas
135 eselect cblas add $(get_libdir) ${FILESDIR}/eselect.cblas-threaded threaded-atlas
136 fi
137
138 insinto "${DESTTREE}"/include/atlas
139 doins "${S}"/include/cblas.h "${S}"/include/atlas_misc.h \
140 "${S}"/include/atlas_enum.h || \
141 die "failed to install headers"
142
143 # These headers contain the architecture-specific
144 # optimizations determined by ATLAS. The atlas-lapack build
145 # is much shorter if they are available, so save them:
146 doins ${BLD_DIR}/include/*.h || \
147 die "failed to install timing headers"
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 local THREADED
157
158 if [ -d "${RPATH}"/threaded-atlas ]
159 then
160 THREADED="threaded-"
161 fi
162 if [[ -z "$(eselect blas show)" ]]; then
163 eselect blas set ${THREADED}atlas
164 fi
165 if [[ -z "$(eselect cblas show)" ]]; then
166 eselect cblas set ${THREADED}atlas
167 fi
168
169 elog
170 elog "Fortran users link using -lblas"
171 elog
172 elog "C users compile against the header ${ROOT}usr/include/atlas/cblas.h and"
173 elog "link using -lcblas"
174 elog
175 elog "If using threaded ATLAS, you may also need to link with -lpthread."
176 elog
177 elog "Configuration now uses eselect rather than blas-config."
178 }

  ViewVC Help
Powered by ViewVC 1.1.20