Lines 2-9
Link Here
|
2 |
# $FreeBSD$ |
2 |
# $FreeBSD$ |
3 |
|
3 |
|
4 |
PORTNAME= openblas |
4 |
PORTNAME= openblas |
5 |
PORTVERSION= 0.2.20 |
5 |
PORTVERSION= 0.3.6 |
6 |
PORTREVISION= 8 |
|
|
7 |
DISTVERSIONPREFIX= v |
6 |
DISTVERSIONPREFIX= v |
8 |
PORTEPOCH= 1 |
7 |
PORTEPOCH= 1 |
9 |
CATEGORIES= math |
8 |
CATEGORIES= math |
Lines 17-26
Link Here
|
17 |
LICENSE= BSD3CLAUSE |
16 |
LICENSE= BSD3CLAUSE |
18 |
LICENSE_FILE= ${WRKSRC}/LICENSE |
17 |
LICENSE_FILE= ${WRKSRC}/LICENSE |
19 |
|
18 |
|
20 |
BROKEN_powerpc64= fails to compile: gemm.c:403: 'SGEMM_DEFAULT_Q' undeclared (first use in this function) |
19 |
CONFLICTS_INSTALL= cblas lapacke |
21 |
|
20 |
|
22 |
USES= fortran gmake perl5 |
21 |
USES= fortran gmake perl5 pkgconfig |
23 |
|
|
|
24 |
USE_GITHUB= yes |
22 |
USE_GITHUB= yes |
25 |
GH_ACCOUNT= xianyi |
23 |
GH_ACCOUNT= xianyi |
26 |
GH_PROJECT= OpenBLAS |
24 |
GH_PROJECT= OpenBLAS |
Lines 30-40
Link Here
|
30 |
USE_LDCONFIG= yes |
28 |
USE_LDCONFIG= yes |
31 |
USE_PERL5= build |
29 |
USE_PERL5= build |
32 |
|
30 |
|
33 |
OPENBLAS_SUFX= r${PORTVERSION} |
|
|
34 |
OPENBLAS_LIBS= libopenblas libopenblasp |
35 |
OPENBLAS_SVER= 0 |
31 |
OPENBLAS_SVER= 0 |
36 |
OPENBLAS_FILES= ${OPENBLAS_LIBS:S|$|.so|} ${OPENBLAS_LIBS:S|$|.so.${OPENBLAS_SVER}|} ${OPENBLAS_LIBS:S|$|.a|} |
|
|
37 |
PLIST_FILES= ${OPENBLAS_FILES:S|^|lib/|} |
38 |
TEST_TARGET= tests |
32 |
TEST_TARGET= tests |
39 |
|
33 |
|
40 |
BUILDFLAGS= FCOMMON_OPT=-frecursive MAKE_NB_JOBS=-1 |
34 |
BUILDFLAGS= FCOMMON_OPT=-frecursive MAKE_NB_JOBS=-1 |
Lines 54-59
Link Here
|
54 |
AVX_DESC= Support Advanced Vector Extensions (AVX) |
48 |
AVX_DESC= Support Advanced Vector Extensions (AVX) |
55 |
AVX2_DESC= Support Advanced Vector Extensions 2 (AVX2) |
49 |
AVX2_DESC= Support Advanced Vector Extensions 2 (AVX2) |
56 |
|
50 |
|
|
|
51 |
MAKE_ENV+= ${MAKE_ENV_${ARCH}} |
52 |
MAKE_ENV_powerpc64= TARGET=POWER7 |
53 |
|
57 |
.include <bsd.port.options.mk> |
54 |
.include <bsd.port.options.mk> |
58 |
|
55 |
|
59 |
.if defined(TARGET_CPU_ARCH) |
56 |
.if defined(TARGET_CPU_ARCH) |
Lines 81-91
Link Here
|
81 |
BUILDFLAGS+= INTERFACE64=1 |
78 |
BUILDFLAGS+= INTERFACE64=1 |
82 |
.endif |
79 |
.endif |
83 |
|
80 |
|
84 |
.if ${PORT_OPTIONS:MOPENMP} |
|
|
85 |
USES+= compiler:openmp |
86 |
BUILDFLAGS_THREAD+= USE_OPENMP=1 |
87 |
.endif |
88 |
|
89 |
.if ! ${PORT_OPTIONS:MAVX} |
81 |
.if ! ${PORT_OPTIONS:MAVX} |
90 |
BUILDFLAGS+= NO_AVX=1 |
82 |
BUILDFLAGS+= NO_AVX=1 |
91 |
.endif |
83 |
.endif |
Lines 94-99
Link Here
|
94 |
BUILDFLAGS+= NO_AVX2=1 |
86 |
BUILDFLAGS+= NO_AVX2=1 |
95 |
.endif |
87 |
.endif |
96 |
|
88 |
|
|
|
89 |
.if ${PORT_OPTIONS:MOPENMP} |
90 |
USES+= compiler:openmp |
91 |
BUILDFLAGS_THREAD+= USE_OPENMP=1 |
92 |
.else |
93 |
USES+= compiler:c11 |
94 |
.endif |
95 |
|
96 |
.include <bsd.port.pre.mk> |
97 |
|
98 |
.if ${PORT_OPTIONS:MOPENMP} |
99 |
.if ${CHOSEN_COMPILER_TYPE} == gcc |
100 |
USE_GCC= yes |
101 |
.endif |
102 |
.endif |
103 |
|
97 |
post-extract: |
104 |
post-extract: |
98 |
cd ${DISTDIR}/${DIST_SUBDIR} ; \ |
105 |
cd ${DISTDIR}/${DIST_SUBDIR} ; \ |
99 |
${CP} ${LARGE_FILE} ${TIMING_FILE} ${WRKSRC} |
106 |
${CP} ${LARGE_FILE} ${TIMING_FILE} ${WRKSRC} |
Lines 100-136
Link Here
|
100 |
${MKDIR} ${WRKDIR}/lib |
107 |
${MKDIR} ${WRKDIR}/lib |
101 |
|
108 |
|
102 |
post-patch: |
109 |
post-patch: |
103 |
${REINPLACE_CMD} -e "s+%%FIND%%+${FIND}+" \ |
110 |
${REINPLACE_CMD} \ |
104 |
-e "s+%%XARGS%%+${XARGS}+" \ |
111 |
-e 's/defined(linux)/(defined(linux) || defined(__FreeBSD__))/g' \ |
105 |
-e "s+%%REINPLACE_CMD%%+${REINPLACE_CMD}+" \ |
112 |
-e 's/ifdef linux/if defined(linux) || defined(__FreeBSD__)/g' \ |
106 |
${WRKSRC}/Makefile |
113 |
${WRKSRC}/kernel/power/*.S |
107 |
${REINPLACE_CMD} -e "s+%%FC%%+${FC}+" -e "s+%%CC%%+${CC}+" \ |
|
|
108 |
${WRKSRC}/Makefile.rule |
109 |
${REINPLACE_CMD} -e "s+(ARCH)+(ARCH_)+" \ |
110 |
${WRKSRC}/Makefile.rule \ |
111 |
${WRKSRC}/Makefile.tail \ |
112 |
${WRKSRC}/driver/level3/Makefile \ |
113 |
${WRKSRC}/driver/others/Makefile \ |
114 |
${WRKSRC}/exports/Makefile \ |
115 |
${WRKSRC}/interface/Makefile \ |
116 |
${WRKSRC}/kernel/Makefile \ |
117 |
${WRKSRC}/kernel/Makefile.L3 \ |
118 |
${WRKSRC}/lapack/laswp/Makefile \ |
119 |
${WRKSRC}/lapack-netlib/SRC/Makefile \ |
120 |
${WRKSRC}/lapack-netlib/SRC/VARIANTS/Makefile \ |
121 |
${WRKSRC}/lapack-netlib/TESTING/MATGEN/Makefile \ |
122 |
${WRKSRC}/lapack-netlib/LAPACKE/src/Makefile \ |
123 |
${WRKSRC}/lapack-netlib/LAPACKE/utils/Makefile \ |
124 |
${WRKSRC}/reference/Makefile |
125 |
${REINPLACE_CMD} -e "s+(ARCH)+(ARCH_)+" \ |
126 |
-e 's+%%LDFLAGS%%+${LDFLAGS}+' \ |
127 |
-e 's+%%LOCALBASE%%+${LOCALBASE}+' \ |
128 |
-e 's+%%FIND%%+${FIND}+' \ |
129 |
-e 's+%%XARGS%%+${XARGS}+' \ |
130 |
-e 's+%%REINPLACE_CMD%%+${REINPLACE_CMD}+' \ |
131 |
-e 's+$${CROSS_SUFFIX}+${LOCALBASE}/bin/+' \ |
132 |
-e '/Clang.*OpenMP/g' \ |
133 |
${WRKSRC}/Makefile.system |
134 |
|
114 |
|
135 |
post-patch-OPENMP-on: |
115 |
post-patch-OPENMP-on: |
136 |
${REINPLACE_CMD} -e "s+OPENBLAS_NUM_THREADS+OMP_NUM_THREADS+g" \ |
116 |
${REINPLACE_CMD} -e "s+OPENBLAS_NUM_THREADS+OMP_NUM_THREADS+g" \ |
Lines 137-152
Link Here
|
137 |
${WRKSRC}/test/Makefile \ |
117 |
${WRKSRC}/test/Makefile \ |
138 |
${WRKSRC}/ctest/Makefile |
118 |
${WRKSRC}/ctest/Makefile |
139 |
|
119 |
|
140 |
do-build: |
120 |
post-install: |
141 |
cd ${WRKSRC} ; ${SETENV} ${BUILDFLAGS} NUM_THREADS=1 USE_THREAD=0 \ |
121 |
${MV} ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}_*-r${PORTVERSION}.a ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}.a |
142 |
${MAKE_CMD} ${MAKE_ARGS} |
122 |
${MV} ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}_*-r${PORTVERSION}.so ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}.so.${OPENBLAS_SVER} |
143 |
${CP} ${WRKSRC}/libopenblas-${OPENBLAS_SUFX}.a ${WRKDIR}/lib/libopenblas.a |
123 |
${RM} ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}.so |
144 |
${CP} ${WRKSRC}/libopenblas-${OPENBLAS_SUFX}.so ${WRKDIR}/lib/libopenblas.so.${OPENBLAS_SVER} |
124 |
${LN} -sf lib${PORTNAME}.so.${OPENBLAS_SVER} ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}.so |
145 |
cd ${WRKSRC} ; ${MAKE_CMD} ${MAKE_ARGS} clean |
|
|
146 |
cd ${WRKSRC} ; ${SETENV} ${BUILDFLAGS} ${BUILDFLAGS_THREAD} \ |
147 |
${MAKE_CMD} ${MAKE_ARGS} |
148 |
${CP} ${WRKSRC}/libopenblasp-${OPENBLAS_SUFX}.a ${WRKDIR}/lib/libopenblasp.a |
149 |
${CP} ${WRKSRC}/libopenblasp-${OPENBLAS_SUFX}.so ${WRKDIR}/lib/libopenblasp.so.${OPENBLAS_SVER} |
150 |
|
125 |
|
151 |
BENCHMARK_MAXTHREADS?= ${MAXTHREADS} |
126 |
BENCHMARK_MAXTHREADS?= ${MAXTHREADS} |
152 |
.if ${PORT_OPTIONS:MOPENMP} |
127 |
.if ${PORT_OPTIONS:MOPENMP} |
Lines 161-171
Link Here
|
161 |
cd ${WRKSRC}/benchmark ; ${SETENV} ${BUILDFLAGS} NUM_THREADS=${MAXTHREADS} \ |
136 |
cd ${WRKSRC}/benchmark ; ${SETENV} ${BUILDFLAGS} NUM_THREADS=${MAXTHREADS} \ |
162 |
USE_THREAD=1 ${BENCHMARK_THREADS_FLAG} ${MAKE_CMD} ${MAKE_ARGS} |
137 |
USE_THREAD=1 ${BENCHMARK_THREADS_FLAG} ${MAKE_CMD} ${MAKE_ARGS} |
163 |
|
138 |
|
164 |
do-install: |
139 |
.include <bsd.port.post.mk> |
165 |
.for L in ${OPENBLAS_LIBS} |
|
|
166 |
${INSTALL_DATA} ${WRKDIR}/lib/${L}.a ${STAGEDIR}${PREFIX}/lib |
167 |
${INSTALL_LIB} ${WRKDIR}/lib/${L}.so.${OPENBLAS_SVER} ${STAGEDIR}${PREFIX}/lib |
168 |
${LN} -sf ${L}.so.${OPENBLAS_SVER} ${STAGEDIR}${PREFIX}/lib/${L}.so |
169 |
.endfor |
170 |
|
171 |
.include <bsd.port.mk> |