summaryrefslogtreecommitdiff
path: root/math/superlu/Makefile
blob: 442899d5eed031b6c5b57691c91cc58968dd2cb0 (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
# Created by: Pedro Giffuni <giffunip@asme.org>
# $FreeBSD$

PORTNAME=	superlu
PORTVERSION=	5.2.1
PORTREVISION=	8
CATEGORIES=	math
MASTER_SITES=	http://crd-legacy.lbl.gov/~xiaoye/SuperLU/ \
		http://crd-legacy.lbl.gov/~xiaoye/:doc
DISTNAME=	${PORTNAME}_${PORTVERSION}
DIST_SUBDIR=	${PORTNAME}

MAINTAINER=	robert.ayrapetyan@gmail.com
COMMENT=	Library of routines for performing sparse factorization

LICENSE=	BSD3CLAUSE
LICENSE_FILE=	${WRKSRC}/License.txt

USES=		cmake fortran
USE_LDCONFIG=	yes

WRKSRC=		${WRKDIR}/SuperLU_${PORTVERSION}
PLIST_SUB=	P_VERSION="${PORTVERSION}" P_VER="${PORTVERSION:R:R}"

CMAKE_ON=	USE_XSDK_DEFAULTS
CMAKE_OFF=	enable_tests enable_examples

PORTDOCS=	*

OPTIONS_DEFINE=		DOCS
OPTIONS_SINGLE=		BLAS
OPTIONS_SINGLE_BLAS=	ATLAS GOTOBLAS OPENBLAS REFERENCE
OPTIONS_DEFAULT=	REFERENCE

ATLAS_USES=		blaslapack:atlas
ATLAS_CMAKE_ARGS=	-DBLA_VENDOR:STRING="ATLAS"
DOCS_DISTFILES=		${DISTNAME}${EXTRACT_SUFX} \
			${SLU_DOCS:S/$/:doc/}
DOCS_EXTRACT_ONLY=	${DISTNAME}${EXTRACT_SUFX}
GOTOBLAS_DESC=		GotoBLAS blas implementation
GOTOBLAS_USES=		blaslapack:gotoblas
GOTOBLAS_CMAKE_ARGS=	-DBLA_VENDOR:STRING="Goto"
OPENBLAS_DESC=		OpenBLAS blas implementation
OPENBLAS_USES=		blaslapack:openblas
OPENBLAS_CMAKE_ARGS=	-DBLA_VENDOR:STRING="OpenBLAS"
REFERENCE_DESC=		Reference blas implementation
REFERENCE_USES=		blaslapack
REFERENCE_CMAKE_ARGS=	-DBLA_VENDOR:STRING="Generic"

SLU_DOCS=	SLU_general.ps.gz simax-29176.pdf

post-patch:
	@${REINPLACE_CMD} -e \
		'/CMAKE_C_FLAGS_RELEASE/s|^|#|' ${WRKSRC}/CMakeLists.txt
	@${REINPLACE_CMD} -e \
		'/FFLAGS/s|FATAL_ERROR|WARNING|' ${WRKSRC}/cmake/XSDKDefaults.cmake

post-install-DOCS-on:
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
	(cd ${DISTDIR}/${DIST_SUBDIR} && ${INSTALL_DATA} ${SLU_DOCS} \
		${STAGEDIR}${DOCSDIR})
	(cd ${WRKSRC}/DOC && ${COPYTREE_SHARE} "html ug.pdf" \
		${STAGEDIR}${DOCSDIR})

do-test:
	@cd ${BUILD_WRKSRC} && \
		${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} -Denable_tests:BOOL=ON ${CMAKE_SOURCE_PATH} && \
		${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${ALL_TARGET} && \
		${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} test

.include <bsd.port.mk>