Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 May 2017 16:01:26 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 219609] [NEW PORT] science/tensorflow: Computation using data flow graphs for scalable machine learning
Message-ID:  <bug-219609-13-eet3wyDt9U@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-219609-13@https.bugs.freebsd.org/bugzilla/>
References:  <bug-219609-13@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D219609

--- Comment #6 from Jov <amutu@amutu.com> ---
(In reply to Kubilay Kocak from comment #5)
Thanks for your review,from your comment I learn more about freebsd ports,I
appreciate it! My reply is inlined:

>Initial review:

>1) USES=3Dpython implies {RUN,BUILD}_DEPENDS on Python (can remove python:=
lang/python). Additionally, use of python:lang/python is always incorrect, =
as it only means 'depends on the `python` symlink' not 'depends on python'.=
 Only use USES=3Dpython:<args>
will fix

>2) Upstream stipulates Python 2.7 *and* 3.3+ support. USES=3Dpython:2.7 li=
mits it to 2.7 only.
will fix by using USES=3Dpython:2.7+,and test python3.

>3) Regarding BROKEN (${OSVERSION} < 1100101):

>3a) clang and llvm 3.8 exist in ports and can be depended on. If there is =
nothing intrinsic or super-complex preventing other versions of FreeBSD fro=
m building tensorflow, it should do so.
see blow 3b

>3b) If clang is not a requirement for building tensorflow, it should not b=
e a specific dependency. I see no mention of it on the 'building tensorflow=
 from sources' document, but further, there *is* mention of builds with GCC=
, which motivates this comment.
I have try to use gcc but it is failed for bazel to find gcc.If I set
--compiler=3Dgcc-5.4.0,bazel report error:
(cd /usr/ports/science/tensorflow/work/tensorflow-1.1.0 && bazel
--output_user_root=3D/usr/ports/science/tensorflow/work/bazel_ot build
--compiler=3Dgcc-5.4.0  --config=3Dopt
//tensorflow/tools/pip_package:build_pip_package --verbose_failures)
ERROR: No toolchain found for --cpu=3D'freebsd' --compiler=3D'gcc-5.4.0'. V=
alid
toolchains are: [
  --cpu=3D'armeabi-v7a' --compiler=3D'compiler' --glibc=3D'armeabi-v7a',
  --cpu=3D'local' --compiler=3D'compiler' --glibc=3D'local',
  --cpu=3D'darwin' --compiler=3D'compiler' --glibc=3D'macosx',
  --cpu=3D'freebsd' --compiler=3D'compiler' --glibc=3D'local',
  --cpu=3D'x64_windows' --compiler=3D'windows_mingw' --glibc=3D'local',
  --cpu=3D'x64_windows' --compiler=3D'windows_msys64_mingw64' --glibc=3D'lo=
cal',
  --cpu=3D'x64_windows' --compiler=3D'windows_clang' --glibc=3D'local',
  --cpu=3D'x64_windows' --compiler=3D'windows_msys64' --glibc=3D'local',
  --cpu=3D'x64_windows_msvc' --compiler=3D'cl' --glibc=3D'msvcrt140',
  --cpu=3D'ios_x86_64' --compiler=3D'compiler' --glibc=3D'ios',

After read this,I think I need to write a toolchain config to work with gcc=
:=20
https://github.com/bazelbuild/bazel/wiki/Building-with-a-custom-toolchain

>USES=3Dcompiler:<args> should be used if a specific feature is required (S=
ee Porters Handbook -- USES -- compiler for details [1])
will fix after I solve 3b.

>4) Vendored dependencies should be extracted/removed and those ports/packa=
ges in the tree depended on instead.
tensorflow use bazel manage dependencises.
the tensorflow-1.1.0/tensorflow/workspace.bzl contains dependencises info l=
ike
this:
native.new_http_archive(
      name =3D "org_pocoo_werkzeug",
      urls =3D [
=20=20=20=20=20=20=20=20=20
"http://bazel-mirror.storage.googleapis.com/pypi.python.org/packages/b7/7f/=
44d3cfe5a12ba002b253f6985a4477edfa66da53787a2a838a40f6415263/Werkzeug-0.11.=
10.tar.gz",
=20=20=20=20=20=20=20=20=20
"https://pypi.python.org/packages/b7/7f/44d3cfe5a12ba002b253f6985a4477edfa6=
6da53787a2a838a40f6415263/Werkzeug-0.11.10.tar.gz",
      ],
      strip_prefix =3D "Werkzeug-0.11.10",
      sha256 =3D
"cc64dafbacc716cdd42503cf6c44cb5a35576443d82f29f6829e5c49264aeeee",
      build_file =3D str(Label("//third_party:werkzeug.BUILD")),
  )

And the count of dependencies is bigger than normal ports=EF=BC=9A=20
grep -c 'sha256 =3D' workspace.bzl=20
90
some dependencises even are not available on FreeBSD ports,like grpc.
It is a lot work to make this fixed and need to patch the bazel config ,this
will make future update difficult also.

>5) It's unlikely that all python dependencies are both RUN and BUILD depen=
dencies. Please make these as accurate to their actual dependency types as =
possible.
will fixed

>6) -march=3Dnative should not be used for CC/CFLAGS. Binary packages are b=
uilt from ports and build host CPU architecture has no bearing on end-user =
hardware, which may be different.
will fixed by using $CFLAGS

>7) configuration (in this case ./configure) steps should be run in the do-=
configure target, not the build target. Additionally and ideally, using CON=
FIGURE_TARGET and other CONFIGURE_* variables, without requiring a custom d=
o-configure target override. If bazel is a pre build or 'configuration' ste=
p, it should be done in the configure target as well.
I hope to do this as you say,but the configure of this port is not gnu
autoconfig or similar,it is a bash script! It used to read user input from
stdin and set some variables then do bazel fetch.
I will fix this by moving configure to do-configure target.

>8) Patching of WRKSRC files should occur in {pre,post}-patch target, not b=
uild target.
As 4 and 7 mentioned, the configure will fetch all dependencises and the pa=
tch
is for the grpc and protobuf which only are available after configure.
So I will fix tis by moving patch to post-configure target.

>9) Was using the port/package of pip tested rather than configuring/buildi=
ng the  bundled tensorflow/tools/pip_package? The former should be used if =
and where possible.
yes I understand.but there is no pip package for freebsd,tensorflow offical
suport=20
 is linux and macos.tensorflow/tools/pip_package will build one=EF=BC=8Cit =
will include
all the dependencises python lib and C/C++ libs to the pip package,you can =
see
the pkg-plist.

>This port requires additional QA iterations
I will setup poudriere to test this when all of the above fixed.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-219609-13-eet3wyDt9U>