summaryrefslogtreecommitdiff
path: root/security/openfhe/Makefile
blob: 62c8901e44f5565e89a7ab718f3f2f7553fcdc9d (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
PORTNAME=	openfhe
DISTVERSIONPREFIX=	v
DISTVERSION=	1.2.4
CATEGORIES=	security math

MAINTAINER=	yuri@FreeBSD.org
COMMENT=	Open-source Fully Homomorphic Encryption library
WWW=		https://github.com/openfheorg/openfhe-development

LICENSE=	BSD2CLAUSE
LICENSE_FILE=	${WRKSRC}/LICENSE

BROKEN_i386=	compilation fails: error: __int128 is not supported on this target
.if !exists(/usr/include/omp.h)
BROKEN=		requires OpenMP support that is missing on this architecture
.endif

BUILD_DEPENDS=	autoconf:devel/autoconf # possibly a mistake in the project

USES=		cmake:noninja,testing compiler:c++17-lang localbase:ldflags # cmake refuses to work with ninja
USE_LDCONFIG=	yes

USE_GITHUB=	yes
GH_ACCOUNT=	openfheorg
GH_PROJECT=	openfhe-development
GH_TUPLE=	openfheorg:cereal:984e3f1:cereal/third-party/cereal \
		google:googletest:8b4817e:google_test/third-party/google-test

LDFLAGS+=	-pthread

CMAKE_OFF=	BUILD_UNITTESTS BUILD_EXAMPLES BUILD_BENCHMARKS
CMAKE_TESTING_ON=	BUILD_UNITTESTS
CMAKE_TESTING_TARGET=	testall

BINARY_ALIAS=	git=false

OPTIONS_DEFINE=		HEXL NTL OPENMP
OPTIONS_DEFAULT=	NTL

HEXL_DESC=		Buld with Intel hexl
HEXL_CMAKE_BOOL=	WITH_INTEL_HEXL
HEXL_BROKEN=		Fails to find hexl package and no hexl submodule

NTL_DESC=		Build with libntl
NTL_CMAKE_BOOL=		WITH_NTL
NTL_LIB_DEPENDS=	libgmp.so:math/gmp \
			libntl.so:math/ntl

OPENMP_CMAKE_BOOL=	WITH_OPENMP
.if exists(/usr/include/omp.h)
OPTIONS_DEFAULT+=	OPENMP
.else
OPENMP_BROKEN=		OpenMP isn't enabled on this architecture
.endif

post-install:
	@${RM} ${STAGEDIR}${PREFIX}/include/openfhe/core/math/hal/intnat/ubintnat.h.orig

.include <bsd.port.mk>