git: 8fc85cc71555 - main - misc/opennn: fix build on libomp-less architectures

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Sun, 25 Dec 2022 20:45:08 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8fc85cc715557fd65aca93b86c2d0247bd7e707b

commit 8fc85cc715557fd65aca93b86c2d0247bd7e707b
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2022-12-25 20:44:17 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2022-12-25 20:44:17 +0000

    misc/opennn: fix build on libomp-less architectures
---
 misc/opennn/Makefile | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/misc/opennn/Makefile b/misc/opennn/Makefile
index b5a344aa8ede..90319fd8f739 100644
--- a/misc/opennn/Makefile
+++ b/misc/opennn/Makefile
@@ -11,11 +11,7 @@ WWW=		https://www.opennn.net/
 LICENSE=	GPLv3
 LICENSE_FILE=	${WRKSRC}/LICENSE.txt
 
-.if !exists(/usr/include/omp.h)
-BROKEN=		requires OpenMP support that is missing on this architecture
-.endif
-
-USES=		cmake:testing compiler:c++11-lang dos2unix
+USES=		cmake:testing dos2unix
 USE_LDCONFIG=	yes
 
 USE_GITHUB=	yes
@@ -27,7 +23,16 @@ CMAKE_OFF=	OpenNN_BUILD_EXAMPLES OpenNN_BUILD_TESTS
 CMAKE_TESTING_ON=	OpenNN_BUILD_TESTS # some tests fail, see https://github.com/Artelnics/opennn/issues/229
 CMAKE_TESTING_TARGET=	tests
 
-LDFLAGS+=	-lomp -pthread # https://github.com/Artelnics/opennn/issues/182
+LDFLAGS+=	-pthread
+LDFLAGS_powerpc=	-latomic
+
+.if !exists(/usr/include/omp.h)
+LDFLAGS+=	-fopenmp
+USES+=		compiler:gcc-c++11-lib
+.else
+LDFLAGS+=	-lomp # https://github.com/Artelnics/opennn/issues/182
+USES+=		compiler:c++11-lang
+.endif
 
 do-install:
 	${MKDIR} ${STAGEDIR}${PREFIX}/include/${PORTNAME} && ${INSTALL_DATA} ${WRKSRC}/${PORTNAME}/*.h ${STAGEDIR}${PREFIX}/include/${PORTNAME}