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

openmp: Fix build with clang++ and compilers without OpenMP support #532

Merged
merged 1 commit into from
Dec 7, 2016

Conversation

stweil
Copy link
Member

@stweil stweil commented Dec 4, 2016

Builds without support for OpenMP failed with the old code. Fix this:

  • Add OPENMP_CXXFLAGS for ccmain.
  • Replace unconditional -fopenmp by OPENMP_CXXFLAGS for lstm.
  • Always use _OPENMP for conditional compilation.
  • Remove OPENMP as there is already _OPENMP.
  • Include omp.h conditionally.

Signed-off-by: Stefan Weil [email protected]

Builds without support for OpenMP failed with the old code. Fix this:

* Add OPENMP_CXXFLAGS for ccmain.
* Replace unconditional -fopenmp by OPENMP_CXXFLAGS for lstm.
* Always use _OPENMP for conditional compilation.
* Remove OPENMP as there is already _OPENMP.
* Include omp.h conditionally.

Signed-off-by: Stefan Weil <[email protected]>
@stweil
Copy link
Member Author

stweil commented Dec 4, 2016

I tested these three test cases on Debian GNU Linux:

  • default configure && make (OpenMP supported, wrong compiler options for ccmain/par_control.cpp without PR?)
  • configure --disable-openmp && make (OpenMP disabled, bad build without PR)
  • configure CXX=clang++-3.8 && make (OpenMP unsupported, build fails without PR)

Please review and test.

@zdenop zdenop merged commit 7f7cea1 into tesseract-ocr:master Dec 7, 2016
@stweil stweil deleted the openmp branch December 7, 2016 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants