Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Nov 2019 17:14:48 +0000 (UTC)
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r516444 - head/science/py-tensorflow
Message-ID:  <201911031714.xA3HEmJM019094@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yuri
Date: Sun Nov  3 17:14:48 2019
New Revision: 516444
URL: https://svnweb.freebsd.org/changeset/ports/516444

Log:
  science/py-tensorflow: Fix the option CPU_OPTS=ON, it wasn't passing options to bazel.
  
  The BAZEL_COPT variable was always left blank, while docs recommend passing optimization options to bazel.
  
  Also replace .include with option helpers.
  
  Testing performed:	Ran with CPU_OPTS=ON on a simple computation and observed that warnings about missing SSE4.2 optimizations are gone.
  Approved by:	portmgr (unbreak the option; change to the recommended format)

Modified:
  head/science/py-tensorflow/Makefile

Modified: head/science/py-tensorflow/Makefile
==============================================================================
--- head/science/py-tensorflow/Makefile	Sun Nov  3 16:59:39 2019	(r516443)
+++ head/science/py-tensorflow/Makefile	Sun Nov  3 17:14:48 2019	(r516444)
@@ -3,11 +3,11 @@
 PORTNAME=	tensorflow
 DISTVERSIONPREFIX=	v
 DISTVERSION=	1.14.0
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	science python
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 DIST_SUBDIR=	${PORTNAME}
-EXTRACT_ONLY=	tensorflow-tensorflow-v1.14.0_GH0.tar.gz
+EXTRACT_ONLY=	tensorflow-tensorflow-v${DISTVERSION}_GH0.tar.gz
 
 MAINTAINER=	amzo1337@gmail.com
 COMMENT=	Computation using data flow graphs for scalable machine learning
@@ -58,22 +58,18 @@ SHEBANG_GLOB=	*.py
 USE_GITHUB=	yes
 USE_PYTHON=	distutils
 
-OPTIONS_DEFINE=	CPU_OPTS
-CPU_OPTS_DESC=	Enable CPU optimisations
-
 BAZEL_BOOT=	--output_user_root=${WRKDIR}/bazel_out
 
 PLIST_SUB=	TF_PORT_VERSION=${PORTVERSION}
 
-.include "Makefile.MASTER_SITES"
-.include <bsd.port.pre.mk>
+OPTIONS_DEFINE=		CPU_OPTS
 
-.if !${PORT_OPTIONS:MCPU_OPTS}
-CPU_TARGET=x86-64
-.else
-CPU_TARGET=native
-.endif
+CPU_OPTS_DESC=		Enable optimisations using features available on your CPU
+CPU_OPTS_VARS=		CPU_TARGET=native BAZEL_COPT="-c opt --copt=-march=native --copt=-mfpmath=sse"
+CPU_OPTS_VARS_OFF=	CPU_TARGET=x86-64
 
+.include "Makefile.MASTER_SITES"
+
 post-patch:
 	# Set up a local repository with our pre-downloaded packages
 	# This prevents bazel downloading the files without modifying
@@ -160,4 +156,4 @@ post-install: # autoplist: thousands of files, all und
 	@cd ${STAGEDIR}${PREFIX} && \
 		${FIND} ${PYTHON_SITELIBDIR:C|^${LOCALBASE}/||} -type f -or -type l | grep -v "egg-info/" >> ${TMPPLIST}
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>



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