aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Arteaga <andyspiros@gmail.com>2012-03-23 21:21:02 +0100
committerAndrea Arteaga <andyspiros@gmail.com>2012-03-23 21:21:02 +0100
commit8df1a9ed5ce544bb360a6b29d9afe40cf2af21cb (patch)
treedec80ca0d5c282a10c394ad0ebc0fc2525804744
parentusing PATCHES variable instead of epatch (diff)
downloadsci-8df1a9ed5ce544bb360a6b29d9afe40cf2af21cb.tar.gz
sci-8df1a9ed5ce544bb360a6b29d9afe40cf2af21cb.tar.bz2
sci-8df1a9ed5ce544bb360a6b29d9afe40cf2af21cb.zip
[sci-libs/openblas] First stable version.
-rw-r--r--sci-libs/openblas/Manifest1
-rw-r--r--sci-libs/openblas/files/openblas-sharedlibs-0.1.patch45
-rw-r--r--sci-libs/openblas/openblas-0.1.ebuild125
3 files changed, 171 insertions, 0 deletions
diff --git a/sci-libs/openblas/Manifest b/sci-libs/openblas/Manifest
new file mode 100644
index 000000000..9c2795391
--- /dev/null
+++ b/sci-libs/openblas/Manifest
@@ -0,0 +1 @@
+DIST openblas-0.1.tbz2 1638384 SHA256 c20d5cca807d1a47c76bd6ed4d05e4f265584bb7ac5b777245616738c8388097 SHA512 76ee80bb85c066ddd175776cdd6d7a4707d0dad34028cf656a51ffac88289b28ddcfd96aff4915c412a457225ed14ab9c0bfea7cc64c0c80227157a404d20d21 WHIRLPOOL bb3b3fa522ad0e82c9ab4ee1bd4370ab96010537a1b3656c5d7eb87b6ac8aed15cdf4e9f107f47a4bcd6036e6dcb88f4d87318f805c895d5f92cd8a98a5f0cfe
diff --git a/sci-libs/openblas/files/openblas-sharedlibs-0.1.patch b/sci-libs/openblas/files/openblas-sharedlibs-0.1.patch
new file mode 100644
index 000000000..c2e658072
--- /dev/null
+++ b/sci-libs/openblas/files/openblas-sharedlibs-0.1.patch
@@ -0,0 +1,45 @@
+--- exports/Makefile.orig 2010-11-12 05:30:06.000000000 +0000
++++ exports/Makefile 2010-11-12 06:33:41.000000000 +0000
+@@ -97,10 +97,10 @@
+ so : ../$(LIBSONAME)
+
+ ../$(LIBSONAME) : ../$(LIBNAME) linux.def linktest.c
+- $(CC) $(CFLAGS) -shared -o ../$(LIBSONAME) \
+- -Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive \
+- -Wl,--retain-symbols-file=linux.def -Wl,-soname,$(LIBPREFIX).so.$(MAJOR_VERSION) $(EXTRALIB)
+- $(CC) $(CFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.
++ $(CC) $(LDFLAGS) -shared \
++ -Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive -Wl,--soname=$(LIBSONAME) \
++ -Wl,--retain-symbols-file=linux.def $(EXTRALIB) -o ../$(LIBSONAME)
++ $(CC) $(CFLAGS) -w linktest.c ../$(LIBSONAME) $(FEXTRALIB) -o linktest && echo OK.
+ rm -f linktest
+
+ endif
+@@ -110,10 +110,10 @@
+ so : ../$(LIBSONAME)
+
+ ../$(LIBSONAME) : ../$(LIBNAME) linux.def linktest.c
+- $(CC) $(CFLAGS) -shared -o ../$(LIBSONAME) \
+- -Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive \
+- -Wl,--retain-symbols-file=linux.def $(EXTRALIB)
+- $(CC) $(CFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.
++ $(CC) $(LDFLAGS) -shared \
++ -Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive -Wl,--soname=$(LIBSONAME) \
++ -Wl,--retain-symbols-file=linux.def $(EXTRALIB) -o ../$(LIBSONAME)
++ $(CC) $(CFLAGS) -w linktest.c ../$(LIBSONAME) $(FEXTRALIB) -o linktest && echo OK.
+ rm -f linktest
+
+ endif
+@@ -129,9 +129,9 @@
+ ifeq ($(OSNAME), SunOS)
+
+ so : ../$(LIBSONAME)
+- $(CC) $(CFLAGS) -shared -o ../$(LIBSONAME) \
+- -Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive $(EXTRALIB)
+- $(CC) $(CFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.
++ $(CC) $(LDFLAGS) -shared -Wl,--soname=$(LIBSONAME) \
++ -Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive $(EXTRALIB) -o ../$(LIBSONAME)
++ $(CC) $(CFLAGS) -w linktest.c ../$(LIBSONAME) $(FEXTRALIB) -o linktest && echo OK.
+ rm -f linktest
+
+ endif
diff --git a/sci-libs/openblas/openblas-0.1.ebuild b/sci-libs/openblas/openblas-0.1.ebuild
new file mode 100644
index 000000000..d705f8538
--- /dev/null
+++ b/sci-libs/openblas/openblas-0.1.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=4
+
+inherit eutils toolchain-funcs alternatives-2 multilib
+
+DESCRIPTION="Optimized BLAS library based on GotoBLAS2"
+HOMEPAGE="http://xianyi.github.com/OpenBLAS/"
+SRC_URI="http://soc.dev.gentoo.org/~spiros/repository/${P}.tbz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~x86-macos ~ppc-macos ~x64-macos"
+
+IUSE="+incblas int64 dynamic openmp static-libs threads"
+
+RDEPEND="virtual/fortran"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${P}"
+
+pkg_setup() {
+ ewarn "If the compilation fails, try setting the TARGET environment variable"
+ ewarn "to your CPU's codename and run emerge again."
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-{sharedlibs,aliasing}.patch
+ # respect LDFLAGS
+ sed -i -e '/^LDFLAGS\s*=/d' Makefile.* || die
+ # respect CFLAGS only if dynamic flag not enabled
+ if ! use dynamic; then
+ sed -i \
+ -e "/^COMMON_OPT/s/-O2/${CFLAGS}/" \
+ Makefile.rule || die
+ fi
+ # fix executable stacks
+ local i
+ for i in $(find . -name \*.S); do
+ cat >> ${i} <<-EOF
+ #if defined(__ELF__)
+ .section .note.GNU-stack,"",%progbits
+ #endif
+ EOF
+ done
+}
+
+src_configure() {
+ local use_openmp=$(use openmp && echo 1)
+ use threads && use openmp && use_openmp="" && \
+ einfo "openmp and threads enabled: using threads"
+ sed -i \
+ -e "s:^#\s*\(NO_LAPACK\)\s*=.*:\1=1:" \
+ -e "s:^#\s*\(CC\)\s*=.*:\1=$(tc-getCC):" \
+ -e "s:^#\s*\(FC\)\s*=.*:\1=$(tc-getFC):" \
+ -e "s:^#\s*\(USE_THREAD\)\s*=.*:\1=$(use threads && echo 1 || echo 0):" \
+ -e "s:^#\s*\(USE_OPENMP\)\s*=.*:\1=${use_openmp}:" \
+ -e "s:^#\s*\(DYNAMIC_ARCH\)\s*=.*:\1=$(use dynamic && echo 1):" \
+ -e "s:^#\s*\(INTERFACE64\)\s*=.*:\1=$(use int64 && echo 1):" \
+ -e "s:^#\s*\(NO_CBLAS\)\s*=.*:\1=$(use incblas || echo 1):" \
+ Makefile.rule || die
+}
+
+src_compile() {
+ mkdir solibs
+ emake libs shared && mv *$(get_libname) solibs/
+ use static-libs && emake clean && emake libs NEED_PIC=
+}
+
+src_test() {
+ emake tests
+}
+
+src_install() {
+ local profname=${PN} threads
+ use int64 && profname=${profname}-int64
+ if use threads; then
+ threads="-pthread"
+ profname=${profname}-threads
+ elif use openmp; then
+ profname=${profname}-openmp
+ fi
+
+ dolib.so solibs/lib*$(get_libname)
+ use static-libs && dolib.a lib*.a
+
+ # create pkg-config file and associated eselect file
+ cat <<-EOF > ${profname}.pc
+ prefix=${EPREFIX}/usr
+ libdir=\${prefix}/$(get_libdir)
+ includedir=\${prefix}/include
+ Name: ${PN}
+ Description: ${DESCRIPTION}
+ Version: ${PV}
+ URL: ${HOMEPAGE}
+ Libs: -L\${libdir} -lopenblas -lm ${threads}
+ EOF
+
+ alternatives_for blas ${profname} 0 \
+ "/usr/$(get_libdir)/pkgconfig/blas.pc" "${profname}.pc"
+
+ if use incblas; then
+ echo >> ${profname}.pc "Cflags: -I\${includedir}/${PN}"
+ insinto /usr/include/${PN}
+ doins cblas.h common*.h config.h param.h
+ alternatives_for cblas ${profname} 0 \
+ "/usr/$(get_libdir)/pkgconfig/cblas.pc" "${profname}.pc" \
+ "/usr/include/cblas.h" "${PN}/cblas.h"
+ fi
+
+ insinto /usr/$(get_libdir)/pkgconfig
+ doins ${profname}.pc
+ dodoc GotoBLAS_{01Readme,03FAQ,04FAQ,05LargePage,06WeirdPerformance}.txt
+
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ cd "${ED}"/usr/$(get_libdir)
+ for d in *.dylib ; do
+ ebegin "correcting install_name of ${d}"
+ install_name_tool -id "${EPREFIX}/usr/$(get_libdir)/${d}" "${d}"
+ eend $?
+ done
+ fi
+}