summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonnie Berkholz <spyderous@gentoo.org>2006-03-21 19:32:31 +0000
committerDonnie Berkholz <spyderous@gentoo.org>2006-03-21 19:32:31 +0000
commit526cf6a9d3db74116c38ab3b97b457beb7933131 (patch)
tree85aefe81a7a411bc6ba94c424b37b568aebac124 /sci-libs/lapack-atlas
parent(#121855) Allow compilation with gcc-4. Also at least partially fix compilati... (diff)
downloadgentoo-2-526cf6a9d3db74116c38ab3b97b457beb7933131.tar.gz
gentoo-2-526cf6a9d3db74116c38ab3b97b457beb7933131.tar.bz2
gentoo-2-526cf6a9d3db74116c38ab3b97b457beb7933131.zip
(#121855) Allow compilation with gcc-4. Also at least partially fix compilation with non-gcc compilers (e.g. ifc). You will now need to pass FC to use a non-default Fortran compiler.
(Portage version: 2.1_pre6-r3)
Diffstat (limited to 'sci-libs/lapack-atlas')
-rw-r--r--sci-libs/lapack-atlas/ChangeLog8
-rw-r--r--sci-libs/lapack-atlas/files/3.7.11-allow-any-gcc-version.patch15
-rw-r--r--sci-libs/lapack-atlas/lapack-atlas-3.7.11.ebuild60
3 files changed, 67 insertions, 16 deletions
diff --git a/sci-libs/lapack-atlas/ChangeLog b/sci-libs/lapack-atlas/ChangeLog
index 968d4558f624..f39a71d8eefb 100644
--- a/sci-libs/lapack-atlas/ChangeLog
+++ b/sci-libs/lapack-atlas/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sci-libs/lapack-atlas
# Copyright 2004-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-libs/lapack-atlas/ChangeLog,v 1.10 2006/01/11 16:24:45 markusle Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/lapack-atlas/ChangeLog,v 1.11 2006/03/21 19:32:31 spyderous Exp $
+
+ 21 Mar 2006; Donnie Berkholz <spyderous@gentoo.org>;
+ +files/3.7.11-allow-any-gcc-version.patch, lapack-atlas-3.7.11.ebuild:
+ (#121855) Allow compilation with gcc-4. Also at least partially fix
+ compilation with non-gcc compilers (e.g. ifc). You will now need to pass FC
+ to use a non-default Fortran compiler.
11 Jan 2006; Markus Dittrich <markusle@gentoo.org>
lapack-atlas-3.6.0.ebuild, lapack-atlas-3.6.0-r1.ebuild:
diff --git a/sci-libs/lapack-atlas/files/3.7.11-allow-any-gcc-version.patch b/sci-libs/lapack-atlas/files/3.7.11-allow-any-gcc-version.patch
new file mode 100644
index 000000000000..6dfd33ab74af
--- /dev/null
+++ b/sci-libs/lapack-atlas/files/3.7.11-allow-any-gcc-version.patch
@@ -0,0 +1,15 @@
+diff -urN ATLAS.orig/config.c ATLAS/config.c
+--- ATLAS.orig/config.c 2006-01-16 19:08:16.000000000 -0800
++++ ATLAS/config.c 2006-01-16 19:27:22.000000000 -0800
+@@ -712,11 +712,6 @@
+ gcc, major, minor, patch);
+ if (major == -1)
+ iret = 0;
+- else if ( MachIsX86(mach) ) /* don't use gcc 2.96 - 3.0 */
+- {
+- if ((major == 2 && minor < 96) || (major == 3 && minor > 1))
+- iret = 1;
+- }
+ else if (mach == IA64Itan || mach == IA64Itan2 || MachIsUS(mach) ||
+ mach == Dec21164 || mach == Dec21264)
+ {
diff --git a/sci-libs/lapack-atlas/lapack-atlas-3.7.11.ebuild b/sci-libs/lapack-atlas/lapack-atlas-3.7.11.ebuild
index 7a173e389ea6..201a568cd11f 100644
--- a/sci-libs/lapack-atlas/lapack-atlas-3.7.11.ebuild
+++ b/sci-libs/lapack-atlas/lapack-atlas-3.7.11.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sci-libs/lapack-atlas/lapack-atlas-3.7.11.ebuild,v 1.1 2006/01/11 16:13:37 markusle Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/lapack-atlas/lapack-atlas-3.7.11.ebuild,v 1.2 2006/03/21 19:32:31 spyderous Exp $
inherit eutils flag-o-matic toolchain-funcs fortran
@@ -31,7 +31,7 @@ RDEPEND="virtual/libc
PROVIDE="virtual/lapack"
-FORTRAN="g77 ifc"
+FORTRAN="g77 gfortran ifc"
S="${WORKDIR}/ATLAS"
S_LAPACK="${WORKDIR}/LAPACK"
@@ -65,11 +65,27 @@ src_unpack() {
cd "${WORKDIR}"
epatch "${FILESDIR}"/unbuffered.patch
+ epatch "${FILESDIR}"/${PV}-allow-any-gcc-version.patch
epatch "${DISTDIR}"/atlas3.6.0-shared-libs.1.patch.bz2
epatch "${DISTDIR}"/lapack-20020531-20021004.patch.bz2
epatch "${DISTDIR}"/lapack-gentoo.patch
cp "${FILESDIR}"/war "${S}"
chmod a+x "${S}"/war
+
+ einfo "Making ${PN} respect compiler settings"
+ sed -i \
+ -e "s:\(\t./xconfig\):\1 -m $(tc-getCC) -c $(tc-getCC) -f ${FORTRANC}:g" \
+ ${S}/Makefile \
+ || die "Failed to fix compilers"
+
+ if [[ $(gcc-major-version) -ge 4 ]]; then
+ einfo "Updating Makefiles for gcc-4"
+ sed -i \
+ -e "s:g2c:gfortran:g" \
+ ${S}/Make.top \
+ ${S}/makes/Make.lib \
+ || die "Failed to update for gcc-4"
+ fi
}
atlas_fail() {
@@ -94,26 +110,27 @@ src_compile() {
TMPSTR=$(ls Make.Linux*)
ATLAS_ARCH=${TMPSTR#'Make.'}
- CC="libtool --mode=compile --tag=CC $(tc-getCC) -I/usr/include/atlas"
+ GENTOO_CC="libtool --mode=compile --tag=CC $(tc-getCC) -I/usr/include/atlas"
cd "${S}"/src/lapack/${ATLAS_ARCH}
- make lib CC="${CC}" || die
+ make lib CC="${GENTOO_CC}" \
+ || die "Failed to make lib in ${S}/src/lapack/${ATLAS_ARCH}"
cd "${S}"/interfaces/lapack/C/src/${ATLAS_ARCH}
- make lib CC="${CC}" || die
+ make lib CC="${GENTOO_CC}" \
+ || die "Failed to make lib in ${S}/interfaces/lapack/C/src/${ATLAS_ARCH}"
cd "${S}"/interfaces/lapack/F77/src/${ATLAS_ARCH}
- make lib CC="${CC}" F77="libtool --mode=compile --tag=F77 g77" || die
+ make lib CC="${GENTOO_CC}" F77="libtool --mode=compile --tag=F77 ${FORTRANC}" \
+ || die "Failed to make lib in ${S}/interfaces/lapack/F77/src/${ATLAS_ARCH}"
cd "${S_LAPACK}"
if use ifc; then
- FC="ifc"
FFLAGS="${IFCFLAGS}"
NOOPT="-O0" # Do NOT change this. It is applied to two files with
# routines to determine machine constants.
else
- FC="g77"
# g77 hates opts, esp. machine-specific
ALLOWED_FLAGS="-O -O1 -O2 -fstack-protector -fno-unit-at-a-time \
-pipe -g -Wall"
@@ -121,23 +138,36 @@ src_compile() {
FFLAGS="${CFLAGS}"
NOOPT=""
fi
- make lapacklib FORTRAN="libtool --mode=compile --tag=F77 ${FC}" OPTS="${FFLAGS}" \
- NOOPT="${NOOPT}" || die
+ make lapacklib FORTRAN="libtool --mode=compile --tag=F77 ${FORTRANC}" OPTS="${FFLAGS}" \
+ NOOPT="${NOOPT}" || die "Failed to make lapacklib"
cd "${S_LAPACK}"/SRC
+ einfo "Copying liblapack.a/*.o to ${S_LAPACK}/SRC"
cp -sf "${S}"/gentoo/liblapack.a/*.o .
+ einfo "Copying liblapack.a/*.lo to ${S_LAPACK}/SRC"
cp -sf "${S}"/gentoo/liblapack.a/*.lo .
+ einfo "Copying liblapack.a/.libs/*.o to ${S_LAPACK}/SRC"
cp -sf "${S}"/gentoo/liblapack.a/.libs/*.o .libs/
+ local FORTRANLIB
+ if [[ $(gcc-major-version) -ge 4 ]]; then
+ FORTRANLIB="-lgfortran"
+ else
+ FORTRANLIB="-lg2c"
+ fi
+ einfo "Fortran library is ${FORTRANLIB}"
+
if use ifc; then
- ifc ${FFLAGS} -shared .libs/*.o -Wl,-soname -Wl,liblapack.so.0 \
+ ${FORTRANC} ${FFLAGS} -shared .libs/*.o -Wl,-soname -Wl,liblapack.so.0 \
-o liblapack.so.0.0.0 -lblas -lcblas -latlas \
- -L$(gcc-config -L) -lg2c || die
- ar cru liblapack.a *.o || die
- ranlib liblapack.a || die
+ -L$(gcc-config -L) ${FORTRANLIB} \
+ || die "Failed to create liblapack.so.0.0.0"
+ ar cru liblapack.a *.o || die "Failed to create liblapack.a"
+ ranlib liblapack.a || die "Failed to prepare liblapack.a"
else
libtool --mode=link --tag=CC $(tc-getCC) -o liblapack.la *.lo \
- -rpath "${RPATH}" -lblas -lcblas -latlas -lg2c || die
+ -rpath "${RPATH}" -lblas -lcblas -latlas ${FORTRANLIB} \
+ || die "Failed to create liblapack.la"
fi
}