aboutsummaryrefslogtreecommitdiffstats
path: root/net/openmpi/Makefile
blob: 9e6441ffdb56472d5c45097f9302beab4d6a5e43 (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
# Ports collection makefile for:    openmpi
# Date created:             August 22, 2005
# Whom:                 Brooks Davis <brooks@freebsd.org>
#
# $FreeBSD$
#

# TODO:
#  - etc/*.sample support

PORTNAME=   openmpi
DISTVERSION=    1.3.3
PORTREVISION=   1
CATEGORIES= net parallel
MASTER_SITES=   http://www.open-mpi.org/software/ompi/v1.3/downloads/

MAINTAINER= brooks@FreeBSD.org
COMMENT=    A High Performance Message Passing Library

LIB_DEPENDS=    execinfo:${PORTSDIR}/devel/libexecinfo

USE_BZIP2=  yes
HAS_CONFIGURE=  yes
USE_GMAKE=  yes

MPIBASE?=   mpi
MPIDIR?=    ${MPIBASE}/${UNIQUENAME}

PLIST_SUB+= CONFIGURE_TARGET=${CONFIGURE_TARGET}
PLIST_SUB+= MPIBASE=${MPIBASE}
PLIST_SUB+= MPIDIR=${MPIDIR}

CONFIGURE_ARGS+=    --prefix=${PREFIX}/${MPIDIR} \
            --mandir=${PREFIX}/${MPIDIR}/man \
            ${CONFIGURE_TARGET}

USE_LDCONFIG=   ${PREFIX}/${MPIDIR}/lib \
        ${PREFIX}/${MPIDIR}/lib/openmpi

MANPREFIX=  ${PREFIX}/${MPIDIR}
.include "${.CURDIR}/Makefile.man"

OPTIONS=    TORQUE "Enable Torque support" off \
        SGE "Enable SGE support" off

.include <bsd.port.pre.mk>

.if ${ARCH} == "sparc64"
BROKEN=     Does not compile on sparc64
.endif

USE_FORTRAN=    yes

.if defined(WITH_SGE)
SGE_BASE?=  sge
SGE_ROOT=   ${LOCALBASE}/${SGE_BASE}
SGE_ARCH=   fbsd-${ARCH}
RUN_DEPENDS+=   ${SGE_ROOT}/fbsd-${ARCH}/qrsh:${PORTSDIR}/sysutils/sge62
CONFIGURE_ARGS+=    --with-sge
CONFIGURE_ENV+= SGE_ROOT=${SGE_ROOT}
PLIST_FILES+=   ${MPIDIR}/lib/openmpi/mca_ras_gridengine.la \
        ${MPIDIR}/lib/openmpi/mca_ras_gridengine.so \
        ${MPIDIR}/share/openmpi/help-ras-gridengine.txt
.else
CONFIGURE_ARGS+=    --without-sge
.endif

.if defined(WITH_TORQUE)
LIB_DEPENDS+=   torque.2:${PORTSDIR}/sysutils/torque
CONFIGURE_ARGS+=    --with-tm=${LOCALBASE}
PLIST_FILES+=   ${MPIDIR}/lib/openmpi/mca_plm_tm.so \
        ${MPIDIR}/lib/openmpi/mca_plm_tm.la \
        ${MPIDIR}/lib/openmpi/mca_ras_tm.la \
        ${MPIDIR}/lib/openmpi/mca_ras_tm.so \
        ${MPIDIR}/share/openmpi/help-plm-tm.txt \
        ${MPIDIR}/share/openmpi/help-ras-tm.txt
.else
CONFIGURE_ARGS+=    --without-tm
.endif

#######################################################################
# The following targets are for the port maintainer.  Use at your own #
# risk, no user-serviceable parts inside.                             #
#                                                                     #
# XXX: we should generate MLINKS programaticaly, but it would take    #
# some effort and there's only one entry at this time.                #
#######################################################################
build-plist:
    ${RM} -f ${PLIST}
    ${FIND} ${PREFIX}/${MPIDIR} -name man -prune -o -type f -print | \
        ${SED} -e 's|${PREFIX}/${MPIDIR}|%%MPIDIR%%|' \
            -e 's|${CONFIGURE_TARGET}|%%CONFIGURE_TARGET%%|' | \
        ${SORT} >> ${PLIST}
    ${FIND} ${PREFIX}/${MPIDIR} -name man -prune -o -type l -print | \
        ${SED} -e 's|${PREFIX}/${MPIDIR}|%%MPIDIR%%|' \
            -e 's|${CONFIGURE_TARGET}|%%CONFIGURE_TARGET%%|' | \
        ${SORT} >> ${PLIST}
    ${FIND} ${PREFIX}/${MPIDIR} -type d | \
        ${EGREP} -v "${PREFIX}/${MPIDIR}$$" | \
        ${SED} -e 's|${PREFIX}/${MPIDIR}|@dirrm %%MPIDIR%%|' | \
        ${SORT} -r >> ${PLIST}
    ${ECHO} "@dirrmtry %%MPIDIR%%" \
        >> ${PLIST}
    ${ECHO} "@dirrmtry %%MPIBASE%%" \
        >> ${PLIST}
    @echo "# Do not edit!  Auto-generated file." > ${.CURDIR}/Makefile.man
    @echo "# See build-plist target in Makefile." >> ${.CURDIR}/Makefile.man
    @echo "#" >> ${.CURDIR}/Makefile.man
    @echo "MLINKS=mpic++.1 mpiCC.1" >> ${.CURDIR}/Makefile.man
    ${FIND} ${PREFIX}/${MPIDIR}/man -type f | \
        ${SED} -e 's|.*man\([0-9LN]\)/\(.*\)|MAN\1+=\2|' -e 's/\.gz$$//' | \
        ${SORT} >> ${.CURDIR}/Makefile.man

.include <bsd.port.post.mk>