aboutsummaryrefslogtreecommitdiff
path: root/science/fleur/Makefile
blob: 80ba62345f6322745e5d59ecb1e919d777b4687a (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
PORTNAME=	fleur
DISTVERSION=	6.0-20220715
PORTREVISION=	2
CATEGORIES=	science # chemistry

MAINTAINER=	yuri@FreeBSD.org
COMMENT=	FLAPW code for atomic computations in quantum chemistry and physics
WWW=		https://www.flapw.de/master/

LICENSE=	MIT
LICENSE_FILE=	${WRKSRC}/LICENSE

BROKEN_aarch64=	Fatal Error: Cannot find an intrinsic module named 'ieee_arithmetic' at (1)

LIB_DEPENDS=	libfftw3.so:math/fftw3 \
		liblapack.so:math/lapack \
		libopenblas.so:math/openblas
TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} \

USES=		cmake:noninja fortran gnome localbase:ldflags python:test tar:tgz
USE_GNOME=	libxml2

USE_GITLAB=	yes
GL_SITE=	https://iffgit.fz-juelich.de
GL_TAGNAME=	a2934446e0eb1fcbf7a69d4d652c969cef0c8c8d

FFLAGS=		-I${LOCALBASE}/include
LDFLAGS+=	-llapack -lopenblas -lxml2 # to fix missing symbols, see https://iffgit.fz-juelich.de/fleur/fleur/-/issues/670

OPTIONS_DEFINE=		HDF5 KPLIB MPI SCALAPACK ELPA LIBXC WANNIER
OPTIONS_DEFAULT=	MPI SCALAPACK ELPA WANNIER # HDF5 KPLIB LIBXC

HDF5_CMAKE_BOOL=	CLI_FLEUR_USE_HDF5
HDF5_CMAKE_ON=		-DHDF5_INCLUDE_DIRS=${LOCALBASE}/include
HDF5_LIB_DEPENDS=	libhdf5.so:science/hdf5
HDF5_BROKEN=		Missing hdf5.mod in hdf5 # hdf5 doesn't include Fortran binding

KPLIB_DESC=		Use kpLib library
#KPLIB_CMAKE_BOOL=	CLI_FLEUR_USE_KPLIB
KPLIB_DEPENDS=		libkplib.so:science/kplib
KPLIB_BROKEN=		Fails to find the pre-installed libkplib.so library, see https://iffgit.fz-juelich.de/fleur/fleur/-/issues/691

MPI_CMAKE_BOOL=		CLI_FLEUR_USE_MPI
MPI_LDFLAGS=		-lmpich -lmpifort
MPI_LIB_DEPENDS=	libmpich.so:net/mpich
MPI_VARS=		SUFFIX=_MPI

SCALAPACK_DESC=		Use the ScaLAPACK Scalable LAPACK library
SCALAPACK_CMAKE_BOOL=	FLEUR_USE_SCALAPACK # no such variable, see https://iffgit.fz-juelich.de/fleur/fleur/-/issues/692, it works only through LDFLAGS set below
SCALAPACK_VARS=		FFLAGS+=-fallow-argument-mismatch
SCALAPACK_LDFLAGS=	-lscalapack
SCALAPACK_LIB_DEPENDS=	libscalapack.so:math/scalapack
SCALAPACK_IMPLIES=	MPI

ELPA_DESC=		Use libelpa, Eigenvalue SoLver for Petaflop Applications
ELPA_CMAKE_BOOL=	FLEUR_USE_ELPA # no such variable, see https://iffgit.fz-juelich.de/fleur/fleur/-/issues/689, it works only through FFLAGS set below
ELPA_VARS=		FFLAGS+=-I${LOCALBASE}/include/elpa-2021.11.001/modules
ELPA_LDFLAGS=		-lelpa
ELPA_LIB_DEPENDS=	libelpa.so:math/elpa

LIBXC_DESC=		Use libxc library
LIBXC_CMAKE_BOOL=	CLI_FLEUR_USE_LIBXC
LIBXC_LIB_DEPENDS=	libxc.so:science/libxc
LIBXC_BROKEN=		Silently links with libxc when CLI_FLEUR_USE_LIBXC=OFF, see https://iffgit.fz-juelich.de/fleur/fleur/-/issues/690

WANNIER_DESC=		Use Wannier library
WANNIER_CMAKE_BOOL=	CLI_FLEUR_USE_WANNIER
WANNIER_LIB_DEPENDS=	libwannier.so:science/wannier90

EXECUTABLES=	bin/fleur${SUFFIX} \
		bin/inpgen
PLIST_FILES=	${EXECUTABLES}

CONFLICTS_BUILD=	libxc # see https://iffgit.fz-juelich.de/fleur/fleur/-/issues/690

post-install: # strip
	@cd ${STAGEDIR}${PREFIX} && ${STRIP_CMD} ${EXECUTABLES}

do-test:
	# now: some tests fail or freeze, possibly because of missing hdf5 and kplib dependencies
	# was: 9 testcases are known to fail, see https://iffgit.fz-juelich.de/fleur/fleur/-/issues/671
	@cd ${WRKSRC}/tests && pytest ../tests --build_dir=${TEST_WRKSRC}

.include <bsd.port.mk>