summaryrefslogtreecommitdiff
path: root/math/dbcsr/Makefile
blob: 7bae1623868f1a37ff61e4637230374c1ba8b5be (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
PORTNAME=	dbcsr
DISTVERSIONPREFIX=	v
DISTVERSION=	2.6.0
PORTREVISION=	2
CATEGORIES=	math

MAINTAINER=	yuri@FreeBSD.org
COMMENT=	Distributed Block Compressed Sparse Row matrix library
WWW=		https://www.cp2k.org/dbcsr

LICENSE=	GPLv3
LICENSE_FILE=	${WRKSRC}/LICENSE

.if !exists(/usr/include/omp.h)
BROKEN=		requires OpenMP support that is missing on this architecture
.endif

BUILD_DEPENDS=	fypp:devel/py-fypp@${PY_FLAVOR}

USES=		blaslapack:openblas cmake:noninja,testing compiler:c++14-lang fortran \
		python:build
USE_LDCONFIG=	yes

USE_GITHUB=	yes
GH_ACCOUNT=	cp2k

FFLAGS+=	-D__NO_STATM_ACCESS # disable /proc/self/statm access
LDFLAGS+=	-lopenblas

CMAKE_ON=	BUILD_SHARED_LIBS
CMAKE_OFF=	BUILD_TESTING WITH_EXAMPLES
CMAKE_ARGS=	-DBLA_VENDOR:STRING="OpenBLAS" -DPython_EXECUTABLE=${PYTHON_CMD}

BINARY_ALIAS=	git=false # with git sonames get messed up

OPTIONS_DEFINE=		MPI OPENMP C_API # libxsmm is supposed to be supported, but cmake build lacks the corresponding option: https://github.com/cp2k/dbcsr/issues/73
OPTIONS_DEFAULT=	MPI OPENMP C_API
OPTIONS_SUB=		yes

MPI_CMAKE_BOOL=		USE_MPI
MPI_LIB_DEPENDS=	libmpi_cxx.so:net/openmpi4

OPENMP_CMAKE_BOOL=	USE_OPENMP

C_API_DESC=		Build the C API library
C_API_CMAKE_BOOL=	WITH_C_API

.include <bsd.port.pre.mk>

.  if ${GCC_DEFAULT} >= 10
CMAKE_ARGS+=	-DCMAKE_Fortran_FLAGS="${FFLAGS} -fallow-argument-mismatch" # -fallow-argument-mismatch is a workaround of https://github.com/cp2k/dbcsr/issues/387 for gcc10+
.  else
CMAKE_ARGS+=	-DCMAKE_Fortran_FLAGS="${FFLAGS}"
.  endif

.include <bsd.port.post.mk>