aboutsummaryrefslogtreecommitdiffstats
path: root/math/blocksolve95/Makefile
blob: 20f18b6ffb5b0af5952a176e4ce01a1828a7571e (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
# New ports collection makefile for:  blocksolve95
# Date created:               03 October 2004
# Whom:                       Thierry Thomas <thierry@pompo.net>
#
# $FreeBSD$
#

PORTNAME=   blocksolve95
PORTVERSION=    3.0
CATEGORIES= math parallel
MASTER_SITES=   ftp://info.mcs.anl.gov/pub/BlockSolve95/    \
        ftp://ftp.irisa.fr/pub/mirrors/BlockSolve95/
DISTNAME=   BlockSolve95
EXTRACT_SUFX=   .tar.Z
DIST_SUBDIR=    ${PORTNAME}-${PORTVERSION}

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

BUILD_DEPENDS=  ${MPIDIR}/lib/libmpich.a:${PORTSDIR}/net/mpich
RUN_DEPENDS=    ${MPIDIR}/bin/mpirun:${PORTSDIR}/net/mpich

USE_XLIB=   yes
USE_GMAKE=  yes
MAKEFILE=   makefile
MAKE_ARGS=  GMAKE=${GMAKE} PETSC_ARCH=${PETSC_ARCH} BOPT=${BOPT}    \
        BLAS_LIB=${BLAS_LIB} LAPACK_LIB=${LAPACK_LIB}

MPIDIR=     ${LOCALBASE}/mpich
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_r.so) && !defined(WITH_BLAS)
WITH_ATLAS= yes
.endif
.if defined(WITH_ATLAS)
LIB_DEPENDS+=   f77blas.1:${PORTSDIR}/math/atlas
BLAS_LIB=   "-lf77blas -lcblas -latlas -lg2c -lm"
LAPACK_LIB= "-L${LOCALBASE}/lib -lalapack"
.else
LIB_DEPENDS+=   lapack.3:${PORTSDIR}/math/lapack
BLAS_LIB=   "-lblas -lm"
LAPACK_LIB= "-L${LOCALBASE}/lib -llapack"
.endif

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

.if defined(MAINTAINER_MODE)
regression-test:    build
    @(cd ${BUILD_WRKSRC}/examples;  \
    ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} bsrunexamples clean)
.endif

.include "${FILESDIR}/BSman3.inc"
.include <bsd.port.post.mk>