Skip to content

Commit bb19f2c

Browse files
committed
Fixes #76 - enable OpenMP support
1 parent ae6f195 commit bb19f2c

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

api/Makefile.am

+3
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ tesseract_LDADD = libtesseract.la
8181
if USE_OPENCL
8282
tesseract_LDADD += $(OPENCL_LIB)
8383
endif
84+
if OPENMP
85+
tesseract_LDADD += $(OPENMP_CFLAGS)
86+
endif
8487

8588
if T_WIN
8689
tesseract_LDADD += -lws2_32

ccmain/par_control.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
///////////////////////////////////////////////////////////////////////
1919

2020
#include "tesseractclass.h"
21+
#ifdef OPENMP
22+
#include <omp.h>
23+
#endif // OPENMP
2124

2225
namespace tesseract {
2326

configure.ac

+9
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,15 @@ if test "$enable_embedded" = "yes"; then
166166
AC_SUBST([AM_CPPFLAGS], [-DEMBEDDED])
167167
fi
168168
169+
# check whether to build OpenMP support
170+
AC_OPENMP
171+
AS_IF([test "x$OPENMP_CFLAGS" != "x"],
172+
AM_CONDITIONAL([OPENMP], test "x$OPENMP_CFLAGS" != "x")
173+
AC_SUBST(AM_CPPFLAGS,"$OPENMP_CXXFLAGS")
174+
AC_DEFINE([OPENMP], [], [Defined when compiled with OpenMP support])
175+
)
176+
177+
169178
# check whether to build opencl version
170179
AC_MSG_CHECKING(--enable-opencl argument)
171180
AC_ARG_ENABLE([opencl],

0 commit comments

Comments
 (0)