aboutsummaryrefslogtreecommitdiff
path: root/science/mpb/Makefile
blob: 1af4a0c7a3545fd13b34bb8ff387b75feb7a494c (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
# Created by: ijliao
# $FreeBSD$

PORTNAME=	mpb
PORTVERSION=	1.5
PORTREVISION=	4
CATEGORIES=	science
MASTER_SITES=	http://ab-initio.mit.edu/mpb/

MAINTAINER=	rhurlin@gwdg.de
COMMENT=	MIT Photonic-Bands

LICENSE=	GPLv2

BUILD_DEPENDS=	bash:shells/bash
LIB_DEPENDS=	libfftw.so:math/fftw \
		libhdf5.so:science/hdf5 \
		libctl.so:science/libctl \
		libguile-2.0.so:lang/guile2

OPTIONS_DEFINE=	ATLAS NLOPT
ATLAS_DESC=	Use math/atlas instead of math/lapack
NLOPT_DESC=	Use math/nlopt (check also in science/libctl)

USES=		fortran libtool pkgconfig
GNU_CONFIGURE=	yes
MAKE_JOBS_UNSAFE=	yes

CPPFLAGS+=	-I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib

NLOPT_LIB_DEPENDS=	libnlopt.so:math/nlopt

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MATLAS}
LIB_DEPENDS+=	libatlas.so:math/atlas
CONFIGURE_ARGS+=	--with-lapack=-lalapack
.else
LIB_DEPENDS+=	libblas.so:math/blas \
		liblapack.so:math/lapack
CONFIGURE_ARGS+=	--with-lapack=-llapack
.endif

post-patch:
	@${REINPLACE_CMD} -e 's|-lhdf5 |-lhdf5 -lpthread |g' \
		${WRKSRC}/configure
	@${REINPLACE_CMD} \
		-e '/INSTALL/s/$$(prefix)/$$(DESTDIR)$$(prefix)/' \
		-e '/INSTALL/s/$$(mandir)/$$(DESTDIR)$$(mandir)/' \
		${WRKSRC}/mpb/Makefile.in ${WRKSRC}/utils/Makefile.in

.include <bsd.port.mk>