huo-ju / photoprism-freebsd-port

The photoprism port for FreeBSD
BSD 2-Clause "Simplified" License
69 stars 15 forks source link

Bazel asks interactive questions #1

Closed lapo-luchini closed 3 years ago

lapo-luchini commented 3 years ago

I tried accepting all default, but it should probably automated in order to be committed as an official FreeBSD Port.

lapo-luchini commented 3 years ago

Maybe related? Did I chose some default that wasn't supposed to be default? image

huo-ju commented 3 years ago

I borrowed the configure script from the Tensorflow project, and it's may have the wrong default values on the various system. You may try different values to build it.

danb35 commented 3 years ago

I'm not sure if it's exactly the same issue, but Tensorflow fails to build for me as well:

ERROR: /root/photoprism-freebsd-port/work/photoprism-ff758c3ed6b540f4be237166ac0cce2b0f22dcba/_docker/tensorflow/tensorflow-1.15.2/tensorflow/BUILD:563:1: Linking of rule '//tensorflow:libtensorflow_framework.so.1.15.2' failed (Exit 1)
ld: error: duplicate symbol: adler32
>>> defined at adler32.c
>>>            adler32.pic.o:(adler32) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at adler32.c
>>>            adler32.pic.o:(.text.adler32+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: adler32_combine
>>> defined at adler32.c
>>>            adler32.pic.o:(adler32_combine) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at adler32.c
>>>            adler32.pic.o:(.text.adler32_combine+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: adler32_combine64
>>> defined at adler32.c
>>>            adler32.pic.o:(adler32_combine64) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at adler32.c
>>>            adler32.pic.o:(.text.adler32_combine64+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: adler32_z
>>> defined at adler32.c
>>>            adler32.pic.o:(adler32_z) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at adler32.c
>>>            adler32.pic.o:(.text.adler32_z+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: compress
>>> defined at compress.c
>>>            compress.pic.o:(compress) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at compress.c
>>>            compress.pic.o:(.text.compress+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: compress2
>>> defined at compress.c
>>>            compress.pic.o:(compress2) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at compress.c
>>>            compress.pic.o:(.text.compress2+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: compressBound
>>> defined at compress.c
>>>            compress.pic.o:(compressBound) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at compress.c
>>>            compress.pic.o:(.text.compressBound+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: crc32
>>> defined at crc32.c
>>>            crc32.pic.o:(crc32) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at crc32.c
>>>            crc32.pic.o:(.text.crc32+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: crc32_combine
>>> defined at crc32.c
>>>            crc32.pic.o:(crc32_combine) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at crc32.c
>>>            crc32.pic.o:(.text.crc32_combine+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: crc32_combine64
>>> defined at crc32.c
>>>            crc32.pic.o:(crc32_combine64) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at crc32.c
>>>            crc32.pic.o:(.text.crc32_combine64+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: crc32_z
>>> defined at crc32.c
>>>            crc32.pic.o:(crc32_z) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at crc32.c
>>>            crc32.pic.o:(.text.crc32_z+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: get_crc_table
>>> defined at crc32.c
>>>            crc32.pic.o:(get_crc_table) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at crc32.c
>>>            crc32.pic.o:(.text.get_crc_table+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: deflate
>>> defined at deflate.c
>>>            deflate.pic.o:(deflate) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at deflate.c
>>>            deflate.pic.o:(.text.deflate+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: deflateBound
>>> defined at deflate.c
>>>            deflate.pic.o:(deflateBound) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at deflate.c
>>>            deflate.pic.o:(.text.deflateBound+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: deflateCopy
>>> defined at deflate.c
>>>            deflate.pic.o:(deflateCopy) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at deflate.c
>>>            deflate.pic.o:(.text.deflateCopy+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: deflateEnd
>>> defined at deflate.c
>>>            deflate.pic.o:(deflateEnd) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at deflate.c
>>>            deflate.pic.o:(.text.deflateEnd+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: deflateGetDictionary
>>> defined at deflate.c
>>>            deflate.pic.o:(deflateGetDictionary) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at deflate.c
>>>            deflate.pic.o:(.text.deflateGetDictionary+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: deflateInit2_
>>> defined at deflate.c
>>>            deflate.pic.o:(deflateInit2_) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at deflate.c
>>>            deflate.pic.o:(.text.deflateInit2_+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: deflateInit_
>>> defined at deflate.c
>>>            deflate.pic.o:(deflateInit_) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at deflate.c
>>>            deflate.pic.o:(.text.deflateInit_+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: deflateParams
>>> defined at deflate.c
>>>            deflate.pic.o:(deflateParams) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at deflate.c
>>>            deflate.pic.o:(.text.deflateParams+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Target //tensorflow:libtensorflow.so failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 495.400s, Critical Path: 159.31s
INFO: 3768 processes: 3768 local.
FAILED: Build did NOT complete successfully
*** Error code 1

The provided default paths for python3 and the site-packages directory appeared correct (e.g., python3 was present at the former location, the latter directory did exist, and its path seemed to match the running version of python3 (3.7). The only other questions dealt with additional features, all defaulted to "no", and I left them at default.

huo-ju commented 3 years ago

Can you check if https://github.com/tensorflow/tensorflow/issues/31196#issuecomment-521227967 helps?

danb35 commented 3 years ago

I'm not sure I followed that discussion correctly. In photoprism-freebsd-port/work/photoprism-ff758c3ed6b540f4be237166ac0cce2b0f22dcba/_docker/tensorflow/tensorflow-1.15.2/third_party/protobuf, I do have protobuf.patch with the contents mentioned in that comment. Based on this comment, I edited photoprism-freebsd-port/work/photoprism-ff758c3ed6b540f4be237166ac0cce2b0f22dcba/_docker/tensorflow/tensorflow-1.15.2/third_party/repo.bzl for lines 66-69 to read as follows:

#    if _is_windows(ctx):
        patch_command = ["patch", "-p1", "-d", ctx.path("."), "-i", ctx.path(patch_file)]
#    else:
#        patch_command = ["git", "apply", "-v", ctx.path(patch_file)]

But I was then unable to re-run the build without renaming _docker to docker, which appears to have resulted in tensorflow being downloaded again and the changes being lost.

huo-ju commented 3 years ago

Yes, I rename the docker directory to avoid conflicts with the original repo. So I think a better solution is to move the Tensorflow out as an independent ports. I will try to fix it.

lapo-luchini commented 3 years ago

@huo-ju there is already a working tensorflow 1.15.4 available as a PR and waiting to be committed to the Ports.

Main problem seems to be that it doesn't build on the package building hosts because no download are allowed during build (in order to ensure that identical file hashes produce identical outputs), but from the comments it seems to be working fine when compiled locally.

huo-ju commented 3 years ago

@lapo-luchini Thanks, I will check it out.

huo-ju commented 3 years ago

@danb35 I just fixed it, and the docker directory will not be renamed to _docker anymore.

danb35 commented 3 years ago

That commit does let it build. 👍 Now to figure out the default password...

lapo-luchini commented 3 years ago

Still fails to me. :(

ERROR: /usr/ports/work/home/lapo/ports/www/photoprism/work/photoprism-6b0d94ff42fadccfe88c4d68744b9d3afea36e2f/docker/tensorflow/tensorflow-1.15.2/tensorflow/core/kernels/BUILD:4201:1: C++ compilation of rule '//tensorflow/core/kernels:conv_ops' failed (Killed): clang failed: error executing command /usr/bin/clang -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF ... (remaining 200 argument(s) skipped)
Target //tensorflow:libtensorflow.so failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 580.752s, Critical Path: 343.26s
INFO: 21 processes: 21 local.
FAILED: Build did NOT complete successfully

@danb35 what FreeBSD are you using? I'm on 12.2-RELEASE-p2 / amd64 (binary release).

danb35 commented 3 years ago

It's in a TrueNAS CORE (i.e., rebranded FreeNAS) 12.0 jail, running 12.2:

root@photoprism:~ # freebsd-version
12.2-RELEASE-p2
huo-ju commented 3 years ago

@lapo-luchini

My best guess is that Bazel has run out of the memory.

failed (Killed): clang failed: error executing command

Please try to modified the Line 48 of the Makefile and add --jobs 2 after the build command to limit concurrent jobs.

It should looks like this:

bazel --output_user_root="${WRKDIR}/.bazel" build --jobs 2 --config=opt

The --local_ram_resources option also may helps.

This link may helps you: https://github.com/tensorflow/tensorflow/issues/30047

lapo-luchini commented 3 years ago

The --local_ram_resources option also may helps.

Wow, the default is "67% of host RAM"… that's quite crazy! I'm trying --local_ram_resource=2048 (without limiting jobs) and seems to go well so far.

BTW, to return on-topic is there a way to send Bazel defaults for those questions it asks? I'm always pressing "enter" to accept all defaults, but that shuld probably become fixed values inside the Makefile and/or options managed by the Ports options system, not by interactive build questions.

thstyl2000 commented 3 years ago

Many thanks for the efforts! It looks like I have a similar issue with the latest commit on a 12.2-RELEASE-p3 jail:

tensorflow/core/common_runtime/copy_tensor.cc:338:1: note: in instantiation of member function 'tensorflow::variant_op_registry_fn_registration::UnaryVariantDeviceCopyRegistration<tensorflow::Tensor>::UnaryVariantDeviceCopyRegistration' requested here
REGISTER_WRAPPED_TENSOR_COPY(VariantDeviceCopyDirection::HOST_TO_DEVICE);
^
tensorflow/core/common_runtime/copy_tensor.cc:335:3: note: expanded from macro 'REGISTER_WRAPPED_TENSOR_COPY'
  INTERNAL_REGISTER_UNARY_VARIANT_DEVICE_COPY_FUNCTION( \
  ^
./tensorflow/core/framework/variant_op_registry.h:480:3: note: expanded from macro 'INTERNAL_REGISTER_UNARY_VARIANT_DEVICE_COPY_FUNCTION'
>>>            deflate.pic.o:(.text.deflateInit2_+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: deflateInit_
>>> defined at deflate.c
>>>            deflate.pic.o:(deflateInit_) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at deflate.c
>>>            deflate.pic.o:(.text.deflateInit_+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: deflateParams
>>> defined at deflate.c
>>>            deflate.pic.o:(deflateParams) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at deflate.c
>>>            deflate.pic.o:(.text.deflateParams+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Target //tensorflow:libtensorflow.so failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 8215.938s, Critical Path: 331.12s
INFO: 6162 processes: 6162 local.
FAILED: Build did NOT complete successfully
*** Error code 1

Stop.
make[1]: stopped in /root/photoprism-freebsd-port
*** Error code 1
huo-ju commented 3 years ago

@thstyl2000 Sorry, this error is related to the tensorflow project, and I never saw it before.

thstyl2000 commented 3 years ago

Thanks for your reply! Ok, after rebuilding with updated ports I get the same error as in https://github.com/huo-ju/photoprism-freebsd-port/issues/1#issuecomment-757922787 above but not in the _docker directory:

ERROR: /root/photoprism-freebsd-port/work/photoprism-6b0d94ff42fadccfe88c4d68744b9d3afea36e2f/docker/tensorflow/tensorflow-1.15.2/tensorflow/BUILD:563:1: Linking of rule '//tensorflow:libtensorflow_framework.so.1.15.2' failed (Exit 1)
ld: error: duplicate symbol: adler32
>>> defined at adler32.c
>>>            adler32.pic.o:(adler32) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at adler32.c
>>>            adler32.pic.o:(.text.adler32+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: adler32_combine
>>> defined at adler32.c
>>>            adler32.pic.o:(adler32_combine) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at adler32.c
>>>            adler32.pic.o:(.text.adler32_combine+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: adler32_combine64
>>> defined at adler32.c
>>>            adler32.pic.o:(adler32_combine64) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at adler32.c
>>>            adler32.pic.o:(.text.adler32_combine64+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: adler32_z
>>> defined at adler32.c
>>>            adler32.pic.o:(adler32_z) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at adler32.c
>>>            adler32.pic.o:(.text.adler32_z+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: compress
>>> defined at compress.c
>>>            compress.pic.o:(compress) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at compress.c
>>>            compress.pic.o:(.text.compress+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: compress2
>>> defined at compress.c
>>>            compress.pic.o:(compress2) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at compress.c
>>>            compress.pic.o:(.text.compress2+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: compressBound
>>> defined at compress.c
>>>            compress.pic.o:(compressBound) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at compress.c
>>>            compress.pic.o:(.text.compressBound+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: crc32
>>> defined at crc32.c
>>>            crc32.pic.o:(crc32) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at crc32.c
>>>            crc32.pic.o:(.text.crc32+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: crc32_combine
>>> defined at crc32.c
>>>            crc32.pic.o:(crc32_combine) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at crc32.c
>>>            crc32.pic.o:(.text.crc32_combine+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: crc32_combine64
>>> defined at crc32.c
>>>            crc32.pic.o:(crc32_combine64) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at crc32.c
>>>            crc32.pic.o:(.text.crc32_combine64+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: crc32_z
>>> defined at crc32.c
>>>            crc32.pic.o:(crc32_z) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at crc32.c
>>>            crc32.pic.o:(.text.crc32_z+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: get_crc_table
>>> defined at crc32.c
>>>            crc32.pic.o:(get_crc_table) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at crc32.c
>>>            crc32.pic.o:(.text.get_crc_table+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: deflate
>>> defined at deflate.c
>>>            deflate.pic.o:(deflate) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at deflate.c
>>>            deflate.pic.o:(.text.deflate+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: deflateBound
>>> defined at deflate.c
>>>            deflate.pic.o:(deflateBound) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at deflate.c
>>>            deflate.pic.o:(.text.deflateBound+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: deflateCopy
>>> defined at deflate.c
>>>            deflate.pic.o:(deflateCopy) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at deflate.c
>>>            deflate.pic.o:(.text.deflateCopy+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: deflateEnd
>>> defined at deflate.c
>>>            deflate.pic.o:(deflateEnd) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at deflate.c
>>>            deflate.pic.o:(.text.deflateEnd+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: deflateGetDictionary
>>> defined at deflate.c
>>>            deflate.pic.o:(deflateGetDictionary) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at deflate.c
>>>            deflate.pic.o:(.text.deflateGetDictionary+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: deflateInit2_
>>> defined at deflate.c
>>>            deflate.pic.o:(deflateInit2_) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at deflate.c
>>>            deflate.pic.o:(.text.deflateInit2_+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: deflateInit_
>>> defined at deflate.c
>>>            deflate.pic.o:(deflateInit_) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at deflate.c
>>>            deflate.pic.o:(.text.deflateInit_+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: deflateParams
>>> defined at deflate.c
>>>            deflate.pic.o:(deflateParams) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at deflate.c
>>>            deflate.pic.o:(.text.deflateParams+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

>>>            deflate.pic.o:(.text.deflateInit2_+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: deflateInit_
>>> defined at deflate.c
>>>            deflate.pic.o:(deflateInit_) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at deflate.c
>>>            deflate.pic.o:(.text.deflateInit_+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: deflateParams
>>> defined at deflate.c
>>>            deflate.pic.o:(deflateParams) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at deflate.c
>>>            deflate.pic.o:(.text.deflateParams+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Target //tensorflow:libtensorflow.so failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 3846.817s, Critical Path: 177.44s
INFO: 4909 processes: 4909 local.
FAILED: Build did NOT complete successfully
*** Error code 1

Stop.
make[1]: stopped in /root/photoprism-freebsd-port
*** Error code 1

Stop.
make: stopped in /root/photoprism-freebsd-port
thstyl2000 commented 3 years ago

Ok, compiling, then applying the workaround as in this comment and recompiling finishes without error.

Electr0Fi commented 2 years ago

How is this still broken over a year later? I'm getting the same error as here: https://github.com/huo-ju/photoprism-freebsd-port/issues/1#issuecomment-757922787

ERROR: /usr/ports/science/libtensorflow1/work/tensorflow-1.15.5/tensorflow/BUILD:563:1: Linking of rule '//tensorflow:libtensorflow_framework.so.1.15.5' failed (Exit 1) ld: error: duplicate symbol: adler32

defined at adler32.c adler32.pic.o:(adler32) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a defined at adler32.c adler32.pic.o:(.text.adler32+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

Electr0Fi commented 2 years ago

Ok, compiling, then applying the workaround as in this comment and recompiling finishes without error.

@thstyl2000 There is no work around in the comment you linked to.

thstyl2000 commented 2 years ago

@Electr0Fi you'll need to change the file thrid_party/repo.bzl according to the diff in that comment.

Electr0Fi commented 2 years ago

@Electr0Fi you'll need to change the file thrid_party/repo.bzl according to the diff in that comment.

@thstyl2000 Ahh okay, and where can I find that file?

thstyl2000 commented 2 years ago

You should be able to find it after the first failed build.

@huo-ju Shouldn't this be reopened?

huo-ju commented 2 years ago

You should be able to find it after the first failed build.

@huo-ju Shouldn't this be reopened?

Sorry, but the tensorflow has been move to a new repo at https://github.com/psa/libtensorflow1-freebsd-port . You do not need to apply the patch from this repo.