diff options
Diffstat (limited to 'math/openblas/Makefile')
-rw-r--r-- | math/openblas/Makefile | 98 |
1 files changed, 37 insertions, 61 deletions
diff --git a/math/openblas/Makefile b/math/openblas/Makefile index 8a25c13df839..0196d5736bac 100644 --- a/math/openblas/Makefile +++ b/math/openblas/Makefile @@ -3,6 +3,7 @@ PORTNAME= openblas PORTVERSION= 0.3.7 +PORTREVISION= 1 DISTVERSIONPREFIX= v PORTEPOCH= 1 CATEGORIES= math @@ -36,11 +37,11 @@ USE_PERL5= build OPENBLAS_SVER= 0 TEST_TARGET= tests -BUILDFLAGS= FCOMMON_OPT=-frecursive MAKE_NB_JOBS=-1 +PLIST_SUB+= PORTVERSION=${PORTVERSION} OPTIONS_DEFINE= INTERFACE64 OPENMP -OPTIONS_DEFINE_i386= AVX AVX2 DYNAMIC_ARCH -OPTIONS_DEFINE_amd64= AVX AVX2 DYNAMIC_ARCH +OPTIONS_DEFINE_i386= AVX AVX2 DYNAMIC_ARCH +OPTIONS_DEFINE_amd64= AVX AVX2 DYNAMIC_ARCH OPTIONS_DEFINE_powerpc64= POWER6 OPTIONS_EXCLUDE_powerpc64= OPENMP @@ -67,46 +68,20 @@ TARGET_CPU_ARCH= PPC970 . endif .endif -.if defined(TARGET_CPU_ARCH) -BUILDFLAGS+= TARGET=${TARGET_CPU_ARCH} -MAKE_ENV+= TARGET=${TARGET_CPU_ARCH} -.endif - -MAXTHREADS?= 64 -BUILDFLAGS_THREAD+= NUM_THREADS=${MAXTHREADS} USE_THREAD=1 - -.if ${ARCH:M*64} == "" -BUILDFLAGS+= BINARY32=1 -.else -BUILDFLAGS+= BINARY64=1 -.endif +MAXTHREADS?= 64 .if ! ${PORT_OPTIONS:MDYNAMIC_ARCH} && ( ${ARCH} == "amd64" || ${ARCH} == "i386" ) MANUAL_PACKAGE_BUILD= Optimizes for the build machine. .endif .if ${PORT_OPTIONS:MDYNAMIC_ARCH} -BUILDFLAGS+= DYNAMIC_ARCH=1 PLIST_SUB+= DYNARCH="" .else PLIST_SUB+= DYNARCH="@comment " .endif -.if ${PORT_OPTIONS:MINTERFACE64} -BUILDFLAGS+= INTERFACE64=1 -.endif - -.if ! ${PORT_OPTIONS:MAVX} -BUILDFLAGS+= NO_AVX=1 -.endif - -.if ! ${PORT_OPTIONS:MAVX2} -BUILDFLAGS+= NO_AVX2=1 -.endif - .if ${PORT_OPTIONS:MOPENMP} -USES+= compiler:openmp -BUILDFLAGS_THREAD+= USE_OPENMP=1 +USES+= compiler:openmp .else USES+= compiler:c11 .endif @@ -123,6 +98,35 @@ post-extract: cd ${DISTDIR}/${DIST_SUBDIR} ; \ ${CP} ${LARGE_FILE} ${TIMING_FILE} ${WRKSRC} +post-patch: + @${ECHO} MAKE_NB_JOBS=-1 >> ${WRKSRC}/Makefile.rule + @${ECHO} NUM_THREADS=${MAXTHREADS} >> ${WRKSRC}/Makefile.rule + @${ECHO} USE_THREAD=1 >> ${WRKSRC}/Makefile.rule +.if ! ${PORT_OPTIONS:MAVX} + @${ECHO} NO_AVX=1 >> ${WRKSRC}/Makefile.rule +.endif +.if ! ${PORT_OPTIONS:MAVX2} + @${ECHO} NO_AVX2=1 >> ${WRKSRC}/Makefile.rule +.endif +.if ${PORT_OPTIONS:MDYNAMIC_ARCH} + @${ECHO} DYNAMIC_ARCH=1 >> ${WRKSRC}/Makefile.rule + @${ECHO} DYNAMIC_OLDER=1 >> ${WRKSRC}/Makefile.rule +.endif +.if defined(TARGET_CPU_ARCH) + @${ECHO} TARGET=${TARGET_CPU_ARCH} >> ${WRKSRC}/Makefile.rule +.endif +.if ${PORT_OPTIONS:MINTERFACE64} + @${ECHO} INTERFACE64=1 >> ${WRKSRC}/Makefile.rule +.endif +.if ${PORT_OPTIONS:MOPENMP} + @${ECHO} USE_OPENMP=1 >> ${WRKSRC}/Makefile.rule +.endif +.if ${ARCH:M*64} == "" + @${ECHO} BINARY=32 >> ${WRKSRC}/Makefile.rule +.else + @${ECHO} BINARY=64 >> ${WRKSRC}/Makefile.rule +.endif + post-patch-OPENMP-on: @${REINPLACE_CMD} -e "s+OPENBLAS_NUM_THREADS+OMP_NUM_THREADS+g" \ ${WRKSRC}/test/Makefile \ @@ -136,35 +140,7 @@ BENCHMARK_THREADS_FLAG= OPENBLAS_NUM_THREADS=${BENCHMARK_MAXTHREADS} .endif benchmark: build - cd ${WRKSRC} ; ${SETENV} ${BUILDFLAGS} NUM_THREADS=${MAXTHREADS} \ - USE_THREAD=1 ${MAKE_CMD} ${MAKE_ARGS} hpl - cd ${WRKSRC}/benchmark ; ${SETENV} ${BUILDFLAGS} NUM_THREADS=${MAXTHREADS} \ - USE_THREAD=1 ${BENCHMARK_THREADS_FLAG} ${MAKE_CMD} ${MAKE_ARGS} - -post-install: - cd ${WRKSRC} && \ - ${FIND} . -name 'common*.h' -print | ${XARGS} ${BASENAME} | ${XARGS} -I {} ${MV} {} openblas_{} - ${MV} ${WRKSRC}/version.h ${WRKSRC}/openblas_version.h - ${MV} ${WRKSRC}/param.h ${WRKSRC}/openblas_param.h - ${MV} ${WRKSRC}/cpuid.h ${WRKSRC}/openblas_cpuid.h - ${MV} ${WRKSRC}/config.h ${WRKSRC}/openblas_config.h - ${REINPLACE_CMD} \ - -e 's/"common.h"/"openblas_common.h"/' \ - -e 's/"version.h"/"openblas_version.h"/' \ - -e 's/"param.h"/"openblas_param.h"/' \ - -e 's/"cpuid.h"/"openblas_cpuid.h"/' \ - -e 's/"config.h"/"openblas_config.h"/' \ - -e 's/"common_/"openblas_common_/' \ - ${WRKSRC}/*.h \ - ${WRKSRC}/*.c \ - ${WRKSRC}/interface/*.c - ${MKDIR} ${STAGEDIR}${PREFIX}/include/openblas - ${INSTALL_DATA} ${WRKSRC}/openblas_*.h ${STAGEDIR}${PREFIX}/include/openblas - ${INSTALL_DATA} ${WRKSRC}/cblas.h ${WRKSRC}/config_last.h ${WRKSRC}/l1param.h ${WRKSRC}/l2param.h ${WRKSRC}/symcopy.h \ - ${STAGEDIR}${PREFIX}/include/openblas - ${MV} ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}_*-r${PORTVERSION}.a ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}.a - ${MV} ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}_*-r${PORTVERSION}.so ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}.so.${OPENBLAS_SVER} - ${RM} ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}.so - ${LN} -sf lib${PORTNAME}.so.${OPENBLAS_SVER} ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}.so + cd ${WRKSRC} ; ${SETENV} ${MAKE_CMD} ${MAKE_ARGS} hpl + cd ${WRKSRC}/benchmark ; ${SETENV} ${BENCHMARK_THREADS_FLAG} ${MAKE_CMD} ${MAKE_ARGS} .include <bsd.port.post.mk> |