aboutsummaryrefslogtreecommitdiffstats
path: root/cad/scotch/Makefile
blob: c0d9e841cb7a45bae5e06eddc4a32dc14d5bdf96 (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# New ports collection makefile for:    scotch
# Date created:     Thu 2 feb 2006
# Whom:         thierry@pompo.net
#
# $FreeBSD$
#

PORTNAME=   scotch
PORTVERSION=    5.0.6
PORTREVISION=   1
CATEGORIES= cad science
MASTER_SITES=   http://gforge.inria.fr/frs/download.php/3795/
DISTNAME=   ${PORTNAME}_${PORTVERSION}

MAINTAINER= thierry@FreeBSD.org
COMMENT=    A package for graph and mesh partitioning and sparse matrix ordering

USE_GMAKE=  yes
.if defined(MAINTAINER_MODE)
USE_FORTRAN=    yes
.endif

WRKSRC=     ${WRKDIR}/${DISTNAME:R}
BUILD_WRKSRC=   ${WRKSRC}/src
INSTALL_WRKSRC= ${WRKSRC}/bin
ALL_TARGET= scotch

VER=        ${PORTVERSION:R}
BINS=       acpl amk_ccc amk_fft2 amk_grf amk_hy amk_m2 amk_p2 atst \
        gbase gcv gmap gmk_hy gmk_m2 gmk_m3 gmk_msh gmk_ub2 gmtst gord\
        gotst gout gtst mcv mmk_m2 mmk_m3 mord mtst
INCS=       common.h scotch.h scotchf.h
LIBS=       libcommon.a libscotch.a libscotcherr.a libscotcherrcom.a\
        libscotchmetis.a
LICDOCS=    CeCILL-C_V1-en.txt CeCILL-C_V1-fr.txt
PORTDOCS=   scotch_user${VER}.pdf
EXAMPLES=   scotch_example.f

PKGMESSAGE= ${WRKSRC}/LICENSE_en.txt

.if !defined(WITHOUT_MPI)
BUILD_DEPENDS+= ${LOCALBASE}/mpich2/bin/mpicc:${PORTSDIR}/net/mpich2
RUN_DEPENDS+=   ${LOCALBASE}/mpich2/lib/libmpich.so:${PORTSDIR}/net/mpich2

ALL_TARGET+=    ptscotch
MAKE_ENV+=  PATH=${PATH}:${LOCALBASE}/mpich2/bin

INCS+=      ptscotch.h ptscotchf.h
LIBS+=      libptscotch.a libptscotcherr.a
BINS+=      dgord dgscat dgtst

PLIST_SUB+= MPI=""
.else
PLIST_SUB+= MPI="@comment "
.endif

pre-everything::
.if !defined(WITHOUT_MPI)
    @${ECHO_MSG}
    @${ECHO_MSG} "Define WITHOUT_MPI if PT-Scotch is not wanted."
    @${ECHO_MSG}
.endif

pre-configure:
    ${LN} -sf ${WRKSRC}/src/Make.inc/Makefile.inc.freebsd   \
        ${WRKSRC}/src/Makefile.inc
    ${REINPLACE_CMD} -e 's|in subdirectory "doc"|under ${DATADIR}|' \
        ${WRKSRC}/LICENSE_en.txt

do-install:
    ${INSTALL_PROGRAM} ${BINS:S|^|${INSTALL_WRKSRC}/|} ${PREFIX}/bin
    ${INSTALL_DATA} ${INCS:S|^|${INSTALL_WRKSRC}/|} ${PREFIX}/include
    ${INSTALL_DATA} ${LIBS:S|^|${INSTALL_WRKSRC}/|} ${PREFIX}/lib
    ${MKDIR} ${DATADIR}
    ${INSTALL_DATA} ${LICDOCS:S|^|${WRKSRC}/doc/|} ${DATADIR}
.if !defined(NOPORTDOCS)
    ${MKDIR} ${DOCSDIR}
    ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/doc/|} ${DOCSDIR}
    @${ECHO_MSG} "===> Documentation installed in ${DOCSDIR}."
.endif
.if !defined(NOPORTEXAMPLES)
    ${MKDIR} ${EXAMPLESDIR}/grf ${EXAMPLESDIR}/tgt
    ${INSTALL_DATA} ${EXAMPLES:S|^|${WRKSRC}/doc/|} ${EXAMPLESDIR}
    ${INSTALL_DATA} ${WRKSRC}/grf/* ${EXAMPLESDIR}/grf
    ${INSTALL_DATA} ${WRKSRC}/tgt/* ${EXAMPLESDIR}/tgt
    @${ECHO_MSG} "===> Examples installed in ${EXAMPLESDIR}."
.endif

post-install:
    @${ECHO_MSG}
    @${CAT} ${PKGMESSAGE}
    @${ECHO_MSG}

.if defined(MAINTAINER_MODE)
regression-test:    install
    (amk_ccc 3 | acpl - ${WRKDIR}/ccc3.tgt &&   \
    ${GUNZIP_CMD} -c ${EXAMPLESDIR}/grf/bump.grf.gz |   \
    gmap - ${WRKDIR}/ccc3.tgt ${WRKDIR}/brol.map)
    (cd ${WRKSRC}/doc &&    \
    ${FC} -o scotch_test scotch_example.f   \
        -I${PREFIX}/include -L${PREFIX}/lib -lscotch -lscotcherr -lm    \
    && ./scotch_test)
. if !defined(WITHOUT_MPI)
    (${GUNZIP_CMD} -c ${EXAMPLESDIR}/grf/bump.grf.gz | dgtst)
. endif
.endif

.include <bsd.port.mk>