Changeset View
Standalone View
Makefile
- This file was added.
# Created by: Jov <amutu@amutu.com> | |||||
# $FreeBSD$ | |||||
PORTNAME= tensorflow | |||||
PORTVERSION= 1.1.0 | |||||
DISTVERSIONPREFIX= v | |||||
CATEGORIES= science python | |||||
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} | |||||
MAINTAINER= amutu@amutu.com | |||||
COMMENT= Computation using data flow graphs for scalable machine learning | |||||
mat: This is a bit awful, it should probably be changed into adding this to GH_TUPLE:
```
amutu… | |||||
LICENSE= APACHE20 | |||||
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}wheel>=0.29.0:devel/py-wheel \ | |||||
${PYTHON_PKGNAMEPREFIX}numpy>=1.11.2:math/py-numpy \ | |||||
bash:shells/bash | |||||
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}numpy>=1.11.2:math/py-numpy \ | |||||
${PYTHON_PKGNAMEPREFIX}protobuf>=3.2.0:devel/py-protobuf | |||||
#PATH_MD5!= echo -n "${.CURDIR}/work/${PORTNAME}-${PORTVERSION}" | md5 | |||||
matUnsubmitted Done Inline ActionsDon't add commented out lines. mat: Don't add commented out lines. | |||||
Done Inline ActionsI remember in previous diff only OSREL:R <= 10 needs devel/bazel_clang38, so now it requires this unconditionally? lwhsu: I remember in previous diff only `OSREL:R <= 10` needs devel/bazel_clang38, so now it requires… | |||||
Done Inline Actionsprevious build tensorflow need mount /proc fs, because bazel need /proc to get its binary path. I make a patch to get rid of this and the patch added to bazel_clang38. So now tensorflow build with bazel_clang38 on all FreeBSD version without need /proc. amutu_amutu.com: previous build tensorflow need mount /proc fs, because bazel need /proc to get its binary path. | |||||
Done Inline ActionsGot it, I still do not fully understand bazel_clang38 but we can work directly on it in https://bugs.freebsd.org/219840 . Using a customized bazel here is fine. This one can be marked as done. lwhsu: Got it, I still do not fully understand bazel_clang38 but we can work directly on it in https… | |||||
USE_GITHUB= yes | |||||
GH_TUPLE= amutu:tensorflow_third_party:9c2d26b:tf/tensorflow_third_party | |||||
USES= python:2.7+ shebangfix | |||||
BAZEL_BOOT= --output_user_root=${WRKSRC}/bazel_ot --batch | |||||
BAZEL_COPT= | |||||
SHEBANG_LANG= python | |||||
python_OLD_CMD= "/usr/bin/env python" | |||||
matUnsubmitted Done Inline ActionsThis is already in python_OLD_CMD, no need to add it again. mat: This is already in python_OLD_CMD, no need to add it again. | |||||
amutu_amutu.comAuthorUnsubmitted Done Inline Actionsfixed,thanks! amutu_amutu.com: fixed,thanks! | |||||
SHEBANG_GLOB= *.py | |||||
.include <bsd.port.pre.mk> | |||||
.if ${OSREL:C/\..*//} == "10" | |||||
matUnsubmitted Not Done Inline ActionsOSREL:R mat: OSREL:R | |||||
amutu_amutu.comAuthorUnsubmitted Done Inline Actionsfixed, thanks! amutu_amutu.com: fixed, thanks! | |||||
BUILD_DEPENDS+= bazel:devel/bazel_clang38 | |||||
.else | |||||
BUILD_DEPENDS+= bazel:devel/bazel | |||||
Done Inline ActionsNo need for empty variables. mat: No need for empty variables. | |||||
Done Inline Actionsfixed,thanks! amutu_amutu.com: fixed,thanks! | |||||
.endif | |||||
Done Inline ActionsThis already exist, no need for it. mat: This already exist, no need for it. | |||||
Done Inline Actionsfixed,thanks! amutu_amutu.com: fixed,thanks! | |||||
#clang has this check enabled by default,disable it | |||||
#see: https://github.com/tensorflow/tensorflow/issues/8894 | |||||
.if ${ARCH} == "i386" | |||||
BAZEL_COPT+= --copt=-Wno-c++11-narrowing | |||||
.endif | |||||
post-patch: | |||||
(cd ${WRKSRC} && \ | |||||
${REINPLACE_CMD} "s#bazel \([cf]\)#echo bazel ${BAZEL_BOOT} \1#g" \ | |||||
${WRKSRC}/configure && \ | |||||
${REINPLACE_CMD} "s#tensorflow_third_party#${WRKSRC}/&#g" \ | |||||
${WRKSRC}/WORKSPACE && \ | |||||
${REINPLACE_CMD} "s#tensorflow_third_party#${WRKSRC}/&#g" \ | |||||
tensorflow/workspace.bzl) | |||||
do-configure: | |||||
(cd ${WRKSRC} && ${SETENV} \ | |||||
PYTHON_BIN_PATH=${PYTHON_CMD} \ | |||||
Done Inline Actionssed can change more than one file at a time, you should put this two files in the same call. mat: sed can change more than one file at a time, you should put this two files in the same call. | |||||
Done Inline Actionsfixed,thanks! amutu_amutu.com: fixed,thanks! | |||||
TF_NEED_MKL=N \ | |||||
CC_OPT_FLAGS="${CFLAGS}" \ | |||||
TF_NEED_GCP=N TF_NEED_HDFS=N \ | |||||
TF_ENABLE_XLA=N \ | |||||
TF_NEED_OPENCL=N \ | |||||
TF_NEED_CUDA=N \ | |||||
PYTHON_LIB_PATH="${PYTHON_SITELIBDIR}" \ | |||||
./configure) | |||||
do-build: | |||||
(cd ${WRKSRC} && bazel ${BAZEL_BOOT} info && \ | |||||
bazel ${BAZEL_BOOT} build ${BAZEL_COPT} --config=opt \ | |||||
//tensorflow/tools/pip_package:build_pip_package --verbose_failures) | |||||
(cd ${WRKSRC} && ${SETENV} TMPDIR=${WRKDIR} \ | |||||
bazel-bin/tensorflow/tools/pip_package/build_pip_package \ | |||||
${WRKDIR}/whl) | |||||
do-install: | |||||
@${MKDIR} ${STAGEDIR}/${PYTHON_SITELIBDIR} | |||||
@${MKDIR} ${WRKDIR}/tmp | |||||
@${UNZIP_NATIVE_CMD} -d ${WRKDIR}/tmp ${WRKDIR}/whl/${PORTNAME}-${PORTVERSION}-*.whl | |||||
@${FIND} ${WRKDIR}/tmp -name "*.so*" | ${XARGS} ${STRIP_CMD} | |||||
cd ${WRKDIR}/tmp && ${COPYTREE_SHARE} ${PORTNAME}-${PORTVERSION}.dist-info \ | |||||
${STAGEDIR}${PYTHON_SITELIBDIR} | |||||
cd ${WRKDIR}/tmp/${PORTNAME}-${PORTVERSION}.data/purelib && \ | |||||
${COPYTREE_SHARE} . ${STAGEDIR}${PYTHON_SITELIBDIR} | |||||
.include <bsd.port.post.mk> |
This is a bit awful, it should probably be changed into adding this to GH_TUPLE:
and adding an:
The PORTVERSION could then probably be removed from the patch names.