aboutsummaryrefslogtreecommitdiff
path: root/misc/opennn
diff options
context:
space:
mode:
authorPiotr Kubaj <pkubaj@FreeBSD.org>2020-04-23 11:38:24 +0000
committerPiotr Kubaj <pkubaj@FreeBSD.org>2020-04-23 11:38:24 +0000
commite2ab569e011e4c238890c514ef8e1a39f6e141b7 (patch)
treec3068eadc9afcd182eedcc4b11f422f4a35e806d /misc/opennn
parent174f9a276ccb3b75c3f69e78adee27975ba4e938 (diff)
downloadports-e2ab569e011e4c238890c514ef8e1a39f6e141b7.tar.gz
ports-e2ab569e011e4c238890c514ef8e1a39f6e141b7.zip
misc/opennn: fix build on GCC architectures and powerpc64 elfv2
clang 8 doesn't have full support for powerpc, powerpc64 or powerpcspe, so use GCC there. On powerpc64 elfv2, the default is to build for elfv1, so pass a flag to fix it. MFH: 2020Q2 (fix build blanket)
Notes
Notes: svn path=/head/; revision=532668
Diffstat (limited to 'misc/opennn')
-rw-r--r--misc/opennn/Makefile14
1 files changed, 12 insertions, 2 deletions
diff --git a/misc/opennn/Makefile b/misc/opennn/Makefile
index f411ee75fd47..f37988d9f17f 100644
--- a/misc/opennn/Makefile
+++ b/misc/opennn/Makefile
@@ -12,7 +12,7 @@ COMMENT= Open neural networks library
LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
-USES= cmake dos2unix # compiler:c++11-lang
+USES= cmake compiler dos2unix
DOS2UNIX_FILES= CMakeLists.txt
USE_GITHUB= yes
GH_ACCOUNT= Artelnics
@@ -29,16 +29,26 @@ MPI_BROKEN= https://github.com/Artelnics/OpenNN/issues/86
OPENMP_CMAKE_BOOL= __OPENNN_OMP__
+.include <bsd.port.pre.mk>
+
+.if ${CHOSEN_COMPILER_TYPE} == gcc
+USE_GCC= yes
+.else
# workaround for breakage with clang-10: https://github.com/Artelnics/OpenNN/issues/105
LLVM_VER= 80
BUILD_DEPENDS+= clang${LLVM_VER}:devel/llvm${LLVM_VER}
CPP= clang-cpp${LLVM_VER}
CC= clang${LLVM_VER}
CXX= clang++${LLVM_VER}
+# clang-8 defaults to elfv1 on FreeBSD, to be removed after moving to 9 or newer
+.if ${ARCH} == powerpc64
+CFLAGS+= -mabi=elfv2
+.endif
+.endif
do-install:
${MKDIR} ${STAGEDIR}${PREFIX}/include/${PORTNAME} && ${INSTALL_DATA} ${WRKSRC}/${PORTNAME}/*.h ${STAGEDIR}${PREFIX}/include/${PORTNAME}
${INSTALL_DATA} ${BUILD_WRKSRC}/${PORTNAME}/libopennn.so ${STAGEDIR}${PREFIX}/lib
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libopennn.so
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>