View | Details | Raw Unified | Return to bug 231371 | Differences between
and this patch

Collapse All | Expand All

(-)math/openblas/Makefile (-78 / +10 lines)
Lines 2-10 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	openblas
4
PORTNAME=	openblas
5
PORTVERSION=	0.2.20
6
PORTREVISION=	3
7
DISTVERSIONPREFIX=	v
5
DISTVERSIONPREFIX=	v
6
DISTVERSION=	0.3.3
8
PORTEPOCH=	1
7
PORTEPOCH=	1
9
CATEGORIES=	math
8
CATEGORIES=	math
10
MASTER_SITES=	NL/lapack/timing/:lapack_tmg
9
MASTER_SITES=	NL/lapack/timing/:lapack_tmg
Lines 17-38 Link Here
17
LICENSE=	BSD3CLAUSE
16
LICENSE=	BSD3CLAUSE
18
LICENSE_FILE=	${WRKSRC}/LICENSE
17
LICENSE_FILE=	${WRKSRC}/LICENSE
19
18
20
USES=		fortran gmake perl5
19
USES=		cmake:outsource fortran perl5 pkgconfig
21
22
USE_GITHUB=	yes
20
USE_GITHUB=	yes
23
GH_ACCOUNT=	xianyi
21
GH_ACCOUNT=	xianyi
24
GH_PROJECT=	OpenBLAS
22
GH_PROJECT=	OpenBLAS
25
LARGE_FILE=	large.tgz
23
LARGE_FILE=	large.tgz
26
TIMING_FILE=	timing.tgz
24
TIMING_FILE=	timing.tgz
27
28
USE_LDCONFIG=	yes
25
USE_LDCONFIG=	yes
29
USE_PERL5=	build
26
USE_PERL5=	build
30
27
31
OPENBLAS_SUFX=	r${PORTVERSION}
28
CMAKE_ON=	BUILD_SHARED_LIBS
32
OPENBLAS_LIBS=	libopenblas libopenblasp
29
33
OPENBLAS_SVER=	0
34
OPENBLAS_FILES=	${OPENBLAS_LIBS:S|$|.so|} ${OPENBLAS_LIBS:S|$|.so.${OPENBLAS_SVER}|} ${OPENBLAS_LIBS:S|$|.a|}
35
PLIST_FILES=	${OPENBLAS_FILES:S|^|lib/|}
36
TEST_TARGET=	tests
30
TEST_TARGET=	tests
37
31
38
OPTIONS_DEFINE=		INTERFACE64 OPENMP
32
OPTIONS_DEFINE=		INTERFACE64 OPENMP
Lines 69-149 Link Here
69
MANUAL_PACKAGE_BUILD=	Optimizes for the build machine.
63
MANUAL_PACKAGE_BUILD=	Optimizes for the build machine.
70
.endif
64
.endif
71
65
72
.if ${PORT_OPTIONS:MDYNAMIC_ARCH}
66
DYNAMIC_ARCH_CMAKE_BOOL=	DYNAMIC_ARCH
73
BUILDFLAGS+=	DYNAMIC_ARCH=1
74
.endif
75
67
76
.if ${PORT_OPTIONS:MINTERFACE64}
68
INTERFACE64_CMAKE_BOOL=	INTERFACE64
77
BUILDFLAGS+=	INTERFACE64=1
78
.endif
79
69
80
.if ${PORT_OPTIONS:MOPENMP}
70
USE_OPENMP_USES=	compiler:openmp
81
USES+=		compiler:openmp
71
USE_OPENMP_CMAKE_BOOL=	USE_OPENMP
82
BUILDFLAGS_THREAD+=	USE_OPENMP=1
83
.endif
84
72
85
.if ! ${PORT_OPTIONS:MAVX}
73
AVX_CMAKE_OFF=	-DNO_AVX=1
86
BUILDFLAGS+=	NO_AVX=1
74
AVX2_CMAKE_OFF=	-DNO_AVX2=1
87
.endif
88
75
89
.if ! ${PORT_OPTIONS:MAVX2}
90
BUILDFLAGS+=	NO_AVX2=1
91
.endif
92
93
post-extract:
76
post-extract:
94
	cd ${DISTDIR}/${DIST_SUBDIR} ; \
77
	cd ${DISTDIR}/${DIST_SUBDIR} ; \
95
	${CP} ${LARGE_FILE} ${TIMING_FILE} ${WRKSRC}
78
	${CP} ${LARGE_FILE} ${TIMING_FILE} ${WRKSRC}
96
	${MKDIR} ${WRKDIR}/lib
79
	${MKDIR} ${WRKDIR}/lib
97
80
98
post-patch:
99
	${REINPLACE_CMD} -e "s+%%FIND%%+${FIND}+" \
100
	-e "s+%%XARGS%%+${XARGS}+" \
101
	-e "s+%%REINPLACE_CMD%%+${REINPLACE_CMD}+" \
102
		${WRKSRC}/Makefile
103
	${REINPLACE_CMD} -e "s+%%FC%%+${FC}+" -e "s+%%CC%%+${CC}+" \
104
		${WRKSRC}/Makefile.rule
105
	${REINPLACE_CMD} -e "s+(ARCH)+(ARCH_)+" \
106
		${WRKSRC}/Makefile.rule \
107
		${WRKSRC}/Makefile.tail \
108
		${WRKSRC}/driver/level3/Makefile \
109
		${WRKSRC}/driver/others/Makefile \
110
		${WRKSRC}/exports/Makefile \
111
		${WRKSRC}/interface/Makefile \
112
		${WRKSRC}/kernel/Makefile \
113
		${WRKSRC}/kernel/Makefile.L3 \
114
		${WRKSRC}/lapack/laswp/Makefile \
115
		${WRKSRC}/lapack-netlib/SRC/Makefile \
116
		${WRKSRC}/lapack-netlib/SRC/VARIANTS/Makefile \
117
		${WRKSRC}/lapack-netlib/TESTING/MATGEN/Makefile \
118
		${WRKSRC}/lapack-netlib/LAPACKE/src/Makefile \
119
		${WRKSRC}/lapack-netlib/LAPACKE/utils/Makefile \
120
		${WRKSRC}/reference/Makefile
121
	${REINPLACE_CMD} -e "s+(ARCH)+(ARCH_)+" \
122
	-e 's+%%LDFLAGS%%+${LDFLAGS}+' \
123
	-e 's+%%LOCALBASE%%+${LOCALBASE}+' \
124
	-e 's+%%FIND%%+${FIND}+' \
125
	-e 's+%%XARGS%%+${XARGS}+' \
126
	-e 's+%%REINPLACE_CMD%%+${REINPLACE_CMD}+' \
127
	-e 's+$${CROSS_SUFFIX}+${LOCALBASE}/bin/+' \
128
	-e '/Clang.*OpenMP/g' \
129
		${WRKSRC}/Makefile.system
130
131
post-patch-OPENMP-on:
81
post-patch-OPENMP-on:
132
	${REINPLACE_CMD} -e "s+OPENBLAS_NUM_THREADS+OMP_NUM_THREADS+g" \
82
	${REINPLACE_CMD} -e "s+OPENBLAS_NUM_THREADS+OMP_NUM_THREADS+g" \
133
		${WRKSRC}/test/Makefile \
83
		${WRKSRC}/test/Makefile \
134
		${WRKSRC}/ctest/Makefile
84
		${WRKSRC}/ctest/Makefile
135
85
136
do-build:
137
	cd ${WRKSRC} ; ${SETENV} ${BUILDFLAGS} NUM_THREADS=1 USE_THREAD=0 \
138
	${MAKE_CMD} ${MAKE_ARGS}
139
	${CP} ${WRKSRC}/libopenblas-${OPENBLAS_SUFX}.a ${WRKDIR}/lib/libopenblas.a
140
	${CP} ${WRKSRC}/libopenblas-${OPENBLAS_SUFX}.so ${WRKDIR}/lib/libopenblas.so.${OPENBLAS_SVER}
141
	cd ${WRKSRC} ; ${MAKE_CMD} ${MAKE_ARGS} clean
142
	cd ${WRKSRC} ; ${SETENV} ${BUILDFLAGS} ${BUILDFLAGS_THREAD} \
143
	${MAKE_CMD} ${MAKE_ARGS}
144
	${CP} ${WRKSRC}/libopenblasp-${OPENBLAS_SUFX}.a ${WRKDIR}/lib/libopenblasp.a
145
	${CP} ${WRKSRC}/libopenblasp-${OPENBLAS_SUFX}.so ${WRKDIR}/lib/libopenblasp.so.${OPENBLAS_SVER}
146
147
BENCHMARK_MAXTHREADS?=	${MAXTHREADS}
86
BENCHMARK_MAXTHREADS?=	${MAXTHREADS}
148
.if ${PORT_OPTIONS:MOPENMP}
87
.if ${PORT_OPTIONS:MOPENMP}
149
BENCHMARK_THREADS_FLAG=		OMP_NUM_THREADS=${BENCHMARK_MAXTHREADS}
88
BENCHMARK_THREADS_FLAG=		OMP_NUM_THREADS=${BENCHMARK_MAXTHREADS}
Lines 157-167 Link Here
157
	cd ${WRKSRC}/benchmark ; ${SETENV} ${BUILDFLAGS} NUM_THREADS=${MAXTHREADS} \
96
	cd ${WRKSRC}/benchmark ; ${SETENV} ${BUILDFLAGS} NUM_THREADS=${MAXTHREADS} \
158
	USE_THREAD=1 ${BENCHMARK_THREADS_FLAG} ${MAKE_CMD} ${MAKE_ARGS}
97
	USE_THREAD=1 ${BENCHMARK_THREADS_FLAG} ${MAKE_CMD} ${MAKE_ARGS}
159
98
160
do-install:
161
.for L in ${OPENBLAS_LIBS}
162
	${INSTALL_DATA} ${WRKDIR}/lib/${L}.a ${STAGEDIR}${PREFIX}/lib
163
	${INSTALL_LIB} ${WRKDIR}/lib/${L}.so.${OPENBLAS_SVER} ${STAGEDIR}${PREFIX}/lib
164
	${LN} -sf ${L}.so.${OPENBLAS_SVER} ${STAGEDIR}${PREFIX}/lib/${L}.so
165
.endfor
166
167
.include <bsd.port.mk>
99
.include <bsd.port.mk>
(-)math/openblas/distinfo (-3 / +3 lines)
Lines 1-7 Link Here
1
TIMESTAMP = 1503123719
1
TIMESTAMP = 1536976475
2
SHA256 (openblas/large.tgz) = f328d88b7fa97722f271d7d0cfea1c220e0f8e5ed5ff01d8ef1eb51d6f4243a1
2
SHA256 (openblas/large.tgz) = f328d88b7fa97722f271d7d0cfea1c220e0f8e5ed5ff01d8ef1eb51d6f4243a1
3
SIZE (openblas/large.tgz) = 2595
3
SIZE (openblas/large.tgz) = 2595
4
SHA256 (openblas/timing.tgz) = 999c65f8ea8bd4eac7f1c7f3463d4946917afd20a997807300fe35d70122f3af
4
SHA256 (openblas/timing.tgz) = 999c65f8ea8bd4eac7f1c7f3463d4946917afd20a997807300fe35d70122f3af
5
SIZE (openblas/timing.tgz) = 1059485
5
SIZE (openblas/timing.tgz) = 1059485
6
SHA256 (openblas/xianyi-OpenBLAS-v0.2.20_GH0.tar.gz) = 5ef38b15d9c652985774869efd548b8e3e972e1e99475c673b25537ed7bcf394
6
SHA256 (openblas/xianyi-OpenBLAS-v0.3.3_GH0.tar.gz) = 49d88f4494ae780e3d7fa51769c00d982d7cdb73e696054ac3baa81d42f13bab
7
SIZE (openblas/xianyi-OpenBLAS-v0.2.20_GH0.tar.gz) = 11637301
7
SIZE (openblas/xianyi-OpenBLAS-v0.3.3_GH0.tar.gz) = 11821696
(-)math/openblas/files/patch-Makefile (-11 lines)
Lines 1-11 Link Here
1
--- Makefile.orig	2015-10-27 20:44:50 UTC
2
+++ Makefile
3
@@ -238,7 +238,7 @@ ifndef NOFORTRAN
4
 	-@echo "LOADOPTS    = $(FFLAGS) $(EXTRALIB)" >> $(NETLIB_LAPACK_DIR)/make.inc
5
 	-@echo "CC          = $(CC)" >> $(NETLIB_LAPACK_DIR)/make.inc
6
 	-@echo "override CFLAGS      = $(LAPACK_CFLAGS)" >> $(NETLIB_LAPACK_DIR)/make.inc
7
-	-@echo "ARCH        = $(AR)" >> $(NETLIB_LAPACK_DIR)/make.inc
8
+	-@echo "ARCH_       = $(AR)" >> $(NETLIB_LAPACK_DIR)/make.inc
9
 	-@echo "ARCHFLAGS   = -ru" >> $(NETLIB_LAPACK_DIR)/make.inc
10
 	-@echo "RANLIB      = $(RANLIB)" >> $(NETLIB_LAPACK_DIR)/make.inc
11
 	-@echo "LAPACKLIB   = ../$(LIBNAME)" >> $(NETLIB_LAPACK_DIR)/make.inc
(-)math/openblas/files/patch-Makefile.rule (-15 lines)
Lines 1-15 Link Here
1
--- Makefile.rule.orig	2015-10-27 20:44:50 UTC
2
+++ Makefile.rule
3
@@ -19,10 +19,10 @@ VERSION = 0.2.15
4
 
5
 # C compiler including binary type(32bit / 64bit). Default is gcc.
6
 # Don't use Intel Compiler or PGI, it won't generate right codes as I expect.
7
-# CC = gcc
8
+CC = %%CC%%
9
 
10
 # Fortran compiler. Default is g77.
11
-# FC = gfortran
12
+FC = %%FC%%
13
 
14
 # Even you can specify cross compiler. Meanwhile, please set HOSTCC.
15
 
(-)math/openblas/files/patch-Makefile.system (-62 lines)
Lines 1-62 Link Here
1
--- Makefile.system.orig	2015-10-27 20:44:50 UTC
2
+++ Makefile.system
3
@@ -218,6 +218,7 @@ MD5SUM = md5 -r
4
 endif
5
 
6
 ifeq ($(OSNAME), FreeBSD)
7
+EXTRALIB	+= -lm %%LDFLAGS%%
8
 MD5SUM = md5 -r
9
 endif
10
 
11
@@ -889,9 +890,17 @@ SYMBOLSUFFIX =
12
 endif
13
 
14
 ifndef LIBNAMESUFFIX
15
+ifndef SMP
16
 LIBPREFIX = lib$(SYMBOLPREFIX)openblas$(SYMBOLSUFFIX)
17
 else
18
+LIBPREFIX = lib$(SYMBOLPREFIX)openblasp$(SYMBOLSUFFIX)
19
+endif
20
+else
21
+ifndef SMP
22
 LIBPREFIX = lib$(SYMBOLPREFIX)openblas$(SYMBOLSUFFIX)_$(LIBNAMESUFFIX)
23
+else
24
+LIBPREFIX = lib$(SYMBOLPREFIX)openblasp$(SYMBOLSUFFIX)_$(LIBNAMESUFFIX)
25
+endif
26
 endif
27
 
28
 KERNELDIR	= $(TOPDIR)/kernel/$(ARCH)
29
@@ -1020,24 +1029,8 @@ ifndef LIBSUFFIX
30
 LIBSUFFIX = a
31
 endif
32
 
33
-ifneq ($(DYNAMIC_ARCH), 1)
34
-ifndef SMP
35
-LIBNAME		= $(LIBPREFIX)_$(LIBCORE)$(REVISION).$(LIBSUFFIX)
36
-LIBNAME_P	= $(LIBPREFIX)_$(LIBCORE)$(REVISION)_p.$(LIBSUFFIX)
37
-else
38
-LIBNAME		= $(LIBPREFIX)_$(LIBCORE)p$(REVISION).$(LIBSUFFIX)
39
-LIBNAME_P	= $(LIBPREFIX)_$(LIBCORE)p$(REVISION)_p.$(LIBSUFFIX)
40
-endif
41
-else
42
-ifndef SMP
43
 LIBNAME		= $(LIBPREFIX)$(REVISION).$(LIBSUFFIX)
44
 LIBNAME_P	= $(LIBPREFIX)$(REVISION)_p.$(LIBSUFFIX)
45
-else
46
-LIBNAME		= $(LIBPREFIX)p$(REVISION).$(LIBSUFFIX)
47
-LIBNAME_P	= $(LIBPREFIX)p$(REVISION)_p.$(LIBSUFFIX)
48
-endif
49
-endif
50
-
51
 
52
 LIBDLLNAME   = $(LIBPREFIX).dll
53
 LIBSONAME    = $(LIBNAME:.$(LIBSUFFIX)=.so)
54
@@ -1067,7 +1060,7 @@ LIB_COMPONENTS = CBLAS
55
 endif
56
 
57
 export OSNAME
58
-export ARCH
59
+export ARCH_
60
 export CORE
61
 export LIBCORE
62
 export PGCPATH
(-)math/openblas/files/patch-c_check (-2 / +2 lines)
Lines 1-6 Link Here
1
--- c_check.orig	2015-10-27 20:44:50 UTC
1
--- c_check.orig	2018-08-30 22:07:48 UTC
2
+++ c_check
2
+++ c_check
3
@@ -235,7 +235,7 @@ open(CONFFILE, "> $config"  ) || die "Ca
3
@@ -293,7 +293,7 @@ open(CONFFILE, "> $config"  ) || die "Ca
4
 # print $data, "\n";
4
 # print $data, "\n";
5
 
5
 
6
 print MAKEFILE "OSNAME=$os\n";
6
 print MAKEFILE "OSNAME=$os\n";
(-)math/openblas/files/patch-common__arm.h (-2 / +2 lines)
Lines 1-6 Link Here
1
--- common_arm.h.orig	2016-09-01 03:58:42 UTC
1
--- common_arm.h.orig	2018-08-30 22:07:48 UTC
2
+++ common_arm.h
2
+++ common_arm.h
3
@@ -93,6 +93,17 @@ static inline int blas_quickdivide(blasint x, blasint
3
@@ -93,6 +93,17 @@ static inline int blas_quickdivide(blasi
4
 
4
 
5
 #endif
5
 #endif
6
 
6
 
(-)math/openblas/files/patch-cpuid__arm64.c (-2 / +2 lines)
Lines 1-6 Link Here
1
--- cpuid_arm64.c.orig	2016-09-01 03:58:42 UTC
1
--- cpuid_arm64.c.orig	2018-08-30 22:07:48 UTC
2
+++ cpuid_arm64.c
2
+++ cpuid_arm64.c
3
@@ -132,6 +132,8 @@ int detect(void)
3
@@ -151,6 +151,8 @@ int detect(void)
4
 
4
 
5
 
5
 
6
 	}
6
 	}
(-)math/openblas/files/patch-cpuid_sparc.c (-10 lines)
Lines 1-10 Link Here
1
--- cpuid_sparc.c.orig	2015-10-27 20:44:50 UTC
2
+++ cpuid_sparc.c
3
@@ -49,6 +49,7 @@ void get_subdirname(void){
4
 }
5
 
6
 void get_cpuconfig(void){
7
+  printf("#define SPARC\n");
8
   printf("#define V9\n");
9
   printf("#define DTB_DEFAULT_ENTRIES 32\n");
10
 }
(-)math/openblas/files/patch-driver_others_memory.c (-2 / +2 lines)
Lines 1-8 Link Here
1
Passing a priority level to constructor/destructor only works on GCC >= 4.3.0;
1
Passing a priority level to constructor/destructor only works on GCC >= 4.3.0;
2
improve the upstream check so that the build works with base GCC.
2
improve the upstream check so that the build works with base GCC.
3
--- driver/others/memory.c.orig	2016-04-12 19:29:19 UTC
3
--- driver/others/memory.c.orig	2018-08-30 22:07:48 UTC
4
+++ driver/others/memory.c
4
+++ driver/others/memory.c
5
@@ -144,7 +144,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF
5
@@ -1652,7 +1652,7 @@ void gotoblas_dummy_for_PGI(void) {
6
 #if defined(_MSC_VER) && !defined(__clang__)
6
 #if defined(_MSC_VER) && !defined(__clang__)
7
 #define CONSTRUCTOR __cdecl
7
 #define CONSTRUCTOR __cdecl
8
 #define DESTRUCTOR __cdecl
8
 #define DESTRUCTOR __cdecl
(-)math/openblas/files/patch-exports+Makefile (-18 lines)
Lines 1-18 Link Here
1
--- exports/Makefile.orig	2015-10-27 20:44:50 UTC
2
+++ exports/Makefile
3
@@ -140,6 +140,7 @@ endif
4
 #http://stackoverflow.com/questions/7656425/makefile-ifeq-logical-or
5
 ifeq ($(OSNAME), $(filter $(OSNAME),FreeBSD NetBSD))
6
 
7
+EXTRALIB += -lgfortran
8
 so : ../$(LIBSONAME)
9
 
10
 ifeq (, $(SYMBOLPREFIX)$(SYMBOLSUFFIX))
11
@@ -151,6 +152,7 @@ else
12
 endif
13
 	$(CC) $(CFLAGS) $(LDFLAGS)  -shared -o ../$(LIBSONAME) \
14
 	-Wl,--whole-archive $< -Wl,--no-whole-archive \
15
+	-Wl,-soname,$(LIBPREFIX).so.$(MAJOR_VERSION) \
16
 	$(FEXTRALIB) $(EXTRALIB)
17
 	$(CC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.
18
 	rm -f linktest
(-)math/openblas/files/patch-f_check (-3 / +3 lines)
Lines 1-6 Link Here
1
--- f_check.orig	2015-10-27 20:44:50 UTC
1
--- f_check.orig	2018-08-30 22:07:48 UTC
2
+++ f_check
2
+++ f_check
3
@@ -261,7 +261,7 @@ if ($link ne "") {
3
@@ -288,7 +288,7 @@ if ($link ne "") {
4
 
4
 
5
     foreach $flags (@flags) {
5
     foreach $flags (@flags) {
6
 	if (
6
 	if (
Lines 9-15 Link Here
9
 	    && ($flags !~ /^-LIST:/)
9
 	    && ($flags !~ /^-LIST:/)
10
 	    && ($flags !~ /^-LANG:/)
10
 	    && ($flags !~ /^-LANG:/)
11
 	    ) {
11
 	    ) {
12
@@ -292,7 +292,7 @@ if ($link ne "") {
12
@@ -326,7 +326,7 @@ if ($link ne "") {
13
 	}
13
 	}
14
 
14
 
15
 	if (
15
 	if (
(-)math/openblas/files/patch-interface__ztrmv.c (-2 / +2 lines)
Lines 1-6 Link Here
1
--- interface/ztrmv.c.orig	2016-09-01 03:58:42 UTC
1
--- interface/ztrmv.c.orig	2018-08-30 22:07:48 UTC
2
+++ interface/ztrmv.c
2
+++ interface/ztrmv.c
3
@@ -242,7 +242,7 @@ void CNAME(enum CBLAS_ORDER order, enum 
3
@@ -248,7 +248,7 @@ void CNAME(enum CBLAS_ORDER order, enum 
4
   else
4
   else
5
 #endif
5
 #endif
6
   {
6
   {

Return to bug 231371