mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-27 12:49:35 +08:00
Implement check for Tensorflow header file
This looks for one of the header files which are included by Tesseract. It currently uses a hard coded path which works for Debian / Ubuntu. Simplify also the rules for linking Tensorflow. Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
9cdf041448
commit
2441e4d8ac
16
configure.ac
16
configure.ac
@ -196,13 +196,23 @@ if test "$enable_opencl" = "yes"; then
|
||||
fi
|
||||
|
||||
# Check whether to build with support for Tensorflow.
|
||||
AC_MSG_CHECKING([--with-tensorflow])
|
||||
AC_ARG_WITH([tensorflow],
|
||||
AS_HELP_STRING([--with-tensorflow],
|
||||
[support Tensorflow @<:@default=check@:>@]),
|
||||
[], [with_tensorflow=check])
|
||||
AC_MSG_RESULT([$with_tensorflow])
|
||||
AM_CONDITIONAL([TENSORFLOW], [test "$with_tensorflow" != "no"])
|
||||
AM_CONDITIONAL([TENSORFLOW], false)
|
||||
TENSORFLOW_LIBS=
|
||||
AS_IF([test "x$with_tensorflow" != xno],
|
||||
[AC_CHECK_FILE([/usr/include/tensorflow/core/framework/graph.pb.h],
|
||||
[AC_SUBST([TENSORFLOW_LIBS], ["-lprotobuf -ltensorflow_cc"])
|
||||
AM_CONDITIONAL([TENSORFLOW], true)
|
||||
],
|
||||
[if test "x$with_tensorflow" != xcheck; then
|
||||
AC_MSG_FAILURE(
|
||||
[--with-tensorflow was given, but test for libtensorflow-dev failed])
|
||||
fi
|
||||
])
|
||||
])
|
||||
|
||||
# https://lists.apple.com/archives/unix-porting/2009/Jan/msg00026.html
|
||||
m4_define([MY_CHECK_FRAMEWORK],
|
||||
|
@ -88,6 +88,7 @@ tesseract_LDFLAGS = $(OPENCL_LDFLAGS)
|
||||
|
||||
tesseract_LDADD += $(LEPTONICA_LIBS)
|
||||
tesseract_LDADD += $(OPENMP_CXXFLAGS)
|
||||
tesseract_LDADD += $(TENSORFLOW_LIBS)
|
||||
tesseract_LDADD += $(libarchive_LIBS)
|
||||
|
||||
if T_WIN
|
||||
@ -98,8 +99,3 @@ endif
|
||||
if ADD_RT
|
||||
tesseract_LDADD += -lrt
|
||||
endif
|
||||
|
||||
if TENSORFLOW
|
||||
tesseract_LDADD += -lprotobuf
|
||||
tesseract_LDADD += -ltensorflow_cc
|
||||
endif
|
||||
|
@ -282,9 +282,7 @@ unicharset_extractor_LDADD += $(LEPTONICA_LIBS)
|
||||
wordlist2dawg_LDADD += $(LEPTONICA_LIBS)
|
||||
|
||||
extralib = $(libarchive_LIBS)
|
||||
if TENSORFLOW
|
||||
extralib += -lprotobuf -ltensorflow_cc
|
||||
endif
|
||||
extralib += $(TENSORFLOW_LIBS)
|
||||
|
||||
if !DISABLED_LEGACY_ENGINE
|
||||
ambiguous_words_LDADD += $(extralib)
|
||||
|
Loading…
Reference in New Issue
Block a user