Index: head/math/openblas/Makefile =================================================================== --- head/math/openblas/Makefile (revision 507633) +++ head/math/openblas/Makefile (revision 507634) @@ -1,179 +1,185 @@ # Created by: Eijiro Shibusawa # $FreeBSD$ PORTNAME= openblas PORTVERSION= 0.2.20 -PORTREVISION= 9 +PORTREVISION= 10 DISTVERSIONPREFIX= v PORTEPOCH= 1 CATEGORIES= math MASTER_SITES= NL/lapack/timing/:lapack_tmg DISTFILES= large.tgz:lapack_tmg timing.tgz:lapack_tmg DIST_SUBDIR= openblas MAINTAINER= phd_kimberlite@yahoo.co.jp COMMENT= Optimized BLAS library based on GotoBLAS2 LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE USES= fortran gmake perl5 USE_GITHUB= yes GH_ACCOUNT= xianyi GH_PROJECT= OpenBLAS LARGE_FILE= large.tgz TIMING_FILE= timing.tgz USE_LDCONFIG= yes USE_PERL5= build OPENBLAS_SUFX= r${PORTVERSION} OPENBLAS_LIBS= libopenblas libopenblasp OPENBLAS_SVER= 0 OPENBLAS_FILES= ${OPENBLAS_LIBS:S|$|.so|} ${OPENBLAS_LIBS:S|$|.so.${OPENBLAS_SVER}|} ${OPENBLAS_LIBS:S|$|.a|} PLIST_FILES= ${OPENBLAS_FILES:S|^|lib/|} TEST_TARGET= tests BUILDFLAGS= FCOMMON_OPT=-frecursive MAKE_NB_JOBS=-1 OPTIONS_DEFINE= INTERFACE64 OPENMP OPTIONS_DEFINE_i386= DYNAMIC_ARCH AVX AVX2 OPTIONS_DEFINE_amd64= ${OPTIONS_DEFINE_i386} +OPTIONS_DEFINE_powerpc64= POWER6 .if defined(BATCH) || defined(PACKAGE_BUILDING) OPTIONS_DEFAULT_i386= DYNAMIC_ARCH OPTIONS_DEFAULT_amd64= DYNAMIC_ARCH .endif DYNAMIC_ARCH_DESC= Support multiple CPU types on i386 and amd64 INTERFACE64_DESC= Use 8 byte integers on 64-bit architectures OPENMP_DESC= Use OpenMP for threading AVX_DESC= Support Advanced Vector Extensions (AVX) AVX2_DESC= Support Advanced Vector Extensions 2 (AVX2) +POWER6_DESC= Optimize for POWER6, instead of the default PPC970 .include .if ${ARCH} == powerpc64 +. if ${PORT_OPTIONS:MPOWER6} TARGET_CPU_ARCH= POWER6 +.else +TARGET_CPU_ARCH= PPC970 +. endif .endif .if defined(TARGET_CPU_ARCH) BUILDFLAGS+= 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 .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 .endif .if ${PORT_OPTIONS:MINTERFACE64} BUILDFLAGS+= INTERFACE64=1 .endif .if ${PORT_OPTIONS:MOPENMP} USES+= compiler:openmp BUILDFLAGS_THREAD+= USE_OPENMP=1 .else USES+= compiler:c11 .endif .if ! ${PORT_OPTIONS:MAVX} BUILDFLAGS+= NO_AVX=1 .endif .if ! ${PORT_OPTIONS:MAVX2} BUILDFLAGS+= NO_AVX2=1 .endif post-extract: cd ${DISTDIR}/${DIST_SUBDIR} ; \ ${CP} ${LARGE_FILE} ${TIMING_FILE} ${WRKSRC} ${MKDIR} ${WRKDIR}/lib post-patch: ${REINPLACE_CMD} -e "s+%%FIND%%+${FIND}+" \ -e "s+%%XARGS%%+${XARGS}+" \ -e "s+%%REINPLACE_CMD%%+${REINPLACE_CMD}+" \ ${WRKSRC}/Makefile ${REINPLACE_CMD} -e "s+%%FC%%+${FC}+" -e "s+%%CC%%+${CC}+" \ ${WRKSRC}/Makefile.rule ${REINPLACE_CMD} -e "s+(ARCH)+(ARCH_)+" \ ${WRKSRC}/Makefile.rule \ ${WRKSRC}/Makefile.tail \ ${WRKSRC}/driver/level3/Makefile \ ${WRKSRC}/driver/others/Makefile \ ${WRKSRC}/exports/Makefile \ ${WRKSRC}/interface/Makefile \ ${WRKSRC}/kernel/Makefile \ ${WRKSRC}/kernel/Makefile.L3 \ ${WRKSRC}/lapack/laswp/Makefile \ ${WRKSRC}/lapack-netlib/SRC/Makefile \ ${WRKSRC}/lapack-netlib/SRC/VARIANTS/Makefile \ ${WRKSRC}/lapack-netlib/TESTING/MATGEN/Makefile \ ${WRKSRC}/lapack-netlib/LAPACKE/src/Makefile \ ${WRKSRC}/lapack-netlib/LAPACKE/utils/Makefile \ ${WRKSRC}/reference/Makefile ${REINPLACE_CMD} -e "s+(ARCH)+(ARCH_)+" \ -e 's+%%LDFLAGS%%+${LDFLAGS}+' \ -e 's+%%LOCALBASE%%+${LOCALBASE}+' \ -e 's+%%FIND%%+${FIND}+' \ -e 's+%%XARGS%%+${XARGS}+' \ -e 's+%%REINPLACE_CMD%%+${REINPLACE_CMD}+' \ -e 's+$${CROSS_SUFFIX}+${LOCALBASE}/bin/+' \ -e '/Clang.*OpenMP/g' \ ${WRKSRC}/Makefile.system ${REINPLACE_CMD} \ -e 's/defined(linux)/(defined(linux) || defined(__FreeBSD__))/g' \ -e 's/ifdef linux/if defined(linux) || defined(__FreeBSD__)/g' \ ${WRKSRC}/kernel/power/*.S post-patch-OPENMP-on: ${REINPLACE_CMD} -e "s+OPENBLAS_NUM_THREADS+OMP_NUM_THREADS+g" \ ${WRKSRC}/test/Makefile \ ${WRKSRC}/ctest/Makefile do-build: cd ${WRKSRC} ; ${SETENV} ${BUILDFLAGS} NUM_THREADS=1 USE_THREAD=0 \ ${MAKE_CMD} ${MAKE_ARGS} ${CP} ${WRKSRC}/libopenblas-${OPENBLAS_SUFX}.a ${WRKDIR}/lib/libopenblas.a ${CP} ${WRKSRC}/libopenblas-${OPENBLAS_SUFX}.so ${WRKDIR}/lib/libopenblas.so.${OPENBLAS_SVER} cd ${WRKSRC} ; ${MAKE_CMD} ${MAKE_ARGS} clean cd ${WRKSRC} ; ${SETENV} ${BUILDFLAGS} ${BUILDFLAGS_THREAD} \ ${MAKE_CMD} ${MAKE_ARGS} ${CP} ${WRKSRC}/libopenblasp-${OPENBLAS_SUFX}.a ${WRKDIR}/lib/libopenblasp.a ${CP} ${WRKSRC}/libopenblasp-${OPENBLAS_SUFX}.so ${WRKDIR}/lib/libopenblasp.so.${OPENBLAS_SVER} BENCHMARK_MAXTHREADS?= ${MAXTHREADS} .if ${PORT_OPTIONS:MOPENMP} BENCHMARK_THREADS_FLAG= OMP_NUM_THREADS=${BENCHMARK_MAXTHREADS} .else 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} do-install: .for L in ${OPENBLAS_LIBS} ${INSTALL_DATA} ${WRKDIR}/lib/${L}.a ${STAGEDIR}${PREFIX}/lib ${INSTALL_LIB} ${WRKDIR}/lib/${L}.so.${OPENBLAS_SVER} ${STAGEDIR}${PREFIX}/lib ${LN} -sf ${L}.so.${OPENBLAS_SVER} ${STAGEDIR}${PREFIX}/lib/${L}.so .endfor .include Index: head/math/openblas/files/patch-common__power.h =================================================================== --- head/math/openblas/files/patch-common__power.h (revision 507633) +++ head/math/openblas/files/patch-common__power.h (revision 507634) @@ -1,29 +1,38 @@ ---- common_power.h.orig 2019-06-26 10:25:04 UTC +--- common_power.h.orig 2017-07-24 04:03:35 UTC +++ common_power.h +@@ -241,7 +241,7 @@ static inline int blas_quickdivide(blasint x, blasint + #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) + #define DCBT_ARG 0 + #else + #define DCBT_ARG 8 @@ -499,7 +499,7 @@ static inline int blas_quickdivide(blasint x, blasint #if defined(ASSEMBLER) && !defined(NEEDPARAM) -#ifdef OS_LINUX +#if defined(OS_LINUX) || defined(OS_FREEBSD) #ifndef __64BIT__ #define PROLOGUE \ .section .text;\ @@ -774,7 +774,7 @@ Lmcount$lazy_ptr: #define HALT mfspr r0, 1023 -#ifdef OS_LINUX +#if defined(OS_LINUX) || defined(OS_FREEBSD) #if defined(PPC440) || defined(PPC440FP2) #undef MAX_CPU_NUMBER #define MAX_CPU_NUMBER 1 @@ -819,7 +819,7 @@ Lmcount$lazy_ptr: #define MAP_ANONYMOUS MAP_ANON #endif -#ifdef OS_LINUX +#if defined(OS_LINUX) || defined(OS_FREEBSD) #ifndef __64BIT__ #define FRAMESLOT(X) (((X) * 4) + 8) #else Index: head/math/openblas/files/patch-param.h =================================================================== --- head/math/openblas/files/patch-param.h (nonexistent) +++ head/math/openblas/files/patch-param.h (revision 507634) @@ -0,0 +1,11 @@ +--- param.h.orig 2019-06-28 14:19:50 UTC ++++ param.h +@@ -1877,7 +1877,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILI + #define ZGEMM_DEFAULT_UNROLL_M 2 + #define ZGEMM_DEFAULT_UNROLL_N 2 + +-#ifdef OS_LINUX ++#if defined(OS_LINUX) || defined(OS_FREEBSD) + #if L2_SIZE == 1024976 + #define SGEMM_DEFAULT_P 320 + #define DGEMM_DEFAULT_P 256 Property changes on: head/math/openblas/files/patch-param.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property