aboutsummaryrefslogtreecommitdiff
path: root/math/blocksolve95/Makefile
blob: cf37d14bb52c3dcfbdce6aa1d57fec1ef9c955ed (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
78
79
80
81
82
# Created by: Thierry Thomas <thierry@pompo.net>
# $FreeBSD$

PORTNAME=	blocksolve95
PORTVERSION=	3.0
PORTREVISION=	15
CATEGORIES=	math parallel
MASTER_SITES=	ftp://ftp.mcs.anl.gov/pub/BlockSolve95/ \
		http://ftp.mcs.anl.gov/pub/BlockSolve95/
DISTNAME=	BlockSolve95
DIST_SUBDIR=	${PORTNAME}-${PORTVERSION}

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Software for the efficient solution of large, sparse linear systems

LICENSE=	AS-IS
LICENSE_NAME=	AS-IS
LICENSE_FILE=	${WRKSRC}/COPYRIGHT
LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept

LIB_DEPENDS=	libf2c.so:${PORTSDIR}/lang/f2c	\
		libmpich.so:${PORTSDIR}/net/mpich2

USES=		fortran gmake tar:Z
MAKEFILE=	makefile
MAKE_ARGS=	GMAKE=${MAKE_CMD} PETSC_ARCH=${PETSC_ARCH} BOPT=${BOPT}	\
		BLAS_LIB="${BLAS_LIB}" LAPACK_LIB="${LAPACK_LIB}"

MPIDIR=		${LOCALBASE}
PETSC_ARCH=	freebsd
BOPT?=		O

FFLAGS+=	-O2

INCLUDES=	BMmsg.h BSdepend.h BSlog.h BSmy_blas.h BSprivate.h BSsparse.h
PORTDOCS=	manual.ps

.include <bsd.port.pre.mk>

.if exists(${LOCALBASE}/lib/libatlas.so) && !defined(WITH_BLAS)
WITH_ATLAS=	yes
.endif
.if defined(WITH_ATLAS)
LIB_DEPENDS+=	libatlas.so:${PORTSDIR}/math/atlas
BLAS_LIB=	-lf77blas
LAPACK_LIB=	-L${LOCALBASE}/lib -lalapack -lcblas
.else
LIB_DEPENDS+=	liblapack.so:${PORTSDIR}/math/lapack
LIB_DEPENDS+=	libblas.so:${PORTSDIR}/math/blas
BLAS_LIB=	-lblas
LAPACK_LIB=	-L${LOCALBASE}/lib -llapack
.endif

do-install:
	${INSTALL_DATA}	${WRKSRC}/lib/lib${BOPT}/${PETSC_ARCH}/libBS95.a	\
		${STAGEDIR}${PREFIX}/lib
	${INSTALL_DATA}	${INCLUDES:S|^|${WRKSRC}/include/|} ${STAGEDIR}${PREFIX}/include
	${INSTALL_MAN} ${WRKSRC}/doc/man/man3/* ${STAGEDIR}${MANPREFIX}/man/man3
.if ${PORT_OPTIONS:MDOCS}
	${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_DATA}	${PORTDOCS:S|^|${WRKSRC}/doc/manual/|} ${STAGEDIR}${DOCSDIR}
.endif
.if ${PORT_OPTIONS:MEXAMPLES}
	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
	${INSTALL_DATA}	${WRKSRC}/examples/* ${STAGEDIR}${EXAMPLESDIR}
	@${RM} ${STAGEDIR}${EXAMPLESDIR}/makefile.orig
.endif

.if defined(MAINTAINER_MODE)
regression-test:	build
. if !exists(${HOME}/.mpd.conf)
	@${ECHO_CMD} "MPD_SECRETWORD=change_on_install" > ${HOME}/.mpd.conf
	${CHMOD} go-r ${HOME}/.mpd.conf
	@${ECHO_MSG} "${HOME}/.mpd.conf has been generated - please change the secret word!"
. endif
	${LOCALBASE}/bin/mpd &
	(cd ${BUILD_WRKSRC}/examples &&	\
	${SETENV} ${MAKE_ENV:C|HOME=|wHOME=|} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} bsrunexamples clean)
	${LOCALBASE}/bin/mpdallexit
.endif

.include <bsd.port.post.mk>