summaryrefslogtreecommitdiff
path: root/math/blis/Makefile
blob: 94c753bcbb02be9b94853d4a0907f5300752c2e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
PORTNAME=	blis
PORTVERSION=	2.0
CATEGORIES=	math

MAINTAINER=	thierry@FreeBSD.org
COMMENT=	Software framework for high-performance BLAS-like libraries
WWW=		https://github.com/flame/blis

LICENSE=	BSD3CLAUSE
LICENSE_FILE=	${WRKSRC}/LICENSE

BUILD_DEPENDS=	bash:shells/bash

USES=		compiler fortran gmake perl5 python shebangfix

USE_GITHUB=	yes
GH_ACCOUNT=	flame

USE_PERL5=	build
SHEBANG_FILES=	build/flatten-headers.py
BIN_ALIAS=	gfortran=${FC}
USE_LDCONFIG=	yes

OPTIONS_DEFINE=	PARA CBLAS
PARA_DESC=	use pthread parallelization
CBLAS_DESC=	build the CBLAS compatibility layer
OPTIONS_DEFAULT=	PARA
OPTIONS_SUB=		yes

CFLAGS_riscv64=	-mno-relax
HAS_CONFIGURE=	yes

TEST_TARGET=	test

.include <bsd.port.options.mk>

# enable BLAS and static/shared libs by default
CONFIGURE_ARGS+=	--enable-blas \
			--prefix=${PREFIX} \
			--enable-shared \
			--enable-static

.if ${PORT_OPTIONS:MPARA}
CONFIGURE_ARGS+=	-t pthreads
.endif

.if ${PORT_OPTIONS:MCBLAS}
CONFIGURE_ARGS+=	--enable-cblas
CONFLICTS_INSTALL=	openblas-*
.endif

.if ${ARCH} == amd64
CONFIGURE_ARGS+=	x86_64
PLIST_SUB+=	ARCH="x86_64"
.elif ${ARCH:Mpowerpc64*}
CONFIGURE_ARGS+=	power9
PLIST_SUB+=	ARCH="power9"
USE_GCC=	yes
.else
CONFIGURE_ARGS+=	generic
PLIST_SUB+=	ARCH="generic"
.endif

.include <bsd.port.pre.mk>

.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 190
EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-config_knl_make__defs.mk
.endif

.if ${CHOSEN_COMPILER_TYPE} == gcc
USE_GCC=	yes
.endif

post-install:
	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libblis.so.4.0.0

.include <bsd.port.post.mk>