aboutsummaryrefslogtreecommitdiff
path: root/science
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2019-11-03 17:14:48 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2019-11-03 17:14:48 +0000
commit82ba927cd232b74d6236c9618d54fa2a0eaa7b6a (patch)
tree545daedcc543d791dc0afabca35b7b090a73db45 /science
parent3074287458d4bfdf05ea850beb3b737fb65e8153 (diff)
downloadports-82ba927cd232b74d6236c9618d54fa2a0eaa7b6a.tar.gz
ports-82ba927cd232b74d6236c9618d54fa2a0eaa7b6a.zip
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)
Notes
Notes: svn path=/head/; revision=516444
Diffstat (limited to 'science')
-rw-r--r--science/py-tensorflow/Makefile22
1 files changed, 9 insertions, 13 deletions
diff --git a/science/py-tensorflow/Makefile b/science/py-tensorflow/Makefile
index d2b595c54477..ce3b1a350719 100644
--- a/science/py-tensorflow/Makefile
+++ b/science/py-tensorflow/Makefile
@@ -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,21 +58,17 @@ 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
@@ -160,4 +156,4 @@ post-install: # autoplist: thousands of files, all under ${PYTHON_SITELIBDIR}
@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>