Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenBLAS: add PowerPC support #3815

Merged
merged 1 commit into from
Mar 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 14 additions & 2 deletions math/OpenBLAS/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ if {[string first "-devel" $subport] > 0} {
conflicts OpenBLAS

patchfiles patch-libnoarch.devel.diff \
patch-linkLib.devel.diff
patch-linkLib.devel.diff \
patch-openblas-powermac970-fix.diff

github.livecheck.branch develop

Expand All @@ -51,7 +52,9 @@ if {[string first "-devel" $subport] > 0} {
conflicts OpenBLAS-devel

patchfiles patch-libnoarch.release.diff \
patch-linkLib.release.diff
patch-linkLib.release.diff \
patch-darwin-powerpc.diff \
patch-openblas-powermac970-fix.diff
}

compilers.choose fc
Expand Down Expand Up @@ -141,6 +144,15 @@ pre-build {
depends_build-append port:cctools
build.args "AR=${prefix}/bin/ar RANLIB=${prefix}/bin/ranlib"

platform darwin 8 {
depends_build-append port:gmake
build.cmd ${prefix}/bin/gmake

depends_test-append port:gmake
test.cmd build.cmd
}


destroot.args "PREFIX=${prefix}"

if {[variant_isset universal]} {
Expand Down
11 changes: 11 additions & 0 deletions math/OpenBLAS/files/patch-darwin-powerpc.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- ctest.c.orig 2019-03-06 19:25:30.000000000 -0800
+++ ctest.c 2019-03-06 19:26:06.000000000 -0800
@@ -113,7 +113,7 @@
ARCH_X86_64
#endif

-#if defined(__powerpc___) || defined(__PPC__) || defined(_POWER)
+#if defined(__powerpc___) || defined(__PPC__) || defined(_POWER) || defined(__POWERPC__)
ARCH_POWER
#endif

26 changes: 26 additions & 0 deletions math/OpenBLAS/files/patch-openblas-powermac970-fix.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git common_power.h common_power.h
index e3a1a7ae..68087b07 100644
--- common_power.h
+++ common_power.h
@@ -241,7 +241,7 @@ static inline int blas_quickdivide(blasint x, blasint y){
#define HAVE_PREFETCH
#endif

-#if defined(POWER3) || defined(POWER6) || defined(PPCG4) || defined(CELL) || defined(POWER8)
+#if defined(POWER3) || defined(POWER6) || defined(PPCG4) || defined(CELL) || defined(POWER8) || ( defined(PPC970) && defined(OS_DARWIN) )
#define DCBT_ARG 0
#else
#define DCBT_ARG 8
diff --git param.h param.h
index 3cc400b5..48b7ef38 100644
--- param.h
+++ param.h
@@ -1999,7 +1999,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define ZGEMM_DEFAULT_UNROLL_M 2
#define ZGEMM_DEFAULT_UNROLL_N 2

-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_DARWIN)
#if L2_SIZE == 1024976
#define SGEMM_DEFAULT_P 320
#define DGEMM_DEFAULT_P 256