Skip to content

Commit

Permalink
openblas: fix port, enable fortran code (#972)
Browse files Browse the repository at this point in the history
  • Loading branch information
miqlas authored and korli committed Dec 31, 2016
1 parent f68db54 commit 75d262b
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 5 deletions.
17 changes: 12 additions & 5 deletions sci-libs/openblas/openblas-0.2.19.recipe
Expand Up @@ -2,13 +2,14 @@ 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-2015 The OpenBLAS Project"
COPYRIGHT="2011-2016 The OpenBLAS Project"
LICENSE="BSD (3-clause)"
REVISION="2"
REVISION="3"
SOURCE_URI="http://github.com/xianyi/OpenBLAS/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="9c40b5e4970f27c5f6911cb0a28aa26b6c83f17418b69f8e5a116bb983ca8557"
SOURCE_DIR="OpenBLAS-$portVersion"
PATCHES="openblas-$portVersion.patchset"

ARCHITECTURES="!x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="!x86_gcc2 x86"

Expand All @@ -19,6 +20,8 @@ PROVIDES="
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libgfortran$secondaryArchSuffix
lib:libgomp$secondaryArchSuffix
"

PROVIDES_devel="
Expand All @@ -35,7 +38,7 @@ BUILD_REQUIRES="
"
BUILD_PREREQUIRES="
cmd:awk
#cmd:gfortran
cmd:gfortran$secondaryArchSuffix
cmd:g++$secondaryArchSuffix
cmd:make
cmd:perl
Expand All @@ -46,8 +49,7 @@ BUILD()
# DYNAMIC_ARCH is x86 only
# PPC & others should specify TARGET=
make MAKE_NB_JOBS=${jobArgs#-j} NO_LAPACKE=1 NO_AFFINITY=1 NO_WARMUP=1 \
NUM_THREADS=64 \
DYNAMIC_ARCH=1
NUM_THREADS=64 DYNAMIC_ARCH=1 USE_OPENMP=1
}

INSTALL()
Expand All @@ -62,3 +64,8 @@ INSTALL()
$developDir \
$libDir/cmake
}

TEST()
{
make tests
}
49 changes: 49 additions & 0 deletions sci-libs/openblas/patches/openblas-0.2.19.patchset
Expand Up @@ -131,3 +131,52 @@ index 42cadf4..5a89546 100644
--
2.7.0

From 3f451bdfb905576b6684ae6839820779900ed73d 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: [PATCH] Haiku don't need -pthread

---
Makefile | 2 ++
1 file changed, 2 insertions(+)

diff --git a/Makefile b/Makefile
index 2ae0047..7c97dfb 100644
--- a/Makefile
+++ b/Makefile
@@ -244,6 +244,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.10.2

From f4665b6c89202b47b733851f9ad887c0e3b12289 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Fri, 30 Dec 2016 21:19:56 +0100
Subject: [PATCH] Haiku get_num_procs support

---
driver/others/memory.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/driver/others/memory.c b/driver/others/memory.c
index e89f5c3..9a851b8 100644
--- a/driver/others/memory.c
+++ b/driver/others/memory.c
@@ -169,7 +169,7 @@ void goto_set_num_threads(int num_threads) {};

#else

-#if defined(OS_LINUX) || defined(OS_SUNOS)
+#if defined(OS_LINUX) || defined(OS_SUNOS) || defined(OS_HAIKU)
#ifndef NO_AFFINITY
int get_num_procs(void);
#else
--
2.10.2

0 comments on commit 75d262b

Please sign in to comment.