blob: 1e602695b0a04bc9019869311c8084a4190cf337 (
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
|
# Handle dependencies on Blas / Lapack
#
# Feature: blaslapack
# Usage: USES=blaslapack or USES=blaslapack:ARGS
# Valid ARGS: atlas blis flexiblas netlib (default) openblas openblas64
#
# Provides: BLASLIB and LAPACKLIB
#
# Maintainer: thierry@FreeBSD.org
#
# /!\ Avoid mixing libraries using different BLAS-LAPACK implementations!
.if !defined(_INCLUDE_USES_BLASLAPACK_MK)
_INCLUDE_USES_BLASLAPACK_MK= yes
_valid_ARGS= atlas blis flexiblas netlib openblas openblas64
. if empty(blaslapack_ARGS)
blaslapack_ARGS= ${BLASLAPACK_DEFAULT}
. endif
LDFLAGS+= -L${LOCALBASE}/lib
. if ${blaslapack_ARGS} == atlas
LIB_DEPENDS+= libatlas.so:math/atlas
_BLASLIB= ptf77blas
LAPACKLIB= -lalapack -lptcblas
_ATLASLIB= atlas
ATLASLIB= -l${_ATLASLIB}
BLA_VENDOR= ATLAS
. elif ${blaslapack_ARGS} == blis
LIB_DEPENDS+= libblis.so:math/blis
LIB_DEPENDS+= libflame.so:math/libflame
_BLASLIB= blis
LAPACKLIB= -lflame
BLA_VENDOR= FLAME
. elif ${blaslapack_ARGS} == flexiblas
LIB_DEPENDS+= libflexiblas.so:math/flexiblas
_BLASLIB= flexiblas
BLA_VENDOR= FlexiBLAS
. elif ${blaslapack_ARGS} == netlib || empty(blaslapack_ARGS)
LIB_DEPENDS+= libblas.so:math/blas
LIB_DEPENDS+= liblapack.so:math/lapack
_BLASLIB= blas
LAPACKLIB= -llapack
BLA_VENDOR= Generic
. elif ${blaslapack_ARGS} == openblas
LIB_DEPENDS+= libopenblas.so:math/openblas
_BLASLIB= openblas
LAPACKLIB= -lopenblas
BLA_VENDOR= OpenBLAS
. elif ${blaslapack_ARGS} == openblas64
LIB_DEPENDS+= libopenblas_64.so:math/openblas64
_BLASLIB= openblas_64
LAPACKLIB= -lopenblas_64
BLA_VENDOR= OpenBLAS
CFLAGS+= -I${LOCALBASE}/include/openblas64
. else
IGNORE= USES=blaslapack: invalid arguments: ${blaslapack_ARGS}
. endif
BLASLIB= -l${_BLASLIB}
. if ${USES:Mcmake} || ${USES:Mcmake\:*}
CONFIGURE_ENV+= BLA_VENDOR="${BLA_VENDOR}"
. endif
.endif
|