freebsd-ports/math/openblas/Makefile
Stefan Eßer b7f05445c0 Add WWW entries to port Makefiles
It has been common practice to have one or more URLs at the end of the
ports' pkg-descr files, one per line and prefixed with "WWW:". These
URLs should point at a project website or other relevant resources.

Access to these URLs required processing of the pkg-descr files, and
they have often become stale over time. If more than one such URL was
present in a pkg-descr file, only the first one was tarnsfered into
the port INDEX, but for many ports only the last line did contain the
port specific URL to further information.

There have been several proposals to make a project URL available as
a macro in the ports' Makefiles, over time.

This commit implements such a proposal and moves one of the WWW: entries
of each pkg-descr file into the respective port's Makefile. A heuristic
attempts to identify the most relevant URL in case there is more than
one WWW: entry in some pkg-descr file. URLs that are not moved into the
Makefile are prefixed with "See also:" instead of "WWW:" in the pkg-descr
files in order to preserve them.

There are 1256 ports that had no WWW: entries in pkg-descr files. These
ports will not be touched in this commit.

The portlint port has been adjusted to expect a WWW entry in each port
Makefile, and to flag any remaining "WWW:" lines in pkg-descr files as
deprecated.

Approved by:		portmgr (tcberner)
2022-09-07 23:10:59 +02:00

142 lines
3.7 KiB
Makefile

PORTNAME= openblas
DISTVERSIONPREFIX= v
DISTVERSION= 0.3.20
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
WWW= https://github.com/xianyi/OpenBLAS
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= compiler:c11 cpe fortran gmake perl5 pkgconfig
USE_GITHUB= yes
GH_ACCOUNT= xianyi
GH_PROJECT= OpenBLAS
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
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>