aboutsummaryrefslogtreecommitdiffstats
path: root/math/sdpara/Makefile
blob: a025955524ded9360b71b5f85cb9b6cac7622851 (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
# Created by: NAKATA, Maho <maho@FreeBSD.org>
# $FreeBSD$

PORTNAME=   sdpara
PORTVERSION=    7.3.1
CATEGORIES= math parallel
MASTER_SITES=   SF/sdpa/sdpara
DISTNAME=   ${PORTNAME}.${PORTVERSION}.src.20100914
DIST_SUBDIR=    sdpa

MAINTAINER= ports@FreeBSD.org
COMMENT=    SDPARA parallel version of SDPA (math/sdpa)

LICENSE=    GPLv2 # (or later)

LIB_DEPENDS=    libblacs.so:math/blacs \
        libscalapack.so:math/scalapack \
        libmpich.so:net/mpich2

WRKSRC=     ${WRKDIR}/${PORTNAME}.${PORTVERSION}

USES=       fortran gmake

PORTEXAMPLES=   *
PLIST_FILES=    bin/sdpara %%DATADIR%%/param.sdpa

OPTIONS_DEFINE=     EXAMPLES
OPTIONS_SINGLE=     BLAS
OPTIONS_SINGLE_BLAS=    ATLAS GOTOBLAS REFERENCE
OPTIONS_DEFAULT=    REFERENCE

ATLAS_USES=     blaslapack:atlas
GOTOBLAS_DESC=      GotoBLAS blas implementation
GOTOBLAS_USES=      blaslapack:gotoblas
REFERENCE_DESC=     Reference blas implementation
REFERENCE_USES=     blaslapack

LAPACK_LIBS=    -L${LOCALBASE}/lib ${LAPACKLIB}
BLAS_LIBS=  -L${LOCALBASE}/lib ${BLASLIB}
SCALAPACK_LIBS= -L${LOCALBASE}/lib -lscalapack -lblacs -lblacsc
FORTRAN_LIBS=   ${LDFLAGS} -lgfortran

post-patch:
    @${REINPLACE_CMD} -e \
        '/^CC /s|=.*|= ${LOCALBASE}/bin/mpicc| ; \
         /^CXX /s|=.*|= ${LOCALBASE}/bin/mpicxx| ; \
         /^FC /s|=.*|= ${LOCALBASE}/bin/mpif77| ; \
         /^CFLAGS /s|=.*|= ${CFLAGS}| ; \
         /^CXXFLAGS /s|=.*|= ${CXXFLAGS}| ; \
         /^FFLAGS /s|=.*|= ${FFLAGS}| ; \
         /^LAPACK_LIBS /s|=.*|= ${LAPACK_LIBS}| ; \
         /^BLAS_LIBS /s|=.*|= ${BLAS_LIBS}| ; \
         /^SCALAPACK_LIBS /s|=.*|= ${SCALAPACK_LIBS}| ; \
         /^FORTRAN_LIBS /s|=.*|= ${FORTRAN_LIBS}|' \
        ${WRKSRC}/Makefile
    @${REINPLACE_CMD} -e \
        '/^CC /s|=.*|= ${LOCALBASE}/bin/mpicc| ; \
         /^CFLAGS /s|=.*|= ${CFLAGS}| ; \
         /^CXX /s|=.*|= ${LOCALBASE}/bin/mpicxx| ; \
         /^CXXFLAGS /s|=.*|= ${CXXFLAGS}| ; \
         /^FC /s|=.*|= ${LOCALBASE}/bin/mpif77| ; \
         /^FFLAGS /s|=.*|= ${FFLAGS}|' \
        ${WRKSRC}/mumps/Makefile

pre-build:
    @(cd ${WRKSRC}/mumps && ${DO_MAKE_BUILD} ${ALL_TARGET})

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/sdpara ${STAGEDIR}${PREFIX}/bin
    @${MKDIR} ${STAGEDIR}${DATADIR}
    ${INSTALL_DATA}    ${WRKSRC}/param.sdpa ${STAGEDIR}${DATADIR}

post-install-EXAMPLES-on:
    @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
    ${INSTALL_DATA}    ${WRKSRC}/example* ${STAGEDIR}${EXAMPLESDIR}

.include <bsd.port.mk>