summaryrefslogtreecommitdiff
blob: d07fb58157fe6bedd6414d594dd208f9e5ebfdd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
Backport from upstream 6140be6a5575e9159e3678adf4ee9e673b3ff2cc

diff -Naur tesseract-4.00.00alpha.orig/api/Makefile.am tesseract-4.00.00alpha/api/Makefile.am
--- tesseract-4.00.00alpha.orig/api/Makefile.am	2016-11-08 00:38:07.000000000 +0100
+++ tesseract-4.00.00alpha/api/Makefile.am	2017-01-26 10:27:59.269712914 +0100
@@ -88,9 +88,7 @@
 
 tesseract_LDFLAGS = $(OPENCL_LDFLAGS)
 
-if OPENMP
 tesseract_LDADD += $(OPENMP_CFLAGS)
-endif
 
 if T_WIN
 tesseract_LDADD += -lws2_32
@@ -99,4 +97,3 @@
 if ADD_RT
 tesseract_LDADD += -lrt
 endif
-
diff -Naur tesseract-4.00.00alpha.orig/ccmain/Makefile.am tesseract-4.00.00alpha/ccmain/Makefile.am
--- tesseract-4.00.00alpha.orig/ccmain/Makefile.am	2016-11-08 00:38:07.000000000 +0100
+++ tesseract-4.00.00alpha/ccmain/Makefile.am	2017-01-26 10:27:59.269712914 +0100
@@ -8,6 +8,7 @@
     -I$(top_srcdir)/textord -I$(top_srcdir)/opencl
 
 AM_CPPFLAGS += $(OPENCL_CPPFLAGS)
+AM_CPPFLAGS += $(OPENMP_CXXFLAGS)
 
 if VISIBILITY
 AM_CPPFLAGS += -DTESS_EXPORTS \
diff -Naur tesseract-4.00.00alpha.orig/ccmain/par_control.cpp tesseract-4.00.00alpha/ccmain/par_control.cpp
--- tesseract-4.00.00alpha.orig/ccmain/par_control.cpp	2016-11-08 00:38:07.000000000 +0100
+++ tesseract-4.00.00alpha/ccmain/par_control.cpp	2017-01-26 10:27:59.269712914 +0100
@@ -18,9 +18,9 @@
 ///////////////////////////////////////////////////////////////////////
 
 #include "tesseractclass.h"
-#ifdef OPENMP
+#ifdef _OPENMP
 #include <omp.h>
-#endif  // OPENMP
+#endif // _OPENMP
 
 namespace tesseract {
 
@@ -53,7 +53,9 @@
   }
   // Pre-classify all the blobs.
   if (tessedit_parallelize > 1) {
+#ifdef _OPENMP
     #pragma omp parallel for num_threads(10)
+#endif // _OPENMP
     for (int b = 0; b < blobs.size(); ++b) {
       *blobs[b].choices =
           blobs[b].tesseract->classify_blob(blobs[b].blob, "par", White, NULL);
diff -Naur tesseract-4.00.00alpha.orig/configure.ac tesseract-4.00.00alpha/configure.ac
--- tesseract-4.00.00alpha.orig/configure.ac	2016-11-08 00:38:07.000000000 +0100
+++ tesseract-4.00.00alpha/configure.ac	2017-01-26 10:28:45.636688839 +0100
@@ -170,14 +170,7 @@
 fi
 
 # check whether to build OpenMP support
-AM_CONDITIONAL([OPENMP], false)
 AC_OPENMP
-AS_IF([test "x$OPENMP_CFLAGS" != "x"],
-  [AM_CONDITIONAL([OPENMP], true)
-   AC_SUBST([AM_CPPFLAGS], ["$OPENMP_CXXFLAGS"])
-   AC_DEFINE([OPENMP], [], [Defined when compiled with OpenMP support])]
-)
-
 
 # check whether to build opencl version
 AC_MSG_CHECKING([--enable-opencl argument])
diff -Naur tesseract-4.00.00alpha.orig/lstm/lstm.cpp tesseract-4.00.00alpha/lstm/lstm.cpp
--- tesseract-4.00.00alpha.orig/lstm/lstm.cpp	2016-11-08 00:38:07.000000000 +0100
+++ tesseract-4.00.00alpha/lstm/lstm.cpp	2017-01-26 10:27:59.269712914 +0100
@@ -18,7 +18,7 @@
 
 #include "lstm.h"
 
-#ifndef ANDROID_BUILD
+#ifdef _OPENMP
 #include <omp.h>
 #endif
 #include <stdio.h>
diff -Naur tesseract-4.00.00alpha.orig/lstm/Makefile.am tesseract-4.00.00alpha/lstm/Makefile.am
--- tesseract-4.00.00alpha.orig/lstm/Makefile.am	2016-11-08 00:38:07.000000000 +0100
+++ tesseract-4.00.00alpha/lstm/Makefile.am	2017-01-26 10:27:59.269712914 +0100
@@ -4,7 +4,7 @@
     -I$(top_srcdir)/dict -I$(top_srcdir)/lstm
 AUTOMAKE_OPTIONS = subdir-objects
 SUBDIRS =
-AM_CXXFLAGS = -fopenmp
+AM_CXXFLAGS = $(OPENMP_CXXFLAGS)
 
 if !NO_TESSDATA_PREFIX
 AM_CXXFLAGS += -DTESSDATA_PREFIX=@datadir@/
diff -Naur tesseract-4.00.00alpha.orig/lstm/parallel.cpp tesseract-4.00.00alpha/lstm/parallel.cpp
--- tesseract-4.00.00alpha.orig/lstm/parallel.cpp	2016-11-08 00:38:07.000000000 +0100
+++ tesseract-4.00.00alpha/lstm/parallel.cpp	2017-01-26 10:27:59.269712914 +0100
@@ -18,7 +18,9 @@
 
 #include "parallel.h"
 
+#ifdef _OPENMP
 #include <omp.h>
+#endif
 
 #include "functions.h"  // For conditional undef of _OPENMP.
 #include "networkscratch.h"