Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete Installation of Tensorflow FreeBSD #50766

Closed
Amzo opened this issue Jul 14, 2021 · 15 comments
Closed

Incomplete Installation of Tensorflow FreeBSD #50766

Amzo opened this issue Jul 14, 2021 · 15 comments
Assignees
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author TF 2.1 for tracking issues in 2.1 release type:build/install Build and install issues

Comments

@Amzo
Copy link

Amzo commented Jul 14, 2021

Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): FreeBSD 13
  • TensorFlow installed from (source or binary): Source
  • TensorFlow version: v2.1.0
  • Python version: 3.8
  • Installed using virtualenv? pip? conda?: pip
  • Bazel version (if compiling from source): 0.29.0
  • GCC/Compiler version (if compiling from source): clang version 11.0.1
  • CUDA/cuDNN version: N/A
  • GPU model and memory: N/A

Describe the problem
While tensorflow will build on FreeBSD, the installation is incomplete and only provides lib/python3.8/site-packages/tensorflow_core with nothing else.

Provide the exact sequence of commands / steps that you executed before running into the problem
Commands for building:
@cd ${WRKSRC} && \ bazel --bazelrc="${WRKDIR}/bazelrc" ${BAZEL_BOOT} build ${BAZEL_COPT} --host_copt="-I${LOCALBASE}/include" \ --host_linkopt="-L${LOCALBASE}/lib" --linkopt="-L${LOCALBASE}/lib" --copt="-I${LOCALBASE}/include" \ --verbose_failures -s --incompatible_restrict_string_escapes=false \ --distdir=${WORKDIR}/bazel-dist --linkopt='-fuse-ld=lld' \ //tensorflow:libtensorflow_framework.so \ //tensorflow:libtensorflow.so \ //tensorflow:libtensorflow_cc.so \ //tensorflow/tools/pip_package:build_pip_package
The creation of the pip package:

@cd ${WRKSRC} && ${SETENV} TMPDIR=${WRKDIR} \ bazel-bin/tensorflow/tools/pip_package/build_pip_package \ ${WRKDIR}/whl

The following variables in the above command contain the following information:

LOCALBASE=/usr/local
BAZEL_BOOT= --output_user_root=${WRKDIR}/bazel_out
BAZEL_COPT="-c opt --copt=-march=native --copt=-mfpmath=sse"

Any other info / logs
I'm assuming the problem is just from the build files failing to default to a suitable platform and is falling back to default values. If I could be pointed into the right direction and files so that I could move forward and patch them it would be helpful.

@Amzo Amzo added the type:build/install Build and install issues label Jul 14, 2021
@UsharaniPagadala UsharaniPagadala added the TF 2.1 for tracking issues in 2.1 release label Jul 14, 2021
@UsharaniPagadala
Copy link

@Amzo

Could you please refer the similar link1 and link2 and let us know if it helps.Thanks

@UsharaniPagadala UsharaniPagadala added the stat:awaiting response Status - Awaiting response from author label Jul 14, 2021
@Amzo
Copy link
Author

Amzo commented Jul 14, 2021

Nope. those seem to be build issues. I've remedied and patched them and tensorflow builds successfully. However, on the creation of the pip packages, there only seems to be usr/lib/python3.8/site-packages/tensorflow_core available. All other directories are not being installed during pip creation, even though I see they have been built.

I'm not sure if there is some platform checks I've overlooked during build that I've failed to catch.

@UsharaniPagadala UsharaniPagadala removed the stat:awaiting response Status - Awaiting response from author label Jul 14, 2021
@Saduf2019
Copy link
Contributor

Saduf2019 commented Jul 15, 2021

@Amzo
Can you please try on virtual env and let us know. Also verify the prerequisites like python/os is 64 bits, avx is supported.

@Saduf2019 Saduf2019 added the stat:awaiting response Status - Awaiting response from author label Jul 15, 2021
@Amzo
Copy link
Author

Amzo commented Jul 15, 2021

I'll put this on hold for now, and see if I can get tensorflow 2.5.x to build on FreeBSD once I finish through the documentation to create a toolchain to allow it to build, as it currently errors out about no toolchains being found for now. Mostly due to there being no support for FreeBSD in bazel toolchain, and currently no docker support.

I'll see if the problem still persists in the newer version of tensorflow. Might be easier to just run a virtual env in the linuxulator on FreeBSD and avoid a native port.

@tensorflowbutler tensorflowbutler removed the stat:awaiting response Status - Awaiting response from author label Jul 16, 2021
@gt2416
Copy link

gt2416 commented Jul 16, 2021

I see on https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250646 you said you have not submitted the fix, is there any reason why.
I am trying to build photoprism (great google photo replacement), and it needs tensorflow :(

@Amzo
Copy link
Author

Amzo commented Jul 16, 2021

The patch only fixes the import of tensorflow by a broken stage in the Makefile, a lot of stuff is still missing. photoprism only needs libtensorflow which the makefile builds, if you're on freebsd you can build tensorflow from the port and take the library files from the build directory until i finish working out issues with the port. Though this is off topic. i should have things fixed in a day or two. For your issue to build protoprism i can submit a patch tomorrow to package the tensorflow libraries in.

@gt2416
Copy link

gt2416 commented Jul 16, 2021

Oh ok wow, thanks a bunch! and take your time. Silly me thought you fixed it but just haven't submitted it yet.
Edit: Got it to work, thanks a bunch!

@Saduf2019 Saduf2019 added the stat:awaiting response Status - Awaiting response from author label Jul 18, 2021
@google-ml-butler
Copy link

This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Thank you.

@google-ml-butler google-ml-butler bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label Jul 25, 2021
@google-ml-butler
Copy link

Closing as stale. Please reopen if you'd like to work on this further.

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@Huskers2020
Copy link

@Amzo - Were you able to make progress?

@Amzo
Copy link
Author

Amzo commented Sep 8, 2021

Yeah, i upgraded to 2.1.4 and fixed the packaging in the Makefile, and it works as intended on freebsd.

@Huskers2020
Copy link

@Amzo Appreciate the quick response!

Is your updated code available in ports or was it something you just did locally on your m/c?
If you had locally compiled on your m/c how long did it take?

Also, can you point to any specifics that one to be aware of to compile TF on FreeBSD

@Amzo
Copy link
Author

Amzo commented Sep 9, 2021

Code hasn't been merged yet, but this should work on FreeBSD, best to just email me about it or report on there instead of on here.

https://github.com/Amzo/FreeBSD-Tensorflow/tree/master/science/py-tensorflow

@Huskers2020
Copy link

how much time did it take to compile TF?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author TF 2.1 for tracking issues in 2.1 release type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

6 participants