diff options
author | Thierry Thomas <thierry@FreeBSD.org> | 2024-06-08 15:46:43 +0200 |
---|---|---|
committer | Thierry Thomas <thierry@FreeBSD.org> | 2024-06-08 20:41:54 +0200 |
commit | aebc677df1e11d529cd203488f568a088f5187d3 (patch) | |
tree | 0145f5d87005ed430d8584b9325f6b55667b4009 | |
parent | x11/kanshi: update to 1.7.0 (diff) |
math/openblas64: repocopy from math/openblas
-rw-r--r-- | math/openblas64/Makefile | 143 | ||||
-rw-r--r-- | math/openblas64/distinfo | 7 | ||||
-rw-r--r-- | math/openblas64/files/patch-common__arm.h | 20 | ||||
-rw-r--r-- | math/openblas64/files/patch-cpuid__arm.c | 16 | ||||
-rw-r--r-- | math/openblas64/files/patch-exports_Makefile | 11 | ||||
-rw-r--r-- | math/openblas64/files/patch-interface__ztrmv.c | 11 | ||||
-rw-r--r-- | math/openblas64/pkg-descr | 7 | ||||
-rw-r--r-- | math/openblas64/pkg-plist | 17 |
8 files changed, 232 insertions, 0 deletions
diff --git a/math/openblas64/Makefile b/math/openblas64/Makefile new file mode 100644 index 000000000000..cf23f359fa20 --- /dev/null +++ b/math/openblas64/Makefile @@ -0,0 +1,143 @@ +PORTNAME= openblas +DISTVERSIONPREFIX= v +DISTVERSION= 0.3.25 +PORTEPOCH= 2 +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 +WWW= https://github.com/OpenMathLib/OpenBLAS + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES= compiler:c11 cpe fortran gmake perl5 pkgconfig + +USE_GITHUB= yes +GH_ACCOUNT= OpenMathLib +GH_PROJECT= OpenBLAS +GH_TAGNAME= 5e1a429 +LARGE_FILE= large.tgz +TIMING_FILE= timing.tgz +CPE_VENDOR= openblas_project + +USE_LDCONFIG= yes +USE_PERL5= build + +OPENBLAS_SVER= 0 +TEST_TARGET= tests + +PLIST_SUB+= PORTVERSION=${PORTVERSION} + +OPTIONS_DEFINE= DYNAMIC_ARCH INTERFACE64 OPENMP +OPTIONS_DEFAULT= OPENMP +OPTIONS_DEFINE_i386= AVX AVX2 +OPTIONS_DEFINE_amd64= AVX AVX2 +OPTIONS_EXCLUDE_armv6= OPENMP +OPTIONS_EXCLUDE_armv7= OPENMP +OPTIONS_EXCLUDE_powerpc64le= OPENMP +OPTIONS_EXCLUDE_powerpc64= OPENMP +OPTIONS_EXCLUDE_powerpc= OPENMP +OPTIONS_RADIO= ${OPTIONS_RADIO_${ARCH}} +OPTIONS_RADIO_powerpc64= POWER +OPTIONS_RADIO_POWER= POWER6 POWER8 +OPTIONS_SUB= yes + +.if defined(BATCH) || defined(PACKAGE_BUILDING) +OPTIONS_DEFAULT_i386= DYNAMIC_ARCH +OPTIONS_DEFAULT_amd64= DYNAMIC_ARCH +OPTIONS_DEFAULT_powerpc64le= DYNAMIC_ARCH +.endif + +DYNAMIC_ARCH_DESC= Optimize for multiple CPU types, otherwise for this CPU +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 +POWER8_DESC= Optimize for POWER8, instead of the default PPC970 + +.include <bsd.port.options.mk> + +.if ${ARCH} == powerpc64 +USE_GCC= yes +. if ${PORT_OPTIONS:MPOWER6} +TARGET_CPU_ARCH= POWER6 +. elif ${PORT_OPTIONS:MPOWER8} +TARGET_CPU_ARCH= POWER8 +.else +TARGET_CPU_ARCH= PPC970 +. endif +.endif + +.if ${ARCH} == powerpc +USE_GCC= yes +TARGET_CPU_ARCH= PPCG4 +.endif + +.if ${ARCH} == powerpc64le +CFLAGS+= -lm +USE_GCC= yes +.endif + +MAXTHREADS?= 64 + +.include <bsd.port.pre.mk> + +post-extract: + cd ${DISTDIR}/${DIST_SUBDIR} ; \ + ${CP} ${LARGE_FILE} ${TIMING_FILE} ${WRKSRC} + +post-patch: + @${ECHO_CMD} MAKE_NB_JOBS=-1 >> ${WRKSRC}/Makefile.rule + @${ECHO_CMD} NUM_THREADS=${MAXTHREADS} >> ${WRKSRC}/Makefile.rule + @${ECHO_CMD} USE_THREAD=1 >> ${WRKSRC}/Makefile.rule +.if ! ${PORT_OPTIONS:MAVX} + @${ECHO_CMD} NO_AVX=1 >> ${WRKSRC}/Makefile.rule +.endif +.if ! ${PORT_OPTIONS:MAVX2} + @${ECHO_CMD} NO_AVX2=1 >> ${WRKSRC}/Makefile.rule +.endif +.if ${PORT_OPTIONS:MDYNAMIC_ARCH} + @${ECHO_CMD} DYNAMIC_ARCH=1 >> ${WRKSRC}/Makefile.rule + @${ECHO_CMD} DYNAMIC_OLDER=1 >> ${WRKSRC}/Makefile.rule +.endif +.if defined(TARGET_CPU_ARCH) + @${ECHO_CMD} TARGET=${TARGET_CPU_ARCH} >> ${WRKSRC}/Makefile.rule +.endif +.if ${PORT_OPTIONS:MINTERFACE64} + @${ECHO_CMD} INTERFACE64=1 >> ${WRKSRC}/Makefile.rule +.endif +.if ${PORT_OPTIONS:MOPENMP} + @${ECHO_CMD} USE_OPENMP=1 >> ${WRKSRC}/Makefile.rule +.endif +.if ${ARCH:M*64*} == "" + @${ECHO_CMD} BINARY=32 >> ${WRKSRC}/Makefile.rule +.else + @${ECHO_CMD} BINARY=64 >> ${WRKSRC}/Makefile.rule +.endif + +post-patch-OPENMP-on: + @${REINPLACE_CMD} -e "s+OPENBLAS_NUM_THREADS+OMP_NUM_THREADS+g" \ + ${WRKSRC}/test/Makefile \ + ${WRKSRC}/ctest/Makefile + +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} ${MAKE_CMD} ${MAKE_ARGS} hpl + cd ${WRKSRC}/benchmark ; ${SETENV} ${BENCHMARK_THREADS_FLAG} ${MAKE_CMD} ${MAKE_ARGS} + +post-install-DYNAMIC_ARCH-off: + cd ${STAGEDIR}${PREFIX} && ls lib/libopenblas_*p-r${PORTVERSION}.* >> ${TMPPLIST} + +.include <bsd.port.post.mk> diff --git a/math/openblas64/distinfo b/math/openblas64/distinfo new file mode 100644 index 000000000000..883c98157110 --- /dev/null +++ b/math/openblas64/distinfo @@ -0,0 +1,7 @@ +TIMESTAMP = 1699873046 +SHA256 (openblas/large.tgz) = f328d88b7fa97722f271d7d0cfea1c220e0f8e5ed5ff01d8ef1eb51d6f4243a1 +SIZE (openblas/large.tgz) = 2595 +SHA256 (openblas/timing.tgz) = 999c65f8ea8bd4eac7f1c7f3463d4946917afd20a997807300fe35d70122f3af +SIZE (openblas/timing.tgz) = 1059485 +SHA256 (openblas/OpenMathLib-OpenBLAS-v0.3.25-5e1a429_GH0.tar.gz) = 848beec6974e550aef74784b599a1c88549f70432b575e1dc1822eef15b4bc5d +SIZE (openblas/OpenMathLib-OpenBLAS-v0.3.25-5e1a429_GH0.tar.gz) = 24073895 diff --git a/math/openblas64/files/patch-common__arm.h b/math/openblas64/files/patch-common__arm.h new file mode 100644 index 000000000000..1ffd13a2c63b --- /dev/null +++ b/math/openblas64/files/patch-common__arm.h @@ -0,0 +1,20 @@ +--- common_arm.h.orig 2023-04-01 20:18:01 UTC ++++ common_arm.h +@@ -95,6 +95,17 @@ static inline int blas_quickdivide(blasint x, blasint + + #endif + ++/* Translate pre-UAL asm to UAL equivalents */ ++#if defined(__clang__) ++#define fnmacs vmls.f32 ++#define fnmacd vmls.f64 ++#define fnmuls vnmul.f32 ++#define fnmuld vnmul.f64 ++#define fldmias vldmia ++#define fstmias vstmia ++#define fldmiad vldmia ++#define fstmiad vstmia ++#endif + + #ifndef F_INTERFACE + #define REALNAME ASMNAME diff --git a/math/openblas64/files/patch-cpuid__arm.c b/math/openblas64/files/patch-cpuid__arm.c new file mode 100644 index 000000000000..0aa24dc52a12 --- /dev/null +++ b/math/openblas64/files/patch-cpuid__arm.c @@ -0,0 +1,16 @@ +--- cpuid_arm.c.orig 2016-09-01 03:58:42 UTC ++++ cpuid_arm.c +@@ -181,7 +181,12 @@ int detect(void) + } + + } +- ++#else ++#if (__ARM_ARCH == 7) ++ return CPU_ARMV7; ++#else ++ return CPU_ARMV6; ++#endif + #endif + + return CPU_UNKNOWN; diff --git a/math/openblas64/files/patch-exports_Makefile b/math/openblas64/files/patch-exports_Makefile new file mode 100644 index 000000000000..7e7692de9ce0 --- /dev/null +++ b/math/openblas64/files/patch-exports_Makefile @@ -0,0 +1,11 @@ +--- exports/Makefile.orig 2023-04-01 20:18:01 UTC ++++ exports/Makefile +@@ -222,7 +222,7 @@ else + endif + $(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \ + -Wl,--whole-archive $< -Wl,--no-whole-archive \ +- $(FEXTRALIB) $(EXTRALIB) ++ -Wl,-soname,$(LIBSONAME) $(FEXTRALIB) $(EXTRALIB) + $(CC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK. + rm -f linktest + diff --git a/math/openblas64/files/patch-interface__ztrmv.c b/math/openblas64/files/patch-interface__ztrmv.c new file mode 100644 index 000000000000..854a83bf42ea --- /dev/null +++ b/math/openblas64/files/patch-interface__ztrmv.c @@ -0,0 +1,11 @@ +--- interface/ztrmv.c.orig 2019-04-29 17:22:19 UTC ++++ interface/ztrmv.c +@@ -245,7 +245,7 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_UPLO Upl + else + #endif + { +- buffer_size = ((n - 1) / DTB_ENTRIES) * 2 * DTB_ENTRIES + 32 / sizeof(FLOAT); ++ buffer_size = (((n - 1) / DTB_ENTRIES) * 2 * DTB_ENTRIES + 32 / sizeof(FLOAT)) + 8; + // It seems to be required for some K8 or Barcelona CPU + buffer_size += 8; + if(incx != 1) diff --git a/math/openblas64/pkg-descr b/math/openblas64/pkg-descr new file mode 100644 index 000000000000..55a88a92404a --- /dev/null +++ b/math/openblas64/pkg-descr @@ -0,0 +1,7 @@ +OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. +OpenBLAS is an open source project supported by +Lab of Parallel Software and Computational Science, ISCAS. + +NOTE: If you want to specify your CPU microarchitecture manually, +please use TARGET_CPU_ARCH knob, e.g., "make TARGET_CPU_ARCH=NEHALEM". +This value is set TARGET build flag. diff --git a/math/openblas64/pkg-plist b/math/openblas64/pkg-plist new file mode 100644 index 000000000000..66ad1a092738 --- /dev/null +++ b/math/openblas64/pkg-plist @@ -0,0 +1,17 @@ +include/cblas.h +include/f77blas.h +include/lapack.h +include/lapacke.h +include/lapacke_config.h +include/lapacke_mangling.h +include/lapacke_utils.h +include/openblas_config.h +lib/cmake/openblas/OpenBLASConfig.cmake +lib/cmake/openblas/OpenBLASConfigVersion.cmake +lib/libopenblas.a +lib/libopenblas.so +lib/libopenblas.so.0 +%%DYNAMIC_ARCH%%lib/libopenblasp-r%%PORTVERSION%%.a +%%DYNAMIC_ARCH%%lib/libopenblasp-r%%PORTVERSION%%.so +%%NO_INTERFACE64%%libdata/pkgconfig/openblas.pc +%%INTERFACE64%%libdata/pkgconfig/openblas64.pc |