aboutsummaryrefslogtreecommitdiffstats
path: root/science/mpqc/Makefile
blob: d4990b5cf1d547a8e4202d0cd9de092ce72769f3 (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
# New ports collection makefile for:    mpqc
# Date created:             27 April 2001
# Whom:                 batman <batman@udel.edu>
#
# $FreeBSD$
#

PORTNAME=   mpqc
PORTVERSION=    2.3.1
PORTREVISION=   3
CATEGORIES= science parallel
MASTER_SITES=   ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= mpqc

MAINTAINER= maho@FreeBSD.org
COMMENT=    The massively parallel quantum computing library and program

USE_PERL5=  yes
USE_GMAKE=  yes
USE_BZIP2=  yes
USE_LDCONFIG=   yes
PLIST_SUB+= VERSION=${PORTVERSION}

.include <bsd.port.pre.mk>

.if defined(WITH_ICC)
BUILD_DEPENDS+=  ${LOCALBASE}/intel_cc_80/bin/icc:${PORTSDIR}/lang/icc
.endif
.if exists(${LOCALBASE}/lib/libatlas_r.so) && !defined(WITH_BLAS)
WITH_ATLAS= yes
.endif
.if defined(WITH_ATLAS)
LIB_DEPENDS+=   atlas.2:${PORTSDIR}/math/atlas
BLAS=       -lf77blas -latlas -lcblas
LAPACK=     -lalapack
.else
LIB_DEPENDS+=   blas.2:${PORTSDIR}/math/blas
LIB_DEPENDS+=   lapack.4:${PORTSDIR}/math/lapack
BLAS=       -lblas
LAPACK=     -llapack
.endif
.if defined(WITH_MPICH)
BUILD_DEPENDS+= ${LOCALBASE}/mpich2/lib/libmpich.a:${PORTSDIR}/net/mpich2
.endif
LIB_DEPENDS+=   int.1:${PORTSDIR}/science/libint
.if !defined(NOPORTDOCS)
BUILD_DEPENDS+= doxygen:${PORTSDIR}/devel/doxygen
.endif

GNU_CONFIGURE=  yes
USE_AUTOTOOLS=  autoconf:259

WANT_FORTRAN=   yes #dummy but future use
BUILD_DEPENDS+= gfortran42:${PORTSDIR}/lang/gcc42
FC=     gfortran42
F77=        gfortran42

.if defined(WITH_ICC)
CC=     ${LOCALBASE}/intel_cc_80/bin/icc
CXX=        ${LOCALBASE}/intel_cc_80/bin/icpc
CFLAGS=     -O3 -tpp7 -xMKW -Vaxlib
CXXFLAGS=   -O3 -tpp7 -xMKW -Vaxlib
.endif

CONFIGURE_ARGS+=--with-cc=${CC} \
        --with-cxx=${CXX} \
        --with-f77=${FC} \
        --with-libdirs=-L${LOCALBASE}/lib \
        --with-blas="${BLAS}" \
        --with-lapack="${LAPACK}" \
        --with-coptflags="${CFLAGS}" \
        --with-cxxoptflags="${CXXFLAGS}" \
        --with-f77optflags="${FFLAGS}" \
        --with-include="-I${WRKDIR} -I${LOCALBASE}/include" \
        --enable-shared
.if defined(WITH_ICC)
CONFIGURE_ARGS+=--with-libs="-lsvml"
.endif
.if defined(WITH_MPICH)
CONFIGURE_ARGS+=--with-libdirs="-L${LOCALBASE}/lib -L${LOCALBASE}/mpich2/lib"\
        --with-include="-I${LOCALBASE}/mpich2/include -I${WRKDIR}" \
        --enable-always-use-mpi
.endif

MPQC_COMMAND=   ${PREFIX}/bin/mpqc

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

.if defined(WITH_OPTIMIZED_FLAGS)
CFLAGS+=    -O2 -ffast-math
CXXFLAGS+=  -O2 -ffast-math
.endif

pre-configure:
    @${ECHO} "You can optimize by setting WITH_OPTIMIZED_FLAGS=yes."

do-build:
    @cd ${WRKSRC} ; ${GMAKE}
.if !defined(NOPORTDOCS)
    @cd ${WRKSRC}/doc ; ${GMAKE}
.endif

do-install:
    (cd ${WRKSRC} ; ${GMAKE} install)
    (cd ${WRKSRC} ; ${GMAKE} install_devel)
    ${MKDIR} ${PREFIX}/share/mpqc/validate
    cd ${WRKSRC}/src/bin/mpqc/validate/ ; ${TAR} -chf - . | \
        ${TAR} -xf - -C ${PREFIX}/share/mpqc/validate
    ${FIND} ${PREFIX}/share/mpqc/validate | ${XARGS} ${CHOWN} ${SHAREOWN}:${SHAREGRP}
    ${FIND} ${PREFIX}/share/mpqc/validate -type f | ${XARGS} ${CHMOD} ${SHAREMODE}

post-install:
.if !defined(NOPORTDOCS)
    (cd ${WRKSRC}/doc/man/man3 ; ${INSTALL_MAN} * ${PREFIX}/man/man3)
    (cd ${WRKSRC}/doc/man/man1 ; ${INSTALL_MAN} * ${PREFIX}/man/man1)
    ${MKDIR} ${DOCSDIR}
    cd ${WRKSRC}/doc/html ; ${TAR} -chf - . | ${TAR} -xf - -C ${DOCSDIR}
    ${FIND} ${DOCSDIR} | ${XARGS} ${CHOWN} ${SHAREOWN}:${SHAREGRP}
    ${FIND} ${DOCSDIR} -type f | ${XARGS} ${CHMOD} ${SHAREMODE}
.endif

validate:
    cd ${WRKSRC}/src/bin/mpqc/validate ; ${GMAKE} check0 ; ${GMAKE} check0_run ; ${GMAKE} check0_chk

.include <bsd.port.post.mk>