Lines 2-14
Link Here
|
2 |
# $FreeBSD$ |
2 |
# $FreeBSD$ |
3 |
|
3 |
|
4 |
PORTNAME= openblas |
4 |
PORTNAME= openblas |
5 |
PORTVERSION= 0.2.20 |
5 |
PORTVERSION= 0.3.7 |
6 |
PORTREVISION= 11 |
|
|
7 |
DISTVERSIONPREFIX= v |
6 |
DISTVERSIONPREFIX= v |
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 |
11 |
DISTFILES= large.tgz:lapack_tmg timing.tgz:lapack_tmg |
10 |
DISTFILES= large.tgz:lapack_tmg \ |
|
|
11 |
timing.tgz:lapack_tmg |
12 |
DIST_SUBDIR= openblas |
12 |
DIST_SUBDIR= openblas |
13 |
|
13 |
|
14 |
MAINTAINER= phd_kimberlite@yahoo.co.jp |
14 |
MAINTAINER= phd_kimberlite@yahoo.co.jp |
Lines 17-23
COMMENT= Optimized BLAS library based on GotoBLAS2
Link Here
|
17 |
LICENSE= BSD3CLAUSE |
17 |
LICENSE= BSD3CLAUSE |
18 |
LICENSE_FILE= ${WRKSRC}/LICENSE |
18 |
LICENSE_FILE= ${WRKSRC}/LICENSE |
19 |
|
19 |
|
20 |
USES= fortran gmake perl5 |
20 |
USES= fortran gmake perl5 pkgconfig |
|
|
21 |
|
22 |
CONFLICTS_INSTALL= cblas lapacke |
21 |
|
23 |
|
22 |
USE_GITHUB= yes |
24 |
USE_GITHUB= yes |
23 |
GH_ACCOUNT= xianyi |
25 |
GH_ACCOUNT= xianyi |
Lines 28-45
TIMING_FILE= timing.tgz
Link Here
|
28 |
USE_LDCONFIG= yes |
30 |
USE_LDCONFIG= yes |
29 |
USE_PERL5= build |
31 |
USE_PERL5= build |
30 |
|
32 |
|
31 |
OPENBLAS_SUFX= r${PORTVERSION} |
|
|
32 |
OPENBLAS_LIBS= libopenblas libopenblasp |
33 |
OPENBLAS_SVER= 0 |
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 |
34 |
TEST_TARGET= tests |
37 |
|
35 |
|
38 |
BUILDFLAGS= FCOMMON_OPT=-frecursive MAKE_NB_JOBS=-1 |
36 |
BUILDFLAGS= FCOMMON_OPT=-frecursive MAKE_NB_JOBS=-1 |
39 |
|
37 |
|
40 |
OPTIONS_DEFINE= INTERFACE64 OPENMP |
38 |
OPTIONS_DEFINE= INTERFACE64 OPENMP |
41 |
OPTIONS_DEFINE_i386= DYNAMIC_ARCH AVX AVX2 |
39 |
OPTIONS_DEFINE_i386= AVX AVX2 DYNAMIC_ARCH |
42 |
OPTIONS_DEFINE_amd64= ${OPTIONS_DEFINE_i386} |
40 |
OPTIONS_DEFINE_amd64= AVX AVX2 DYNAMIC_ARCH |
43 |
OPTIONS_DEFINE_powerpc64= POWER6 |
41 |
OPTIONS_DEFINE_powerpc64= POWER6 |
44 |
OPTIONS_EXCLUDE_powerpc64= OPENMP |
42 |
OPTIONS_EXCLUDE_powerpc64= OPENMP |
45 |
|
43 |
|
Lines 55-64
AVX_DESC= Support Advanced Vector Extensions (AVX)
Link Here
|
55 |
AVX2_DESC= Support Advanced Vector Extensions 2 (AVX2) |
53 |
AVX2_DESC= Support Advanced Vector Extensions 2 (AVX2) |
56 |
POWER6_DESC= Optimize for POWER6, instead of the default PPC970 |
54 |
POWER6_DESC= Optimize for POWER6, instead of the default PPC970 |
57 |
|
55 |
|
|
|
56 |
MAKE_ENV+= ${MAKE_ENV_${ARCH}} |
57 |
MAKE_ENV_powerpc64= TARGET=POWER7 |
58 |
|
58 |
.include <bsd.port.options.mk> |
59 |
.include <bsd.port.options.mk> |
59 |
|
60 |
|
60 |
.if ${ARCH} == powerpc64 |
61 |
.if ${ARCH} == powerpc64 |
61 |
USE_GCC= yes |
62 |
USE_GCC= yes |
62 |
. if ${PORT_OPTIONS:MPOWER6} |
63 |
. if ${PORT_OPTIONS:MPOWER6} |
63 |
TARGET_CPU_ARCH= POWER6 |
64 |
TARGET_CPU_ARCH= POWER6 |
64 |
.else |
65 |
.else |
Lines 70-76
TARGET_CPU_ARCH= PPC970
Link Here
|
70 |
BUILDFLAGS+= TARGET=${TARGET_CPU_ARCH} |
71 |
BUILDFLAGS+= TARGET=${TARGET_CPU_ARCH} |
71 |
.endif |
72 |
.endif |
72 |
|
73 |
|
73 |
MAXTHREADS?= 64 |
74 |
MAXTHREADS?= 64 |
74 |
BUILDFLAGS_THREAD+= NUM_THREADS=${MAXTHREADS} USE_THREAD=1 |
75 |
BUILDFLAGS_THREAD+= NUM_THREADS=${MAXTHREADS} USE_THREAD=1 |
75 |
|
76 |
|
76 |
.if ${ARCH:M*64} == "" |
77 |
.if ${ARCH:M*64} == "" |
Lines 91-109
BUILDFLAGS+= DYNAMIC_ARCH=1
Link Here
|
91 |
BUILDFLAGS+= INTERFACE64=1 |
92 |
BUILDFLAGS+= INTERFACE64=1 |
92 |
.endif |
93 |
.endif |
93 |
|
94 |
|
|
|
95 |
.if ! ${PORT_OPTIONS:MAVX} |
96 |
BUILDFLAGS+= NO_AVX=1 |
97 |
.endif |
98 |
|
99 |
.if ! ${PORT_OPTIONS:MAVX2} |
100 |
BUILDFLAGS+= NO_AVX2=1 |
101 |
.endif |
102 |
|
94 |
.if ${PORT_OPTIONS:MOPENMP} |
103 |
.if ${PORT_OPTIONS:MOPENMP} |
95 |
USES+= compiler:openmp |
104 |
USES+= compiler:openmp |
96 |
BUILDFLAGS_THREAD+= USE_OPENMP=1 |
105 |
BUILDFLAGS_THREAD+= USE_OPENMP=1 |
97 |
.else |
106 |
.else |
98 |
USES+= compiler:c11 |
107 |
USES+= compiler:c11 |
99 |
.endif |
108 |
.endif |
100 |
|
109 |
|
101 |
.if ! ${PORT_OPTIONS:MAVX} |
110 |
.include <bsd.port.pre.mk> |
102 |
BUILDFLAGS+= NO_AVX=1 |
|
|
103 |
.endif |
104 |
|
111 |
|
105 |
.if ! ${PORT_OPTIONS:MAVX2} |
112 |
.if ${PORT_OPTIONS:MOPENMP} |
106 |
BUILDFLAGS+= NO_AVX2=1 |
113 |
.if ${CHOSEN_COMPILER_TYPE} == gcc |
|
|
114 |
USE_GCC= yes |
115 |
.endif |
107 |
.endif |
116 |
.endif |
108 |
|
117 |
|
109 |
post-extract: |
118 |
post-extract: |
Lines 111-174
post-extract:
Link Here
|
111 |
${CP} ${LARGE_FILE} ${TIMING_FILE} ${WRKSRC} |
120 |
${CP} ${LARGE_FILE} ${TIMING_FILE} ${WRKSRC} |
112 |
${MKDIR} ${WRKDIR}/lib |
121 |
${MKDIR} ${WRKDIR}/lib |
113 |
|
122 |
|
114 |
post-patch: |
|
|
115 |
${REINPLACE_CMD} -e "s+%%FIND%%+${FIND}+" \ |
116 |
-e "s+%%XARGS%%+${XARGS}+" \ |
117 |
-e "s+%%REINPLACE_CMD%%+${REINPLACE_CMD}+" \ |
118 |
${WRKSRC}/Makefile |
119 |
${REINPLACE_CMD} -e "s+%%FC%%+${FC}+" -e "s+%%CC%%+${CC}+" \ |
120 |
${WRKSRC}/Makefile.rule |
121 |
${REINPLACE_CMD} -e "s+(ARCH)+(ARCH_)+" \ |
122 |
${WRKSRC}/Makefile.rule \ |
123 |
${WRKSRC}/Makefile.tail \ |
124 |
${WRKSRC}/driver/level3/Makefile \ |
125 |
${WRKSRC}/driver/others/Makefile \ |
126 |
${WRKSRC}/exports/Makefile \ |
127 |
${WRKSRC}/interface/Makefile \ |
128 |
${WRKSRC}/kernel/Makefile \ |
129 |
${WRKSRC}/kernel/Makefile.L3 \ |
130 |
${WRKSRC}/lapack/laswp/Makefile \ |
131 |
${WRKSRC}/lapack-netlib/SRC/Makefile \ |
132 |
${WRKSRC}/lapack-netlib/SRC/VARIANTS/Makefile \ |
133 |
${WRKSRC}/lapack-netlib/TESTING/MATGEN/Makefile \ |
134 |
${WRKSRC}/lapack-netlib/LAPACKE/src/Makefile \ |
135 |
${WRKSRC}/lapack-netlib/LAPACKE/utils/Makefile \ |
136 |
${WRKSRC}/reference/Makefile |
137 |
${REINPLACE_CMD} -e "s+(ARCH)+(ARCH_)+" \ |
138 |
-e 's+%%LDFLAGS%%+${LDFLAGS}+' \ |
139 |
-e 's+%%LOCALBASE%%+${LOCALBASE}+' \ |
140 |
-e 's+%%FIND%%+${FIND}+' \ |
141 |
-e 's+%%XARGS%%+${XARGS}+' \ |
142 |
-e 's+%%REINPLACE_CMD%%+${REINPLACE_CMD}+' \ |
143 |
-e 's+$${CROSS_SUFFIX}+${LOCALBASE}/bin/+' \ |
144 |
-e '/Clang.*OpenMP/g' \ |
145 |
${WRKSRC}/Makefile.system |
146 |
${REINPLACE_CMD} \ |
147 |
-e 's/defined(linux)/(defined(linux) || defined(__FreeBSD__))/g' \ |
148 |
-e 's/ifdef linux/if defined(linux) || defined(__FreeBSD__)/g' \ |
149 |
${WRKSRC}/kernel/power/*.S |
150 |
|
151 |
post-patch-OPENMP-on: |
123 |
post-patch-OPENMP-on: |
152 |
${REINPLACE_CMD} -e "s+OPENBLAS_NUM_THREADS+OMP_NUM_THREADS+g" \ |
124 |
@${REINPLACE_CMD} -e "s+OPENBLAS_NUM_THREADS+OMP_NUM_THREADS+g" \ |
153 |
${WRKSRC}/test/Makefile \ |
125 |
${WRKSRC}/test/Makefile \ |
154 |
${WRKSRC}/ctest/Makefile |
126 |
${WRKSRC}/ctest/Makefile |
155 |
|
127 |
|
156 |
do-build: |
|
|
157 |
cd ${WRKSRC} ; ${SETENV} ${BUILDFLAGS} NUM_THREADS=1 USE_THREAD=0 \ |
158 |
${MAKE_CMD} ${MAKE_ARGS} |
159 |
${CP} ${WRKSRC}/libopenblas-${OPENBLAS_SUFX}.a ${WRKDIR}/lib/libopenblas.a |
160 |
${CP} ${WRKSRC}/libopenblas-${OPENBLAS_SUFX}.so ${WRKDIR}/lib/libopenblas.so.${OPENBLAS_SVER} |
161 |
cd ${WRKSRC} ; ${MAKE_CMD} ${MAKE_ARGS} clean |
162 |
cd ${WRKSRC} ; ${SETENV} ${BUILDFLAGS} ${BUILDFLAGS_THREAD} \ |
163 |
${MAKE_CMD} ${MAKE_ARGS} |
164 |
${CP} ${WRKSRC}/libopenblasp-${OPENBLAS_SUFX}.a ${WRKDIR}/lib/libopenblasp.a |
165 |
${CP} ${WRKSRC}/libopenblasp-${OPENBLAS_SUFX}.so ${WRKDIR}/lib/libopenblasp.so.${OPENBLAS_SVER} |
166 |
|
167 |
BENCHMARK_MAXTHREADS?= ${MAXTHREADS} |
128 |
BENCHMARK_MAXTHREADS?= ${MAXTHREADS} |
168 |
.if ${PORT_OPTIONS:MOPENMP} |
129 |
.if ${PORT_OPTIONS:MOPENMP} |
169 |
BENCHMARK_THREADS_FLAG= OMP_NUM_THREADS=${BENCHMARK_MAXTHREADS} |
130 |
BENCHMARK_THREADS_FLAG= OMP_NUM_THREADS=${BENCHMARK_MAXTHREADS} |
170 |
.else |
131 |
.else |
171 |
BENCHMARK_THREADS_FLAG= OPENBLAS_NUM_THREADS=${BENCHMARK_MAXTHREADS} |
132 |
BENCHMARK_THREADS_FLAG= OPENBLAS_NUM_THREADS=${BENCHMARK_MAXTHREADS} |
172 |
.endif |
133 |
.endif |
173 |
|
134 |
|
174 |
benchmark: build |
135 |
benchmark: build |
Lines 177-188
benchmark: build
Link Here
|
177 |
cd ${WRKSRC}/benchmark ; ${SETENV} ${BUILDFLAGS} NUM_THREADS=${MAXTHREADS} \ |
138 |
cd ${WRKSRC}/benchmark ; ${SETENV} ${BUILDFLAGS} NUM_THREADS=${MAXTHREADS} \ |
178 |
USE_THREAD=1 ${BENCHMARK_THREADS_FLAG} ${MAKE_CMD} ${MAKE_ARGS} |
139 |
USE_THREAD=1 ${BENCHMARK_THREADS_FLAG} ${MAKE_CMD} ${MAKE_ARGS} |
179 |
|
140 |
|
180 |
do-install: |
141 |
post-install: |
181 |
.for L in ${OPENBLAS_LIBS} |
|
|
182 |
${INSTALL_DATA} ${WRKDIR}/lib/${L}.a ${STAGEDIR}${PREFIX}/lib |
183 |
${INSTALL_LIB} ${WRKDIR}/lib/${L}.so.${OPENBLAS_SVER} ${STAGEDIR}${PREFIX}/lib |
184 |
${LN} -sf ${L}.so.${OPENBLAS_SVER} ${STAGEDIR}${PREFIX}/lib/${L}.so |
185 |
.endfor |
186 |
cd ${WRKSRC} && \ |
142 |
cd ${WRKSRC} && \ |
187 |
${FIND} . -name 'common*.h' -print | ${XARGS} ${BASENAME} | ${XARGS} -I {} ${MV} {} openblas_{} |
143 |
${FIND} . -name 'common*.h' -print | ${XARGS} ${BASENAME} | ${XARGS} -I {} ${MV} {} openblas_{} |
188 |
${MV} ${WRKSRC}/version.h ${WRKSRC}/openblas_version.h |
144 |
${MV} ${WRKSRC}/version.h ${WRKSRC}/openblas_version.h |
Lines 201-207
do-install:
Link Here
|
201 |
${WRKSRC}/interface/*.c |
157 |
${WRKSRC}/interface/*.c |
202 |
${MKDIR} ${STAGEDIR}${PREFIX}/include/openblas |
158 |
${MKDIR} ${STAGEDIR}${PREFIX}/include/openblas |
203 |
${INSTALL_DATA} ${WRKSRC}/openblas_*.h ${STAGEDIR}${PREFIX}/include/openblas |
159 |
${INSTALL_DATA} ${WRKSRC}/openblas_*.h ${STAGEDIR}${PREFIX}/include/openblas |
204 |
${INSTALL_DATA} ${WRKSRC}/cblas.h ${WRKSRC}/config_kernel.h ${WRKSRC}/config_last.h ${WRKSRC}/l1param.h ${WRKSRC}/l2param.h ${WRKSRC}/symcopy.h \ |
160 |
${INSTALL_DATA} ${WRKSRC}/cblas.h ${WRKSRC}/config_last.h ${WRKSRC}/l1param.h ${WRKSRC}/l2param.h ${WRKSRC}/symcopy.h \ |
205 |
${STAGEDIR}${PREFIX}/include/openblas |
161 |
${STAGEDIR}${PREFIX}/include/openblas |
|
|
162 |
${MV} ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}_*-r${PORTVERSION}.a ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}.a |
163 |
${MV} ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}_*-r${PORTVERSION}.so ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}.so.${OPENBLAS_SVER} |
164 |
${RM} ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}.so |
165 |
${LN} -sf lib${PORTNAME}.so.${OPENBLAS_SVER} ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}.so |
206 |
|
166 |
|
207 |
.include <bsd.port.mk> |
167 |
.include <bsd.port.post.mk> |