summaryrefslogtreecommitdiff
path: root/math/lapack/Makefile.common
blob: 692030138650b3b6b4af15fe409bea84e769a425 (plain)
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
# $NetBSD: Makefile.common,v 1.14 2021/06/15 04:41:52 thor Exp $
# used by math/blas/Makefile
# used by math/cblas/Makefile
# used by math/lapacke/Makefile
# used by math/lapack/Makefile
# used by math/blas64/Makefile
# used by math/cblas64/Makefile
# used by math/lapacke64/Makefile
# used by math/lapack64/Makefile

# Common Makefile for packages derived from the Netlib BLAS/LAPACK sources.
# Package Makefile sets LAPACK_COMPONENT and LAPACK_COMPONENT_CMAKE_ARGS to
# choose the library to install.
# LAPACK_COMPONENT can be "lapack", "lapacke", or "cblas",
# or any of those with 64 suffix for ILP64 mode (64 bit indexing).

DISTNAME=	lapack-${NETLIB_BLAS_VERSION}
PKGNAME=	${LAPACK_COMPONENT}-${NETLIB_BLAS_VERSION}
CATEGORIES=	math
MASTER_SITES=	${MASTER_SITE_GITHUB:=Reference-LAPACK/}
GITHUB_PROJECT=	lapack
GITHUB_TAG=	v${NETLIB_BLAS_VERSION}

HOMEPAGE=	https://www.netlib.org/lapack/
LICENSE=	modified-bsd

# All parts are in the same section
PATCHDIR=	${.CURDIR}/../../math/lapack/patches
DISTINFO_FILE=	${.CURDIR}/../../math/lapack/distinfo

USE_LANGUAGES=	c fortran
USE_CMAKE=	yes

WRKSRC=		${WRKDIR}/${DISTNAME}
CONFIGURE_DIRS=	build
CMAKE_ARG_PATH=	${WRKSRC}

.if !empty(LAPACK_COMPONENT:M*64)
.  if empty(MACHINE_ARCH:M*64)
PKG_FAIL_REASON+=	"${LAPACK_COMPONENT} incompatible with non-64-bit platform"
.  endif
HEADERDIR=		netlib64
.else
HEADERDIR=		netlib
.endif

# Note: We patch the build to install both static and
# shared libraries.
CMAKE_ARGS=	-DBUILD_DEPRECATED=ON \
		-DBUILD_SHARED_LIBS=ON \
		-DBUILD_STATIC_LIBS=ON \
		-DCMAKE_INSTALL_INCLUDEDIR=${PREFIX}/include/${HEADERDIR} \
		${LAPACK_COMPONENT_CMAKE_ARGS}

# The cmake files are not ready for prime time.
post-install:
	rm -rf "${DESTDIR}${PREFIX}/lib/cmake"
.if ${HEADERDIR} == netlib
# Install all headers into subdirectories netlib or netlib64, link
# the default ones to include, so that simple #include <cblas.h> works
# as before, as well as with matching -Iincludedir.
# This also gives us the option of selecting a different symlinked
# default on the next reworking of BLAS stuff.
	if ${TEST} -e "${DESTDIR}${PREFIX}/include/${HEADERDIR}"; then \
	  cd "${DESTDIR}${PREFIX}/include"; for f in ${HEADERDIR}/*.h; do ln -s $$f .; done \
	fi
.endif

.include "../../math/lapack/version.mk"

post-extract:
	${RUN} ${MKDIR} ${WRKSRC}/build