aboutsummaryrefslogtreecommitdiffstats
path: root/net/mpich2/Makefile
blob: 17dd5b45bbee310dbccf70f286b3250a07462b67 (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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# New ports collection makefile for:    mpich (portable mpi standard imp.)
# Date created:     2 May 1998
# Whom:                 dbader@ece.unm.edu
#
# $FreeBSD$
#

PORTNAME=   mpich2
PORTVERSION=    1.0.7
PORTREVISION=   3
PORTEPOCH=  3
CATEGORIES= net parallel
MASTER_SITES=   http://www.mcs.anl.gov/research/projects/mpich2/downloads/tarballs/${PORTVERSION}/
DIST_SUBDIR=    mpich
#PATCH_SITES=   ftp://ftp.mcs.anl.gov/pub/mpi/mpich2-patch/
#PATCHFILES=

MAINTAINER= ports@FreeBSD.org
COMMENT=    A portable implementation of MPI-1 and MPI-2

LIB_DEPENDS=    execinfo.1:${PORTSDIR}/devel/libexecinfo
#BUILD_DEPENDS= doctext:${PORTSDIR}/textproc/sowing

#-----------------------------------------------------------------------
# You may define these options:
#
# - WITHOUT_JAVA    don't build MPE Jumpshot-4
# - WITHOUT_X11     disable MPE graphics routines
# - WITH_SMPD       use SMPD instead of MPD for OS-mixed cluster
#-----------------------------------------------------------------------

USE_PYTHON= yes
USE_PERL5_BUILD=yes
USE_GNOME=  pkgconfig

GNU_CONFIGURE=  yes
CONFIGURE_ARGS= --enable-romio --enable-sharedlibs=gcc
CONFIGURE_ENV+= PTHREAD_LIBS="${PTHREAD_LIBS}" CPPFLAGS="-I${LOCALBASE}/include"    \
        LDFLAGS="-L${LOCALBASE}/lib -lexecinfo ${PTHREAD_LIBS}"
FFLAGS?=    -O2
NOCCACHE=   yes
MAKE_ENV=   CCACHE_DISABLE=yes

USE_FORTRAN=    yes
F90FLAGS+=  ${FFLAGS}
CONFIGURE_ENV+= F90="${FC}" F90FLAGS="${F90FLAGS}"

NO_MTREE=   yes
USE_LDCONFIG=   yes

SUB_FILES=  pkg-message

.if defined(WITHOUT_X11)
CONFIGURE_ARGS+=    --disable-graphics
WITHOUT_JAVA=   yes
PLIST_SUB+= X11="@comment "
.else
CONFIGURE_ARGS+=    --x-includes=${X11BASE}/include --x-libraries==${X11BASE}/lib
USE_XORG=   x11 xt
PLIST_SUB+= X11=${PLX11}
.endif
.if defined(WITHOUT_JAVA)
CONFIGURE_ARGS+=    --without-java
PLIST_SUB+= JAVA="@comment "
PLX11=      "@comment "
.else
USE_JAVA=   yes
JAVA_VERSION=   1.4+
BUILD_DEPENDS+= javavm:${PORTSDIR}/java/javavmwrapper
RUN_DEPENDS+=   javavm:${PORTSDIR}/java/javavmwrapper
PLIST_SUB+= JAVA=""
PLX11=      ""
.endif

.if defined(WITH_SMPD)
CONFIGURE_ARGS+=    --with-pmi=smpd --with-pm=smpd
PLIST_SUB+= PM_MPD="@comment " PM_SMPD=""
.else
CONFIGURE_ARGS+=    --with-pmi=simple --with-pm=mpd
PLIST_SUB+= PM_MPD="" PM_SMPD="@comment "
.endif

.if defined(NOPORTDOCS)
CONFIGURE_ARGS+=    --without-docdir --without-htmldir
.else
CONFIGURE_ARGS+=    --with-docdir=${DOCSDIR} --with-htmldir=${DOCSDIR}
.endif

LIBSSO=     fmpich mpich mpichcxx

THREAD2FIX= configure test/mpi/threads/comm/Makefile.in \
        test/mpi/threads/pt2pt/Makefile.in
LOCALBASE2FIX=  src/mpe2/src/slog2sdk/trace_rlog/configure  \
        src/mpe2/src/slog2sdk/trace_sample/configure    \
        src/mpe2/src/graphics/configure

.include <bsd.port.pre.mk>

.if ${OSVERSION} >= 700000 && defined(PACKAGE_BUILDING)
WITHOUT_JAVA=   yo  # No package for Java ATM
.endif

.if ${ARCH} == "ia64" || ${ARCH} == "sparc64"
WITHOUT_JAVA=   yo  # No package for Java ATM
.endif

.if ${ARCH} == "amd64"
# gmake should not be required, this is a work-around
USE_GMAKE=  yes
.endif

.if !defined(NOPORTDOCS)
.include "${FILESDIR}/manpages"
.endif

PREFIX:=    ${PREFIX}/${PORTNAME}

pre-everything::
    @${ECHO_MSG}
    @${ECHO_MSG} "You could define the following options:"
.if !defined(WITHOUT_JAVA)
    @${ECHO_MSG} "- WITHOUT_JAVA    do not build MPE Jumpshot-4"
.endif
.if !defined(WITHOUT_X11)
    @${ECHO_MSG} "- WITHOUT_X11 disable MPE graphics routines"
.endif
.if !defined(WITH_SMPD)
    @${ECHO_MSG} "- WITH_SMPD   use SMPD instead of MPD, to work with SMPD under MS Windows"
.endif
    @${ECHO_MSG}

pre-configure:
    ${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' ${THREAD2FIX:S|^|${WRKSRC}/|}
    ${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' ${LOCALBASE2FIX:S|^|${WRKSRC}/|}

    ${REINPLACE_CMD} -e 's|echo aout|echo elf|g' ${WRKSRC}/confdb/libtool-2.13.m4
    ${REINPLACE_CMD} -e 's|echo aout|echo elf|g' ${WRKSRC}/confdb/libtool.m4
    ${REINPLACE_CMD} -e 's|echo aout|echo elf|g' ${WRKSRC}/src/mpe2/src/slog2sdk/trace_rlog/libtool.m4
    ${REINPLACE_CMD} -e 's|echo aout|echo elf|g' ${WRKSRC}/src/mpe2/src/slog2sdk/trace_sample/libtool.m4
    ${REINPLACE_CMD} -e 's|echo aout|echo elf|g' ${THREAD2FIX:S|^|${WRKSRC}/|}
    ${REINPLACE_CMD} -e 's|echo aout|echo elf|g' ${LOCALBASE2FIX:S|^|${WRKSRC}/|}
.for fin in Makefile.in src/mpe2/sbin/mpeinstall.in
. if defined(NOPORTDOCS)
    ${REINPLACE_CMD} -e 's|%%PORTDOCS%%|#|' ${WRKSRC}/${fin}
. else
    ${REINPLACE_CMD} -e 's|%%PORTDOCS%%||' ${WRKSRC}/${fin}
. endif
.endfor

post-configure:
    ${REINPLACE_CMD} -e 's|$${exec_prefix}|${PREFIX}|g; \
        s|$${prefix}|${PREFIX}|g' ${WRKSRC}/src/pkgconfig/mpich2-ch3.pc

post-install:
    ${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}
    ${CHOWN} -R ${BINOWN}:${BINGRP} ${PREFIX}/bin
.for lib in ${LIBSSO}
    ${MV} ${PREFIX}/lib/lib${lib}.so.1.1 ${PREFIX}/lib/lib${lib}.so.1
    ${LN} -sf ${PREFIX}/lib/lib${lib}.so.1 ${PREFIX}/lib/lib${lib}.so
    ${LN} -sf ${PREFIX}/lib/lib${lib}.so.1 ${PREFIX}/lib/lib${lib}.so.1.1
.endfor
    @${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py ${PREFIX}/bin
    @${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py ${PREFIX}/bin
    @${CAT} ${PKGMESSAGE}

.if defined(MAINTAINER_MODE)
regression-test:    install
.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
    ${PREFIX}/bin/mpd &
    (cd ${WRKSRC} && \
    PATH=${PATH}:${PREFIX}/bin VERBOSE=1 ${MAKE} testing)
    ${PREFIX}/bin/mpdallexit
.endif

.include <bsd.port.post.mk>