summaryrefslogtreecommitdiff
path: root/science/dftbplus/Makefile
blob: a2172334579eb594b39998b8b8be9067dfce6a5d (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79

PORTNAME=	dftbplus
DISTVERSION=	19.1
PORTREVISION=	1
CATEGORIES=	science

MAINTAINER=	yuri@FreeBSD.org
COMMENT=	DFTB+: Package for performing fast atomistic simulations

LICENSE=	GPLv3 # main code is under LGPL3+, the bundled dftd3-lib is under GPLv1+, this makes the result GPLv3 (based on https://www.gnu.org/licenses/gpl-faq.html#AllCompatibility)

BROKEN_powerpc64=	fails to compile: lbfgs.f90:18:19: Cannot find an intrinsic module named 'ieee_arithmetic' at (1)

LIB_DEPENDS=	libblas.so:math/blas \
		liblapack.so:math/lapack
RUN_DEPENDS=	${PYNUMPY}

USES=		compiler:gcc-c++11-lib fortran gmake python shebangfix
SHEBANG_FILES=	tools/dptools/bin/* tools/misc/* utils/srcmanip/* utils/build/* external/fypp/bin/* utils/get_opt_externals \
		external/fypp/bin/fypp utils/test/testlist_to_fypp test/prog/dftb+/bin/tagdiff
SHEBANG_GLOB=	*.py
USE_GITHUB=	yes
GH_TUPLE=	dftbplus:mpifx:099ff75:mpifx/external/mpifx/origin \
		dftbplus:scalapackfx:86cd6e4:scalapackfx/external/scalapackfx/origin \
		dftbplus:dftd3-lib:00504a9:dftd3/external/dftd3/origin \
		dftbplus:testparams:1601609:testparams/external/slakos/origin
MAKEFILE=	makefile
TEST_TARGET=	test

FFLAGS+=	-I${LOCALBASE}/include
LDFLAGS+=	-llapack -lblas -lgfortran -lm

MAKE_ARGS=	PYTHON=${PYTHON_CMD} FC=${FC} FXX=${FC} LN=${CC} \
		INSTALLDIR=${STAGEDIR}${PREFIX} FREEBSD_PYDISTUTILS_INSTALLARGS="${PYDISTUTILS_INSTALLARGS} --root=${STAGEDIR}"

BINARY_ALIAS=		python=${PYTHON_CMD}

OPTIONS_DEFINE=		DFTD3 MPI SOCKETS ARPACK
OPTIONS_DEFAULT=	DFTD3 MPI SOCKETS

DFTD3_DESC=		Build with libdft3
DFTD3_MAKE_ARGS=	WITH_DFTD3=1
DFTD3_MAKE_ARGS_OFF=	WITH_DFTD3=0

MPI_MAKE_ARGS=		WITH_MPI=1
MPI_MAKE_ARGS_OFF=	WITH_MPI=0
MPI_LIB_DEPENDS=	libmpich.so:net/mpich \
			libscalapack.so:math/scalapack
MPI_LDFLAGS=		${LOCALBASE}/lib/libmpich.so ${LOCALBASE}/lib/libmpifort.so ${LOCALBASE}/lib/libmpi.so

SOCKETS_DESC=		Build with sockets library
SOCKETS_MAKE_ARGS=	WITH_SOCKETS=1
SOCKETS_MAKE_ARGS_OFF=	WITH_SOCKETS=0
SOCKETS_BINARY_ALIAS=	gcc=${CC}

ARPACK_DESC=		Build with ARPACK for large eigenvalue problems
ARPACK_MAKE_ARGS=	WITH_ARPACK=1
ARPACK_MAKE_ARGS_OFF=	WITH_ARPACK=0
ARPACK_LIB_DEPENDS=	libarpack.so:math/arpack-ng
ARPACK_PREVENTS=	MPI # ARPACK is only used in a single-core application

MAKE_JOBS_UNSAFE=	yes # race conditions when some options are ON

.include <bsd.port.pre.mk>

.if ${GCC_DEFAULT} >= 10
# workaround for Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/CHARACTER(*)).
# in theory, this should set FCFLAGS, but the port does not conform
FFLAGS+=	-fallow-argument-mismatch
.endif

post-extract:
	@${RM} ${WRKSRC}/external/scalapackfx/origin/test/psyr_result.dat.orig
	@cd ${WRKSRC} && ${CP} sys/make.x86_64-linux-gnu make.arch

post-install:
	@cd ${STAGEDIR}${PREFIX}/bin && ${STRIP_CMD} dftb+ modes waveplot

.include <bsd.port.post.mk>