Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Dec 2019 13:40:03 +0000 (UTC)
From:      Piotr Kubaj <pkubaj@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r520806 - in head/math/mkl-dnn: . files
Message-ID:  <201912241340.xBODe3gB038729@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pkubaj
Date: Tue Dec 24 13:40:02 2019
New Revision: 520806
URL: https://svnweb.freebsd.org/changeset/ports/520806

Log:
  math/mkl-dnn: fix build on non-x86
  
  Remove hardcoded -msse4.1 and instead add it to our Makefile, but only on amd64 and i386.
  
  PR:		242847
  Approved by:	yuri (maintainer)

Added:
  head/math/mkl-dnn/files/patch-cmake_platform.cmake   (contents, props changed)
Modified:
  head/math/mkl-dnn/Makefile

Modified: head/math/mkl-dnn/Makefile
==============================================================================
--- head/math/mkl-dnn/Makefile	Tue Dec 24 13:36:50 2019	(r520805)
+++ head/math/mkl-dnn/Makefile	Tue Dec 24 13:40:02 2019	(r520806)
@@ -11,8 +11,6 @@ COMMENT=	Intel(R) Math Kernel Library for Deep Neural 
 LICENSE=	APACHE20
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
-ONLY_FOR_ARCHS=		amd64 i386
-ONLY_FOR_ARCHS_REASON=	Intel MKL-DNN supports Intel 64 architecture and compatible architectures
 BROKEN_i386=	error: shift count >= width of type (and other errors), see https://github.com/intel/mkl-dnn/issues/315
 
 TEST_DEPENDS=	bash:shells/bash
@@ -29,6 +27,9 @@ OPTIONS_DEFAULT=	OPENMP
 OPENMP_CMAKE_BOOL=	USE_OPENMP
 OPENMP_LIB_DEPENDS=	libomp.so:devel/openmp
 OPENMP_BROKEN_OFF=	still requires omp.h, see https://github.com/intel/mkl-dnn/issues/581
+
+CXXFLAGS_amd64=	-msse4.1
+CFXXLAGS_i386=	-msse4.1
 
 post-install:
 	@${RM} -r ${STAGEDIR}${PREFIX}/share/doc

Added: head/math/mkl-dnn/files/patch-cmake_platform.cmake
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/mkl-dnn/files/patch-cmake_platform.cmake	Tue Dec 24 13:40:02 2019	(r520806)
@@ -0,0 +1,18 @@
+--- cmake/platform.cmake.orig	2019-12-24 01:47:09 UTC
++++ cmake/platform.cmake
+@@ -89,7 +89,6 @@ elseif(UNIX OR MINGW)
+     append(CMAKE_CCXX_NOEXCEPT_FLAGS "-fno-exceptions")
+     # compiler specific settings
+     if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+-        set(DEF_ARCH_OPT_FLAGS "-msse4.1")
+         # Clang cannot vectorize some loops with #pragma omp simd and gets
+         # very upset. Tell it that it's okay and that we love it
+         # unconditionally.
+@@ -133,7 +132,6 @@ elseif(UNIX OR MINGW)
+             append(CMAKE_CCXX_SANITIZER_FLAGS "-g -fno-omit-frame-pointer")
+         endif()
+     elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+-        set(DEF_ARCH_OPT_FLAGS "-msse4.1")
+         # suppress warning on assumptions made regarding overflow (#146)
+         append(CMAKE_CCXX_NOWARN_FLAGS "-Wno-strict-overflow")
+     elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912241340.xBODe3gB038729>