summaryrefslogtreecommitdiff
path: root/science/libgridxc/Makefile
blob: 055ffed4b0cff2a138191fb930a90cb582c9206e (plain)
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

PORTNAME=	libgridxc
DISTVERSION=	0.8.5
PORTREVISION=	3
CATEGORIES=	science
MASTER_SITES=	https://launchpad.net/${PORTNAME}/trunk/${DISTVERSION:R}/+download/

MAINTAINER=	yuri@FreeBSD.org
COMMENT=	Library to compute the exchange and correlation energy and potentials

LICENSE=	BSD3CLAUSE
LICENSE_FILE=	${WRKSRC}/../BSD_LICENSE

USES=		fortran gmake tar:tgz
USE_LDCONFIG=	yes

MAKEFILE=	makefile
ALL_TARGET=	default

WRKSRC_SUBDIR=	src

BUILD_WRKSRC=	${WRKSRC}/../build
TMP_STAGEDIR=	${WRKDIR}/tmp_stage
MAKE_ENV=	INSTALL_DIR=${TMP_STAGEDIR}${PREFIX} FREEBSD_LOCALBASE=${LOCALBASE} LIBXC_ROOT=${LOCALBASE}

BINARY_ALIAS=	make=${GMAKE}

OPTIONS_DEFINE=		MPI LIBXC
OPTIONS_DEFAULT=	MPI # LIBXC

MPI_MAKE_ENV=		WITH_MPI=1
MPI_LIB_DEPENDS=	libmpich.so:net/mpich

LIBXC_DESC=		Use libxc for exchange-correlation functionals for DFT
LIBXC_MAKE_ENV=		WITH_LIBXC=1
LIBXC_LIB_DEPENDS=	libxc.so:science/libxc
LIBXC_BROKEN=		Fails to build with libxc-5.0.0: https://bugs.launchpad.net/libgridxc/+bug/1899578

.include <bsd.port.pre.mk>

.if ${GCC_DEFAULT} >= 10
BROKEN=		fails to build with GCC 10: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(8)/INTEGER(4)).
.endif

post-patch:
	@${MKDIR} ${BUILD_WRKSRC}
	@${CAT} ${WRKSRC}/../extra/fortran.mk \
		| ${SED} '\
			s|FC_SERIAL=gfortran|&${GCC_DEFAULT}|; \
			s|FFLAGS= -O2|& -fPIC|' \
		> ${BUILD_WRKSRC}/fortran.mk

do-configure:
	@cd ${BUILD_WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ${SH} ../src/config.sh

do-build:
	@cd ${BUILD_WRKSRC} && ${MKDIR} ${TMP_STAGEDIR} && ${SETENV} ${MAKE_ENV} ${SH} ../src/build.sh

do-install:
	cd ${TMP_STAGEDIR} && ${COPYTREE_SHARE} . ${STAGEDIR}
	${MKDIR} ${STAGEDIR}${PREFIX}/share/mk && ${MV} ${STAGEDIR}${PREFIX}/*.mk ${STAGEDIR}${PREFIX}/share/mk
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libGridXC.so

.include <bsd.port.post.mk>