Skip to content

Opencv3.2 text module build failed in macOS10.12 #920

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

Open
logic1988 opened this issue Dec 26, 2016 · 9 comments
Open

Opencv3.2 text module build failed in macOS10.12 #920

logic1988 opened this issue Dec 26, 2016 · 9 comments

Comments

@logic1988
Copy link
Contributor

I have encountered the following problems:
/Users/logic/Desktop/opencv_contrib/modules/text/src/precomp.hpp:51:10: 'tesseract/baseapi.h' file not found
The cmake file seems no path configuration for tesseract. Manually add tesseract search path, the problem solved.

@alalek
Copy link
Member

alalek commented Dec 26, 2016

Please add failed command line. For "makefile" generator you can use make VERBOSE=1 command.

@karterotte
Copy link

karterotte commented Jan 3, 2017

I tried to build opencv on my mac(sierra:10.12)
the cmaker command like this:

cmake -D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=/usr/local
-D OPENCV_EXTRA_MODULES_PATH=/Users/.../opencv_contrib/modules
-D PYTHON2_LIBRARY=/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
-D PYTHON2_INCLUDE_DIR=/System/Library/Frameworks/Python.framework/Versions/2.7/lib
-D PYTHON2_EXECUTABLE=$VIRTUAL_ENV/bin/python
-D BUILD_opencv_python2=ON
-D BUILD_opencv_python3=OFF
-D INSTALL_PYTHON_EXAMPLES=ON
-D INSTALL_C_EXAMPLES=OFF
-D BUILD_EXAMPLES=ON ..

and when i tried make -j4 ,it would report this error when the process scrolled to [62%]

In file included from /Users/.../opencv_contrib/modules/text/src/ocr_beamsearch_decoder.cpp:43:
/Users/.../opencv_contrib/modules/text/src/precomp.hpp:51:10: fatal error: 'tesseract/baseapi.h' file not found

both opencv and opencv_contrib(7238cd2) are master branch

this is my tesseract version:

tesseract 3.04.01
leptonica-1.74
libjpeg 8d : libpng 1.6.27 : libtiff 4.0.7 : zlib 1.2.8

@alalek
Copy link
Member

alalek commented Jan 3, 2017

@karterotte Try to add -DENABLE_PRECOMPILED_HEADERS=OFF CMake option. Or disable "text" module via -DBUILD_opencv_text=OFF.

@karterotte
Copy link

thanks. It works!

@timotheecour
Copy link

timotheecour commented Jun 21, 2018

@alalek adding -DENABLE_PRECOMPILED_HEADERS=OFF didn't work
-DBUILD_opencv_text=OFF did work but obviously not a good solution

@malasang
Copy link

@karterotte Try to add -DENABLE_PRECOMPILED_HEADERS=OFF CMake option. Or disable test module via -DBUILD_opencv_text=OFF.

set opencv_text off,thx

@wu-yy
Copy link

wu-yy commented Feb 26, 2019

also, I add -DENABLE_PRECOMPILED_HEADERS=OFF \ -DBUILD_opencv_text=OFF when cmake. It works!

@miteshparmar1
Copy link

miteshparmar1 commented Mar 5, 2019

Did the above:

cmake -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
    -D PYTHON3_LIBRARY=`python -c 'import subprocess ; import sys ; s = subprocess.check_output("python-config --configdir", shell=True).decode("utf-8").strip() ; (M, m) = sys.version_info[:2] ; print("{}/libpython{}.{}.dylib".format(s, M, m))'` \
    -D PYTHON3_INCLUDE_DIR=`python -c 'import distutils.sysconfig as s; print(s.get_python_inc())'` \
    -D PYTHON3_EXECUTABLE=$VIRTUAL_ENV/bin/python \
    -D BUILD_opencv_python2=OFF \
    -D BUILD_opencv_python3=ON \
    -D INSTALL_PYTHON_EXAMPLES=ON \
    -D INSTALL_C_EXAMPLES=OFF \
    -D OPENCV_ENABLE_NONFREE=ON \
    -D BUILD_EXAMPLES=ON \
    -D ENABLE_PRECOMPILED_HEADERS=OFF \
    -D BUILD_opencv_text=OFF ..

But now fails at 86%:
[ 86%] Linking CXX executable ../../bin/example_tutorial_core_various
[ 86%] Built target example_tutorial_core_various
make: *** [all] Error 2

@native-api
Copy link

As per #2056 (comment), this turned out to have already been fixed in master and 3.4. So this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants