Permalink
Browse files

Add solution for OS X (clang)

  • Loading branch information...
Inndy committed Feb 21, 2015
1 parent 409cd9d commit 5d7afa423fe9364c90f6a407407184ff2189b101
Showing with 26 additions and 0 deletions.
  1. +4 −0 README.md
  2. +22 −0 README_OSX.md
View
@@ -59,3 +59,7 @@ You can also generate training data using ocropus-linegen:
This will create a directory "linegen/..." containing training data
suitable for training OCRopus with synthetic data.
+
+## Solution for clang
+
+[Read README_OSX.md](README_OSX.md)
View
@@ -0,0 +1,22 @@
+# Patch for OSX (clang)
+
+The compile flag `-fopenmp` doesn't work for clang,
+so if your `gcc` is link to `clang` you might need to take solutions below:
+
+1. Install `gcc` and make sure `gcc` in `$PATH` is point to real `gcc`,
+ not `clang`.
+2. If you don't have `gcc` installed, apply patch below to change compile flag.
+
+``` diff
+--- ocrolib/native.py 2015-02-21 13:34:52.000000000 +0800
++++ ocrolib_osx/native.py 2015-02-21 15:29:56.000000000 +0800
+@@ -41,7 +41,7 @@
+ pass
+
+ def compile_and_find(c_string,prefix=".pynative",opt="-g -O4",libs="-lm",
+- options="-shared -fopenmp -std=c99 -fPIC",verbose=0):
++ options="-shared -openmp -std=c99 -fPIC",verbose=0):
+ if not os.path.exists(prefix):
+ os.mkdir(prefix)
+ m = hashlib.md5()
+```

0 comments on commit 5d7afa4

Please sign in to comment.