I have been trying to compile photoprism on FreeBSD using photoprism-freebsd-port for a couple of days without success.
The commands I used follow:
cd /tmp
git clone 'https://github.com/huo-ju/photoprism-freebsd-port.git'
cd photoprism-freebsd-port
LD_LIBRARY_PATH=".:/lib:/usr/libexec:/usr/local/lib" make BATCH=yes OPTIONS_SET=AVX
ERROR: /usr/ports/science/py-tensorflow/work-py38/tensorflow-1.15.5/tensorflow/python/BUILD:329:1: C++ compilation of rule '//tensorflow/python:bfloat16_lib' failed (Exit 1)
tensorflow/python/lib/core/bfloat16.cc:633:8: error: no matching function for call to object of type '(lambda at tensorflow/python/lib/core/bfloat16.cc:607:25)'
if (!register_ufunc("equal", CompareUFunc<Bfloat16EqFunctor>,
^~~~~~~~~~~~~~
tensorflow/python/lib/core/bfloat16.cc:607:25: note: candidate function not viable: no overload of 'CompareUFunc' matching 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') for 2nd argument
auto register_ufunc = [&](const char* name, PyUFuncGenericFunction fn,
^
tensorflow/python/lib/core/bfloat16.cc:637:8: error: no matching function for call to object of type '(lambda at tensorflow/python/lib/core/bfloat16.cc:607:25)'
if (!register_ufunc("not_equal", CompareUFunc<Bfloat16NeFunctor>,
^~~~~~~~~~~~~~
tensorflow/python/lib/core/bfloat16.cc:607:25: note: candidate function not viable: no overload of 'CompareUFunc' matching 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') for 2nd argument
auto register_ufunc = [&](const char* name, PyUFuncGenericFunction fn,
^
tensorflow/python/lib/core/bfloat16.cc:641:8: error: no matching function for call to object of type '(lambda at tensorflow/python/lib/core/bfloat16.cc:607:25)'
if (!register_ufunc("less", CompareUFunc<Bfloat16LtFunctor>, compare_types)) {
^~~~~~~~~~~~~~
tensorflow/python/lib/core/bfloat16.cc:607:25: note: candidate function not viable: no overload of 'CompareUFunc' matching 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') for 2nd argument
auto register_ufunc = [&](const char* name, PyUFuncGenericFunction fn,
^
tensorflow/python/lib/core/bfloat16.cc:644:8: error: no matching function for call to object of type '(lambda at tensorflow/python/lib/core/bfloat16.cc:607:25)'
if (!register_ufunc("greater", CompareUFunc<Bfloat16GtFunctor>,
^~~~~~~~~~~~~~
tensorflow/python/lib/core/bfloat16.cc:607:25: note: candidate function not viable: no overload of 'CompareUFunc' matching 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') for 2nd argument
auto register_ufunc = [&](const char* name, PyUFuncGenericFunction fn,
^
tensorflow/python/lib/core/bfloat16.cc:648:8: error: no matching function for call to object of type '(lambda at tensorflow/python/lib/core/bfloat16.cc:607:25)'
if (!register_ufunc("less_equal", CompareUFunc<Bfloat16LeFunctor>,
^~~~~~~~~~~~~~
tensorflow/python/lib/core/bfloat16.cc:607:25: note: candidate function not viable: no overload of 'CompareUFunc' matching 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') for 2nd argument
auto register_ufunc = [&](const char* name, PyUFuncGenericFunction fn,
^
tensorflow/python/lib/core/bfloat16.cc:652:8: error: no matching function for call to object of type '(lambda at tensorflow/python/lib/core/bfloat16.cc:607:25)'
if (!register_ufunc("greater_equal", CompareUFunc<Bfloat16GeFunctor>,
^~~~~~~~~~~~~~
tensorflow/python/lib/core/bfloat16.cc:607:25: note: candidate function not viable: no overload of 'CompareUFunc' matching 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') for 2nd argument
auto register_ufunc = [&](const char* name, PyUFuncGenericFunction fn,
^
6 errors generated.
I tried checking out the ports tree to a version from December 2021 and Photoprism to a commit before the switch to external tensorflow but I got other linker issues (see below). The commits I tried were:
ERROR: /tmp/lansnap-build/photoprism-freebsd-port/work/photoprism-93b26f197908dd825dfa302d17793185cc3eab8c/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
... (repeated for multiple other functions)
My question is: Am I compiling Photoprism correctly, and if yes - why is tensorflow failing to compile?
I am using FreeBSD 13.0-RELEASE.