OpenBLAS: bump version (#1541)

* wip

* OpenBLAS: bump version
This commit is contained in:
miqlas
2017-10-27 14:33:20 +02:00
committed by waddlesplash
parent f5b9b59b02
commit 1b32155b02
2 changed files with 271 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
SUMMARY="An optimized BLAS library"
DESCRIPTION="OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD\
version."
HOMEPAGE="http://www.openblas.net/"
COPYRIGHT="2011-2017 The OpenBLAS Project"
LICENSE="BSD (3-clause)"
REVISION="1"
SOURCE_URI="http://github.com/xianyi/OpenBLAS/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="5ef38b15d9c652985774869efd548b8e3e972e1e99475c673b25537ed7bcf394"
SOURCE_DIR="OpenBLAS-$portVersion"
PATCHES="openblas-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="!x86_gcc2 x86"
PROVIDES="
openblas$secondaryArchSuffix = $portVersion
lib:libopenblas$secondaryArchSuffix = $portVersion compat >= 0
lib:libopenblasp_r${portVersion}$secondaryArchSuffix = $portVersion compat >= 0
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libgfortran$secondaryArchSuffix
lib:libgomp$secondaryArchSuffix
"
PROVIDES_devel="
openblas${secondaryArchSuffix}_devel = $portVersion
devel:libopenblas$secondaryArchSuffix = $portVersion compat >= 0
devel:libopenblasp_r${portVersion}$secondaryArchSuffix = $portVersion compat >= 0
"
REQUIRES_devel="
openblas$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:awk
cmd:gfortran$secondaryArchSuffix
cmd:g++$secondaryArchSuffix
cmd:make
cmd:perl
"
BUILD()
{
# DYNAMIC_ARCH is x86 only
# PPC & others should specify TARGET=
target=
[ "$targetArchitecture" == x86 ] && target=NORTHWOOD
[ "$targetArchitecture" == x86_64 ] && target=PRESCOTT
make MAKE_NB_JOBS=${jobArgs#-j} NO_LAPACKE=1 NO_AFFINITY=1 NO_WARMUP=1 \
NUM_THREADS=64 DYNAMIC_ARCH=1 USE_OPENMP=1 TARGET=$target
}
INSTALL()
{
make install PREFIX=$prefix \
OPENBLAS_LIBRARY_DIR=$libDir \
OPENBLAS_INCLUDE_DIR=$includeDir
prepareInstalledDevelLibs libopenblas libopenblasp-r$portVersion
cp -P $developLibDir/libopenblas.so.0 $libDir
packageEntries devel \
$developDir \
$libDir/cmake
}
TEST()
{
make tests
}

View File

@@ -0,0 +1,196 @@
From 38ea52d182a79dc2fa6c1ae8029875bb969172c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
Date: Mon, 14 Nov 2016 20:50:32 +0100
Subject: Make Haiku a known OS
diff --git a/c_check b/c_check
index 20da288..b5450c0 100644
--- a/c_check
+++ b/c_check
@@ -62,6 +62,7 @@ $os = WINNT if ($data =~ /OS_WINNT/);
$os = CYGWIN_NT if ($data =~ /OS_CYGWIN_NT/);
$os = Interix if ($data =~ /OS_INTERIX/);
$os = Android if ($data =~ /OS_ANDROID/);
+$os = Haiku if ($data =~ /OS_HAIKU/);
$architecture = x86 if ($data =~ /ARCH_X86/);
$architecture = x86_64 if ($data =~ /ARCH_X86_64/);
diff --git a/ctest.c b/ctest.c
index 27d3b47..46b0bac 100644
--- a/ctest.c
+++ b/ctest.c
@@ -93,6 +93,10 @@ OS_INTERIX
OS_LINUX
#endif
+#if defined(__HAIKU__)
+OS_HAIKU
+#endif
+
#if defined(__i386) || defined(_X86)
ARCH_X86
#endif
--
2.14.2
From 6df4693004134ec0c360d85fbf654f94cee419d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
Date: Mon, 14 Nov 2016 20:31:01 +0100
Subject: Do not use sys/shm.h on Haiku
diff --git a/common.h b/common.h
index 4463141..e73ac9d 100644
--- a/common.h
+++ b/common.h
@@ -105,6 +105,10 @@ extern "C" {
#endif
#endif
+#ifdef OS_HAIKU
+#define NO_SYSV_IPC
+#endif
+
#ifdef OS_WINDOWS
#ifdef ATOM
#define GOTO_ATOM ATOM
--
2.14.2
From c655d04c5266a9818ed8c8dedf1788f1060f1f9a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
Date: Mon, 14 Nov 2016 20:50:53 +0100
Subject: Haiku uses .so and .so.version lib names
diff --git a/Makefile b/Makefile
index 1b9bcb1..82cf611 100644
--- a/Makefile
+++ b/Makefile
@@ -86,7 +86,7 @@ endif
shared :
ifndef NO_SHARED
-ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android))
+ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android Haiku))
@$(MAKE) -C exports so
@ln -fs $(LIBSONAME) $(LIBPREFIX).so
@ln -fs $(LIBSONAME) $(LIBPREFIX).so.$(MAJOR_VERSION)
diff --git a/Makefile.install b/Makefile.install
index 24fe8c8..ef7a163 100644
--- a/Makefile.install
+++ b/Makefile.install
@@ -66,7 +66,7 @@ endif
#for install shared library
ifndef NO_SHARED
@echo Copying the shared library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
-ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android))
+ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android Haiku))
@install -pm755 $(LIBSONAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
@cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
ln -fs $(LIBSONAME) $(LIBPREFIX).so ; \
diff --git a/exports/Makefile b/exports/Makefile
index c053895..1ec5ae8 100644
--- a/exports/Makefile
+++ b/exports/Makefile
@@ -118,7 +118,7 @@ endif
dllinit.$(SUFFIX) : dllinit.c
$(CC) $(CFLAGS) -c -o $(@F) -s $<
-ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android))
+ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android Haiku))
so : ../$(LIBSONAME)
--
2.14.2
From af986d55a16c0f73848c0288c5208fc029199160 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
Date: Mon, 14 Nov 2016 20:51:51 +0100
Subject: Haiku uses regular *nix includes
diff --git a/driver/others/blas_server.c b/driver/others/blas_server.c
index 9debe17..65fb325 100644
--- a/driver/others/blas_server.c
+++ b/driver/others/blas_server.c
@@ -70,7 +70,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*********************************************************************/
#include "common.h"
-#if defined(OS_LINUX) || defined(OS_NETBSD) || defined(OS_DARWIN) || defined(OS_ANDROID) || defined(OS_SUNOS) || defined(OS_FREEBSD)
+#if defined(OS_LINUX) || defined(OS_NETBSD) || defined(OS_DARWIN) || defined(OS_ANDROID) || defined(OS_SUNOS) || defined(OS_FREEBSD) || defined(OS_HAIKU)
#include <dlfcn.h>
#include <signal.h>
#include <sys/resource.h>
--
2.14.2
From 0abb4caa2995dd03be91319af187108d154e10c1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Tue, 27 Dec 2016 14:41:07 +0100
Subject: Haiku don't need -pthread
diff --git a/Makefile b/Makefile
index 82cf611..6d64e0a 100644
--- a/Makefile
+++ b/Makefile
@@ -257,6 +257,8 @@ ifeq ($(F_COMPILER), GFORTRAN)
ifdef SMP
ifeq ($(OSNAME), WINNT)
-@echo "LOADER = $(FC)" >> $(NETLIB_LAPACK_DIR)/make.inc
+else ifeq ($(OSNAME), Haiku)
+ -@echo "LOADER = $(FC)" >> $(NETLIB_LAPACK_DIR)/make.inc
else
-@echo "LOADER = $(FC) -pthread" >> $(NETLIB_LAPACK_DIR)/make.inc
endif
--
2.14.2
From 568a030bc3827f61e3b5ba38d7dd7246dd03e08a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Fri, 27 Oct 2017 10:12:51 +0200
Subject: Haiku get_num_procs support
diff --git a/driver/others/memory.c b/driver/others/memory.c
index c6b1e89..7495eda 100644
--- a/driver/others/memory.c
+++ b/driver/others/memory.c
@@ -108,6 +108,10 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sys/resource.h>
#endif
+#ifdef OS_HAIKU
+#include <posix/unistd.h>
+#endif
+
#if defined(OS_FREEBSD) || defined(OS_DARWIN)
#include <sys/sysctl.h>
#include <sys/resource.h>
@@ -226,6 +230,14 @@ int get_num_procs(void) {
}
#endif
+#ifdef OS_HAIKU
+int get_num_procs(void) {
+ static int nums = 0;
+ if (!nums) nums = sysconf(_SC_NPROCESSORS_CONF);
+ return nums;
+}
+#endif
+
#ifdef OS_WINDOWS
int get_num_procs(void) {
--
2.14.2