Created attachment 237494 [details] add --without-tensorflow to CONFIGURE_ARGS By default tesseract configure checks for tensorflow. Tensorflow installed from port breaks the build of tesseract, see error messages below. The fault is in the tensorflow port, though I'm not sure how to fix that. For tesseract to build, it's enough to patch the Makefile and add CONFIGURE_ARGS+=--without-tensorflow --- src/lstm/libtesseract_lstm_la-tfnetwork.pb.lo --- In file included from src/lstm/tfnetwork.pb.cc:4: ./src/lstm/tfnetwork.pb.h:17:4: 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:4: error: incompatible with your Protocol Buffer headers. Please # error incompatible with your Protocol Buffer headers. Please ^ ./src/lstm/tfnetwork.pb.h:19:4: error: regenerate this file with a newer version of protoc. # error regenerate this file with a newer version of protoc. ^ --- src/lstm/libtesseract_lstm_la-tfnetwork.pb.lo --- ./src/lstm/tfnetwork.pb.h:25:10: fatal error: 'google/protobuf/generated_message_table_driven.h' file not found #include <google/protobuf/generated_message_table_driven.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- src/lstm/libtesseract_lstm_la-network.lo --- In file included from src/lstm/network.cpp:42: In file included from ./src/lstm/tfnetwork.h:30: In file included from /usr/local/include/tensorflow/core/public/session.h:24: /usr/local/include/tensorflow/core/framework/tensor.h:22:10: fatal error: 'third_party/eigen3/unsupported/Eigen/CXX11/Tensor' file not found #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- src/lstm/libtesseract_lstm_la-tfnetwork.lo --- In file included from src/lstm/tfnetwork.cpp:20: In file included from ./src/lstm/tfnetwork.h:30: In file included from /usr/local/include/tensorflow/core/public/session.h:24: /usr/local/include/tensorflow/core/framework/tensor.h:22:10: fatal error: 'third_party/eigen3/unsupported/Eigen/CXX11/Tensor' file not found #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Are you mixing ports and packages? Just curious. The Eigen headers should be an easy fix for the tensorflow package, but it won't resolve the generated headers issues in the tesseract package.
(In reply to Anthony Donnelly from comment #1) Everything is installed via ports here. I can see all the necessary tensorflow headers under /usr/local/lib/python3.9/site-packages/tensorflow/include but not under /usr/local/include/tensorflow which tesseract found by default. As to the protobuf headers in tesseract, I'm not sure if it's a version mismatch between tensorflow and system protobuf, or some issue within tesseract.