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

build issues with tensorflow on PPC64LE #2550

Closed
Shreeshrii opened this issue Jul 8, 2019 · 25 comments
Labels

Comments

@Shreeshrii
Copy link
Contributor

@Shreeshrii Shreeshrii commented Jul 8, 2019

@stweil I am running into errors while building tatweel_test, these are related to tensorflow.

I have installed tensorflow and protobuf by

sudo pip3 install --upgrade https://powerci.osuosl.org/job/TensorFlow_PPC64LE_CPU_Nightly_Artifact/lastSuccessfulBuild/artifact/tensorflow_pkg/tf_nightly-2.0.0.dev20190707-cp36-cp36m-linux_ppc64le.whl

I made the following symbolic links so that the include files would be found.

sudo ln -s /usr/local/lib/python3.6/dist-packages/tensorflow_core/include/tensorflow /usr/local/include/tensorflow
sudo ln -s /usr/local/lib/python3.6/dist-packages/tensorflow_core/include/tensorflow/core/protobuf  /usr/local/include/protobuf 
sudo ln -s /usr/local/lib/python3.6/dist-packages/tensorflow_core/include/google /usr/local/lib/google

Now I am getting the following error regarding missing file google/protobuf/util/message_differencer.h. As shown later via ls, the file exists. I don't know how to resolve this. Probably needs some change to include path to find the files.

depbase=`echo tatweel_test.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DHAVE_CONFIG_H -I. -I../../unittest -I..  -DNDEBUG -DTESSBIN_DIR="\"/home/ubuntu/tesseract/bin\"" -DLANGDATA_DIR="\"/home/ubuntu/langdata_lstm\"" -DTESSDATA_DIR="\"/home/ubuntu/tessdata\"" -DTESSDATA_BEST_DIR="\"/home/ubuntu/tessdata_best\"" -DTESTING_DIR="\"/home/ubuntu/tesseract/test/testing\"" -DTESTDATA_DIR="\"/home/ubuntu/tesseract/test/testdata\"" -DPANGO_ENABLE_ENGINE  -I../src/api -I../../src/api -I../../src/arch -I../../src/ccmain -I../../src/ccstruct -I../../src/ccutil -I../../src/classify -I../../src/cutil -I../../src/dict -I../../src/display -I../../src/lstm -I../../src/textord -I../../unittest/base -I../../unittest/util -I../../src/training -I../../src/viewer -I../../src/wordrec -I../../abseil  -isystem ../../googletest/googletest/include -isystem ../../googletest/googlemock/include -I/usr/include/leptonica   -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/powerpc64le-linux-gnu/glib-2.0/include -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/powerpc64le-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16  -g -O2 -Wall -Wextra -Wpedantic -std=c++17 -MT tatweel_test.o -MD -MP -MF $depbase.Tpo -c -o tatweel_test.o ../../unittest/tatweel_test.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from ../../unittest/util/utf8/unicodetext.h:25:0,
                 from ../../unittest/tatweel_test.cc:22:
../../unittest/syntaxnet/base.h:25:10: fatal error: google/protobuf/util/message_differencer.h: No such file or directory
 #include "google/protobuf/util/message_differencer.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:1861: recipe for target 'tatweel_test.o' failed
make[2]: *** [tatweel_test.o] Error 1
make[2]: Leaving directory '/home/ubuntu/tesseract/bin/unittest'
Makefile:2592: recipe for target 'check-am' failed
make[1]: *** [check-am] Error 2
make[1]: Leaving directory '/home/ubuntu/tesseract/bin/unittest'
Makefile:502: recipe for target 'check-recursive' failed
make: *** [check-recursive] Error 1

ls  /usr/local/lib/python3.6/dist-packages/tensorflow_core/include/google/protobuf/util/message_differencer.h -l

-rw-r--r-- 1 root staff 44587 Jul  8 09:42 /usr/local/lib/python3.6/dist-packages/tensorflow_core/include/google/protobuf/util/message_differencer.h
@stweil

This comment has been minimized.

Copy link
Contributor

@stweil stweil commented Jul 8, 2019

It is part of libprotobuf-dev on Debian. That package is installed automatically with libtensorflow-dev:

libprotobuf-dev:amd64: /usr/include/google/protobuf/util/message_differencer.h

Ah, I see, your third symbolic link should link to include instead of lib:

ln -s /usr/local/lib/python3.6/dist-packages/tensorflow_core/include/tensorflow /usr/local/include
ln -s /usr/local/lib/python3.6/dist-packages/tensorflow_core/include/tensorflow/core/protobuf  /usr/local/include
ln -s /usr/local/lib/python3.6/dist-packages/tensorflow_core/include/google /usr/local/include
@stweil stweil added the question label Jul 8, 2019
@Shreeshrii

This comment has been minimized.

Copy link
Contributor Author

@Shreeshrii Shreeshrii commented Jul 8, 2019

I had tried getting the debian package but couldn't install it.

ubuntu@tesseract-ocr:~$ wget http://ftp.mx.debian.org/debian/pool/main/t/tensorflow/libtensorflow-dev_1.10.1+dfsg-A1_ppc64el.deb
--2019-07-08 13:28:37--  http://ftp.mx.debian.org/debian/pool/main/t/tensorflow/libtensorflow-dev_1.10.1+dfsg-A1_ppc64el.deb
Resolving ftp.mx.debian.org (ftp.mx.debian.org)... 132.248.182.159
Connecting to ftp.mx.debian.org (ftp.mx.debian.org)|132.248.182.159|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2296976 (2.2M) [application/x-debian-package]
Saving to: ‘libtensorflow-dev_1.10.1+dfsg-A1_ppc64el.deb’

libtensorflow-dev_1.10.1+dfsg-A1_ppc64el.deb      100%[==========================================================================================================>]   2.19M   935KB/s    in 2.4s

2019-07-08 13:28:41 (935 KB/s) - ‘libtensorflow-dev_1.10.1+dfsg-A1_ppc64el.deb’ saved [2296976/2296976]

ubuntu@tesseract-ocr:~$ sudo dpkg -i libtensorflow-dev_1.10.1+dfsg-A1_ppc64el.deb
Selecting previously unselected package libtensorflow-dev:ppc64el.
(Reading database ... 243965 files and directories currently installed.)
Preparing to unpack libtensorflow-dev_1.10.1+dfsg-A1_ppc64el.deb ...
Unpacking libtensorflow-dev:ppc64el (1.10.1+dfsg-A1) ...
dpkg: dependency problems prevent configuration of libtensorflow-dev:ppc64el:
 libtensorflow-dev:ppc64el depends on libtensorflow-framework1.10 (= 1.10.1+dfsg-A1); however:
  Package libtensorflow-framework1.10 is not installed.
 libtensorflow-dev:ppc64el depends on libtensorflow1.10 (= 1.10.1+dfsg-A1); however:
  Package libtensorflow1.10 is not installed.
 libtensorflow-dev:ppc64el depends on libtensorflow-cc1.10 (= 1.10.1+dfsg-A1); however:
  Package libtensorflow-cc1.10 is not installed.
 libtensorflow-dev:ppc64el depends on libprotobuf-dev (>= 3.6.0~); however:
  Package libprotobuf-dev is not installed.
 libtensorflow-dev:ppc64el depends on libgrpc++-dev (>= 1.14.1~); however:
  Package libgrpc++-dev is not installed.
 libtensorflow-dev:ppc64el depends on llvm-7-dev (>= 1:7~+rc2-1~exp1~); however:
  Package llvm-7-dev is not installed.

dpkg: error processing package libtensorflow-dev:ppc64el (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libtensorflow-dev:ppc64el
ubuntu@tesseract-ocr:~$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libllvm7 libprotobuf-lite10 linux-headers-4.15.0-51 linux-headers-4.15.0-51-generic linux-image-4.15.0-51-generic linux-modules-4.15.0-51-generic linux-modules-extra-4.15.0-51-generic
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  libtensorflow-dev
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 21.6 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 245957 files and directories currently installed.)
Removing libtensorflow-dev:ppc64el (1.10.1+dfsg-A1) ...
@stweil

This comment has been minimized.

Copy link
Contributor

@stweil stweil commented Jul 8, 2019

Fixing the symbolic link would be easier.

@stweil

This comment has been minimized.

Copy link
Contributor

@stweil stweil commented Jul 8, 2019

libprotobuf-dev is available for Ubuntu.

@Shreeshrii

This comment has been minimized.

Copy link
Contributor Author

@Shreeshrii Shreeshrii commented Jul 8, 2019

libprotobuf-dev is available for Ubuntu.

That is an older version which gives errors with tensorflow.

@Shreeshrii

This comment has been minimized.

Copy link
Contributor Author

@Shreeshrii Shreeshrii commented Jul 8, 2019

Fixing the symbolic link would be easier.

Thanks for noticing that error.

I am trying with the correct symbolic link. It is giving some other errors. I need to test with a clean install.

util/utf8/unicodetext.o: In function `UnicodeText::PointToUTF8(char const*, int)':
/home/ubuntu/tesseract/bin/unittest/../../unittest/util/utf8/unicodetext.cc:260: undefined reference to `tensorflow::internal::LogMessage::LogMessage(char const*, int, int)'
/home/ubuntu/tesseract/bin/unittest/../../unittest/util/utf8/unicodetext.cc:260: undefined reference to `tensorflow::internal::LogMessage::~LogMessage()'
/home/ubuntu/tesseract/bin/unittest/../../unittest/util/utf8/unicodetext.cc:260: undefined reference to `tensorflow::internal::LogMessage::~LogMessage()'
util/utf8/unicodetext.o: In function `UnicodeText::push_back(int)':
/home/ubuntu/tesseract/bin/unittest/../../unittest/util/utf8/unicodetext.cc:361: undefined reference to `tensorflow::internal::LogMessage::LogMessage(char const*, int, int)'
/home/ubuntu/tesseract/bin/unittest/../../unittest/util/utf8/unicodetext.cc:366: undefined reference to `tensorflow::internal::LogMessage::~LogMessage()'
/home/ubuntu/tesseract/bin/unittest/../../unittest/util/utf8/unicodetext.cc:366: undefined reference to `tensorflow::internal::LogMessage::LogMessage(char const*, int, int)'
/home/ubuntu/tesseract/bin/unittest/../../unittest/util/utf8/unicodetext.cc:366: undefined reference to `tensorflow::internal::LogMessage::~LogMessage()'
util/utf8/unicodetext.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >* tensorflow::internal::MakeCheckOpString<char const*, char const*>(char const* const&, char const* const&, char const*)':
/usr/local/include/tensorflow/core/platform/default/logging.h:217: undefined reference to `tensorflow::internal::CheckOpMessageBuilder::CheckOpMessageBuilder(char const*)'
/usr/local/include/tensorflow/core/platform/default/logging.h:219: undefined reference to `tensorflow::internal::CheckOpMessageBuilder::ForVar2()'
/usr/local/include/tensorflow/core/platform/default/logging.h:220: undefined reference to `tensorflow::internal::CheckOpMessageBuilder::NewString[abi:cxx11]()'
/usr/local/include/tensorflow/core/platform/default/logging.h:217: undefined reference to `tensorflow::internal::CheckOpMessageBuilder::~CheckOpMessageBuilder()'
/usr/local/include/tensorflow/core/platform/default/logging.h:217: undefined reference to `tensorflow::internal::CheckOpMessageBuilder::~CheckOpMessageBuilder()'
collect2: error: ld returned 1 exit status
Makefile:1675: recipe for target 'tatweel_test' failed
make[2]: *** [tatweel_test] Error 1
make[2]: Leaving directory '/home/ubuntu/tesseract/bin/unittest'
Makefile:2592: recipe for target 'check-am' failed
@Shreeshrii

This comment has been minimized.

Copy link
Contributor Author

@Shreeshrii Shreeshrii commented Jul 8, 2019

error is related to use of LOG in /unittest/util/utf8/unicodetext.cc

I'll try after downloading the missing debian packages separately and see if it works.

@stweil

This comment has been minimized.

Copy link
Contributor

@stweil stweil commented Jul 9, 2019

I now got this linker error on a different build machine, too. It is fixed in Git master. Thanks to @jbreiden, I could add the missing ara.* files to the test submodule. So tatweel_test now runs all subtests successfully.

@Shreeshrii

This comment has been minimized.

Copy link
Contributor Author

@Shreeshrii Shreeshrii commented Jul 9, 2019

Thanks.

I removed the nightly build of tensorflow and manually installed the required packages and dependencies from debian experimental and unstable. I also updated the repo with the latest code.

 git log -1
commit e94392ef10618b7fc155dab25e5814bf70b4fe79 (HEAD -> master, origin/master, origin/HEAD)
Author: Stefan Weil <sw@weilnetz.de>
Date:   Tue Jul 9 11:48:56 2019 +0200

    Update test submodule and fix pagesegmode_test

I am now getting an error for a different program.

In file included from ../../../src/lstm/tfnetwork.h:30:0,
                 from ../../../src/lstm/network.cpp:42:
../../../src/lstm/tfnetwork.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
 #error This file was generated by an older version of protoc which is
  ^~~~~
../../../src/lstm/tfnetwork.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers.  Please
  ^~~~~
../../../src/lstm/tfnetwork.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
 #error regenerate this file with a newer version of protoc.
  ^~~~~
In file included from /usr/local/include/tensorflow/core/public/session.h:24:0,
                 from ../../../src/lstm/tfnetwork.h:32,
                 from ../../../src/lstm/network.cpp:42:
/usr/local/include/tensorflow/core/framework/tensor.h:21:10: fatal error: third_party/eigen3/unsupported/Eigen/CXX11/Tensor: No such file or directory
 #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../../src/lstm -I../.. -DNDEBUG -I../../../src/ccutil -I../../../src/cutil -I../../../src/ccstruct -I../../../src/arch -I../../../src/viewer -I../../../src/classify -I../../../src/dict -I../../../src/lstm -DINCLUDE_TENSORFLOW -I/usr/include/tensorflow -I/usr/include/leptonica -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/powerpc64le-linux-gnu/glib-2.0/include -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/powerpc64le-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -fopenmp -DTESSDATA_PREFIX=/usr/local/share -g -O2 -std=c++17 -MT recodebeam.lo -MD -MP -MF .deps/recodebeam.Tpo -c ../../../src/lstm/recodebeam.cpp  -fPIC -DPIC -o .libs/recodebeam.o
In file included from /usr/include/tensorflow/core/framework/tensor.h:19:0,
                 from /usr/include/tensorflow/core/public/session.h:24,
                 from ../../../src/lstm/tfnetwork.h:32,
                 from ../../../src/lstm/network.cpp:42:
/usr/include/tensorflow/third_party/eigen3/unsupported/Eigen/CXX11/Tensor:1:10: fatal error: unsupported/Eigen/CXX11/Tensor: No such file or directory
 #include "unsupported/Eigen/CXX11/Tensor"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/include/tensorflow/core/framework/tensor.h:19:0,
                 from /usr/include/tensorflow/core/public/session.h:24,
                 from ../../../src/lstm/tfnetwork.h:32,
                 from ../../../src/lstm/network.cpp:42:
/usr/include/tensorflow/third_party/eigen3/unsupported/Eigen/CXX11/Tensor:1:10: fatal error: unsupported/Eigen/CXX11/Tensor: No such file or directory
 #include "unsupported/Eigen/CXX11/Tensor"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:511: recipe for target 'network.lo' failed
make[1]: *** [network.lo] Error 1
make[1]: Leaving directory '/home/ubuntu/tesseract/bin/src/lstm'

The file in error seems to be there...

 ls -l /usr/include/tensorflow/third_party/eigen3/unsupported/Eigen/CXX11/Tensor
-rw-r--r-- 1 root root 420 Aug 23  2018 /usr/include/tensorflow/third_party/eigen3/unsupported/Eigen/CXX11/Tensor
@stweil

This comment has been minimized.

Copy link
Contributor

@stweil stweil commented Jul 9, 2019

The missing file is part for libtensorflow-dev:

debian@development:~/src/github/tesseract-ocr/tesseract$ ls -l /usr/include/tensorflow/unsupported/Eigen/CXX11/Tensor
-rw-r--r-- 1 root root 4400 Jun 23  2018 /usr/include/tensorflow/unsupported/Eigen/CXX11/Tensor
debian@development:~/src/github/tesseract-ocr/tesseract$ dpkg -S /usr/include/tensorflow/unsupported/Eigen/CXX11/Tensor
libtensorflow-dev:amd64: /usr/include/tensorflow/unsupported/Eigen/CXX11/Tensor
@Shreeshrii

This comment has been minimized.

Copy link
Contributor Author

@Shreeshrii Shreeshrii commented Jul 9, 2019

On my system, the file is there, but it is installed in a different subfolder.

dpkg -S /usr/include/tensorflow/third_party/eigen3/unsupported/Eigen/CXX11/Tensor
libtensorflow-dev:ppc64el: /usr/include/tensorflow/third_party/eigen3/unsupported/Eigen/CXX11/Tensor

The path mentioned by you is not found:

 dpkg -S /usr/include/tensorflow/unsupported/Eigen/CXX11/Tensor
dpkg-query: no path found matching pattern /usr/include/tensorflow/unsupported/Eigen/CXX11/Tensor

I'll create a symlink and see if that works.

@stweil

This comment has been minimized.

Copy link
Contributor

@stweil stweil commented Jul 9, 2019

That's the wrong one. The package for x86_64 includes both files:

$ ls -ld $(dpkg -L libtensorflow-dev | grep 'Tensor$')
-rw-r--r-- 1 root root  420 Aug 23  2018 /usr/include/tensorflow/third_party/eigen3/unsupported/Eigen/CXX11/Tensor
drwxr-xr-x 2 root root 4096 Mai 24 19:41 /usr/include/tensorflow/unsupported/Eigen/CXX11/src/Tensor
-rw-r--r-- 1 root root 4400 Jun 23  2018 /usr/include/tensorflow/unsupported/Eigen/CXX11/Tensor
@Shreeshrii

This comment has been minimized.

Copy link
Contributor Author

@Shreeshrii Shreeshrii commented Jul 10, 2019

@stweil I tried the following, however tesseract is failing to build.

sudo pip3 install --upgrade https://powerci.osuosl.org/job/TensorFlow_PPC64LE_CPU_Nightly_Artifact/lastSuccessfulBuild/artifact/tensorflow_pkg/tf_nightly-2.0.0.dev20190707-cp36-cp36m-linux_ppc64le.whl

sudo ln -s /usr/local/lib/python3.6/dist-packages/tensorflow_core/include/google /usr/local/include
sudo ln -s /usr/local/lib/python3.6/dist-packages/tensorflow_core/include/tensorflow /usr/local/include
sudo ln -s /usr/local/lib/python3.6/dist-packages/tensorflow_core/include/tensorflow/core/protobuf  /usr/local/include
sudo ln -s /usr/local/lib/python3.6/dist-packages/tensorflow_core/include/third_party  /usr/local/include
sudo ln -s /usr/local/lib/python3.6/dist-packages/tensorflow_core/include/unsupported  /usr/local/include
sudo ln -s /usr/local/lib/python3.6/dist-packages/tensorflow_core/include/absl  /usr/local/include
sudo ln -s /usr/local/lib/python3.6/dist-packages/tensorflow_core/include/Eigen /usr/local/include

Since tf-nightly is built with protobuf 3.8.0, it was getting an error from https://github.com/tesseract-ocr/tesseract/blob/master/src/lstm/tfnetwork.pb.h about version.

download protobuf-all-3.8.0.zip
build protobuf
protoc --version
libprotoc 3.8.0

git clone tensorflow repo

protoc --cpp_out=$PWD --proto_path=../tensorflow \
                       --proto_path=$PWD src/lstm/tfnetwork.proto

Change tfnetwork.pb.cc to use #include "tfnetwork.pb.h"

However, tesseract still doesn't build.

Making all in src/api
make[2]: Entering directory '/home/ubuntu/tesseract/bin/src/api'
/bin/bash ../../libtool  --tag=CXX   --mode=link g++  -g -O2 -std=c++17   -o tesseract tesseract-tesseractmain.o libtesseract.la -llept -fopenmp -lprotobuf -ltensorflow_cc   -lrt -lpthread
libtool: link: g++ -g -O2 -std=c++17 -o .libs/tesseract tesseract-tesseractmain.o -fopenmp  ./.libs/libtesseract.so -llept -lprotobuf -ltensorflow_cc -lrt -lpthread -fopenmp
/usr/bin/ld: cannot find -ltensorflow_cc
collect2: error: ld returned 1 exit status
Makefile:594: recipe for target 'tesseract' failed

tf nightly only had libtensorflow_framework.so.2 but that doesn't work either.

sudo ln -s /usr/local/lib/python3.6/dist-packages/tensorflow_core/libtensorflow_framework.so.2 /usr/local/lib/libtensorflow_framework.so

/bin/bash ../../libtool  --tag=CXX   --mode=link g++  -g -O2 -std=c++17   -o tesseract tesseract-tesseractmain.o libtesseract.la -llept -fopenmp -lprotobuf -ltensorflow_framework   -lrt -lpthread

ubuntu@tesseract-ocr:~/tesseract/bin$ cd src/api
ubuntu@tesseract-ocr:~/tesseract/bin/src/api$ /bin/bash ../../libtool  --tag=CXX   --mode=link g++  -g -O2 -std=c++17   -o tesseract tesseract-tesseractmain.o libtesseract.la -llept -fopenmp -lprotobuf -ltensorflow_framework   -lrt -lpthread
libtool: link: g++ -g -O2 -std=c++17 -o .libs/tesseract tesseract-tesseractmain.o -fopenmp  ./.libs/libtesseract.so -llept -lprotobuf -ltensorflow_framework -lrt -lpthread -fopenmp
./.libs/libtesseract.so: undefined reference to `tensorflow::internal::CheckOpMessageBuilder::NewString[abi:cxx11]()'
collect2: error: ld returned 1 exit status



@Shreeshrii

This comment has been minimized.

Copy link
Contributor Author

@Shreeshrii Shreeshrii commented Jul 10, 2019

Is there a way that I can disable tensorflow while building tesseract?

@stweil

This comment has been minimized.

Copy link
Contributor

@stweil stweil commented Jul 10, 2019

Yes: PATH/configure --with-tensorflow=no ....

@Shreeshrii

This comment has been minimized.

Copy link
Contributor Author

@Shreeshrii Shreeshrii commented Jul 10, 2019

@stweil

This comment has been minimized.

Copy link
Contributor

@stweil stweil commented Jul 10, 2019

Yes, you are right, thank you. Fixed now in master.

@Shreeshrii Shreeshrii changed the title tatweel_test tatweel_test - build issues on PPC64LE Jul 10, 2019
@Shreeshrii Shreeshrii changed the title tatweel_test - build issues on PPC64LE tatweel_test - build issues with tensorflow on PPC64LE Jul 24, 2019
@zdenop

This comment has been minimized.

Copy link
Contributor

@zdenop zdenop commented Oct 19, 2019

Can issue be closed?

@Shreeshrii

This comment has been minimized.

Copy link
Contributor Author

@Shreeshrii Shreeshrii commented Oct 19, 2019

@zdenop The workaround was to build with --with-tensorflow=no .

I tried to build without that just now with latest code and still get the errors.

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../../src/lstm -I../.. -O2 -DNDEBUG -I../../../src/ccutil -I../../../src/cutil -I../../../src/ccstruct -I../../../src/arch -I../../../src/viewer -I../../../src/classify -I../../../src/dict -I../../../src/lstm -DINCLUDE_TENSORFLOW -I/usr/include/tensorflow -I/usr/include/leptonica -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/powerpc64le-linux-gnu/glib-2.0/include -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/powerpc64le-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -fopenmp -DTESSDATA_PREFIX=/usr/local/share -g -O2 -std=c++17 -MT recodebeam.lo -MD -MP -MF .deps/recodebeam.Tpo -c ../../../src/lstm/recodebeam.cpp -o recodebeam.o
In file included from ../../../src/lstm/tfnetwork.h:29:0,
                 from ../../../src/lstm/network.cpp:42:
../../../src/lstm/tfnetwork.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
 #error This file was generated by an older version of protoc which is
  ^~~~~
../../../src/lstm/tfnetwork.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers.  Please
  ^~~~~
../../../src/lstm/tfnetwork.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
 #error regenerate this file with a newer version of protoc.
  ^~~~~
In file included from /usr/local/include/tensorflow/core/framework/tensor.h:22:0,
                 from /usr/local/include/tensorflow/core/public/session.h:24,
                 from ../../../src/lstm/tfnetwork.h:31,
                 from ../../../src/lstm/network.cpp:42:
/usr/local/include/tensorflow/core/framework/allocator.h:24:10: fatal error: absl/strings/string_view.h: No such file or directory
 #include "absl/strings/string_view.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:515: recipe for target 'network.lo' failed
@stweil

This comment has been minimized.

Copy link
Contributor

@stweil stweil commented Oct 19, 2019

That's strange. I just tested with configure --with-tensorflow=no, and it does not set the macro INCLUDE_TENSORFLOW. So tfnetwork.h should not be included.

@Shreeshrii

This comment has been minimized.

Copy link
Contributor Author

@Shreeshrii Shreeshrii commented Oct 19, 2019

I meant that I rebuilt just now without configure --with-tensorflow=no and got the error.

When I use configure --with-tensorflow=no it builds ok.

@Shreeshrii

This comment has been minimized.

Copy link
Contributor Author

@Shreeshrii Shreeshrii commented Oct 19, 2019

I rebuilt the files using

protoc --cpp_out=$PWD --proto_path=../tensorflow \
                       --proto_path=$PWD src/lstm/tfnetwork.proto

Now the error is:

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../../src/lstm -I../.. -O2 -DNDEBUG -I../../../src/ccutil -I../../../src/cutil -I../../../src/ccstruct -I../../../src/arch -I../../../src/viewer -I../../../src/classify -I../../../src/dict -I../../../src/lstm -DINCLUDE_TENSORFLOW -I/usr/include/tensorflow -I/usr/include/leptonica -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/powerpc64le-linux-gnu/glib-2.0/include -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/powerpc64le-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -fopenmp -DTESSDATA_PREFIX=/usr/local/share -g -O2 -std=c++17 -MT network.lo -MD -MP -MF .deps/network.Tpo -c ../../../src/lstm/network.cpp -o network.o
In file included from /usr/local/include/tensorflow/core/framework/tensor.h:22:0,
                 from /usr/local/include/tensorflow/core/public/session.h:24,
                 from ../../../src/lstm/tfnetwork.h:31,
                 from ../../../src/lstm/network.cpp:42:
/usr/local/include/tensorflow/core/framework/allocator.h:24:10: fatal error: absl/strings/string_view.h: No such file or directory
 #include "absl/strings/string_view.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:515: recipe for target 'network.lo' failed

Trying advice given in tensorflow/tensorflow#22007 (comment)

@Shreeshrii

This comment has been minimized.

Copy link
Contributor Author

@Shreeshrii Shreeshrii commented Oct 19, 2019

Back again to the following error:

libtool: link: ( cd ".libs" && rm -f "libtesseract.la" && ln -s "../libtesseract.la" "libtesseract.la" )
/bin/bash ../../libtool  --tag=CXX   --mode=link g++  -g -O2 -std=c++17   -o tesseract tesseract-tesseractmain.o libtesseract.la -llept -fopenmp -lprotobuf -ltensorflow_cc    -lrt -lpthread
libtool: link: g++ -g -O2 -std=c++17 -o tesseract tesseract-tesseractmain.o -fopenmp  ./.libs/libtesseract.a -llept -lprotobuf -ltensorflow_cc -lrt -lpthread -fopenmp
/usr/bin/ld: cannot find -ltensorflow_cc
collect2: error: ld returned 1 exit status
Makefile:600: recipe for target 'tesseract' failed

So, build issues with tensorflow on PPC64LE are still there.

@Shreeshrii Shreeshrii changed the title tatweel_test - build issues with tensorflow on PPC64LE build issues with tensorflow on PPC64LE Oct 19, 2019
@stweil

This comment has been minimized.

Copy link
Contributor

@stweil stweil commented Oct 20, 2019

As long as we don't have a TensorFlow model which works with Tesseract, the TensorFlow code in Tesseract is rather useless. I'd compile without it (unless you have such models).

@Shreeshrii

This comment has been minimized.

Copy link
Contributor Author

@Shreeshrii Shreeshrii commented Oct 21, 2019

Yes, I do compile without it.

This is not a problem with Tesseract. I will close the issue.

Thanks!

@Shreeshrii Shreeshrii closed this Oct 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.