Closed JeanAzzopardi closed 8 years ago
Hi @JeanAzzopardi,
Does this file exist?
/Users/jeaz/Testing/PersonalTests/openalpr-ios/output/leptonica.framework/leptonica
Also, is there anything in this folder?
/Users/jeaz/Testing/PersonalTests/openalpr-ios/work/leptonica-thin-lib/iPhoneOS-armv7
Hi,
Yes, the leptonica file exists:
ls -lah /Users/jeaz/Testing/PersonalTests/openalpr-ios/output/leptonica.framework
total 35912
drwxr-xr-x 6 jeaz --- 204B Nov 11 18:28 .
drwxr-xr-x 5 jeaz --- 170B Nov 11 18:28 ..
drwxr-xr-x 3 jeaz --- 102B Nov 11 18:27 Headers
-rw-r--r-- 1 jeaz --- 580B Nov 11 18:28 Info.plist
-rw-r--r-- 1 jeaz --- 18M Nov 11 18:28 leptonica
lrwxr-xr-x 1 jeaz --- 9B Nov 11 18:28 liblept.a -> leptonica
Also:
ls -la /Users/jeaz/Testing/PersonalTests/openalpr-ios/work/leptonica-thin-lib/iPhoneOS-armv7
total 6664
drwxr-xr-x 3 jeaz --- 102 Nov 11 11:14 .
drwxr-xr-x 7 jeaz --- 238 Nov 11 11:14 ..
-rw-r--r-- 1 jeaz --- 3409888 Nov 11 11:14 liblept.a
Hmm, that is odd. :)
Tesseract is complaining that the leptonica library is not there, but it seems to be. Do you mind attaching this log file?
/Users/jeaz/Testing/PersonalTests/openalpr-ios/work/tesseract-3.03/config.log
Ah, I found the issue, tesseract's configure script expects leptonica's location to be passed through an environment variable.
For now I've done a quick hack:
env = {
'SDKROOT' => sdk_root,
'CXX' => CXX,
'CC' => CC,
'LD' => LD,
'AS' => AS,
'AR' => AR,
'NM' => NM,
'RANLIB' => RANLIB,
'LDFLAGS' => ldflags,
'CFLAGS' => cflags,
'CPPFLAGS' => cflags,
'CXXFLAGS' => cflags,
'PATH' => "#{XCODETOOLCHAIN}/usr/bin:#{ENV['PATH']}",
'LIBLEPT_HEADERSDIR' => '/Users/jeanazzopardi/software/openalpr-ios/output/leptonica.framework/Headers'
}
in automake.rb Using this method, tesseract is compiling as we speak.
Hi @JeanAzzopardi,
Usage of LIBLEPT_HEADERSDIR
should not be required, as the ruby script passes a separate include directive in the CFLAGS
, CPPFLAGS
and CXXFLAGS
with this same path. Here's the relevant part from the build.log line you included in the original comment:
-I/Users/jeaz/Testing/PersonalTests/openalpr-ios/output/leptonica.framework/Headers
I also noticed that the most recent comment above, the path is now /Users/jeanazzopardi/....
instead of /Users/jeaz
. Could that maybe have contributed to the script not finding leptonica previously?
@twelve17 I'm on a different computer - that's why I have a different username - however, I had the same issue on this one.
I realize that you are passing it as an include directive, however the configure script explicitly seems to want it as an environment variable. Perhaps it worked for you because you had it installed system wide?
@JeanAzzopardi , you were absolutely correct! I had leptonica installed via homebrew on my system. I've pushed a code change to include LIBLEPT_HEADERSDIR. Give it a shot and see if it works for you. Thanks!
@twelve17 This worked perfectly, thanks! Got the sample app running in the simulator as well!
I also created a pull request with some additional gems that were required by the build script.
Also, many thanks for the revamp :)
Hi @JeanAzzopardi - thanks for the PR and for testing the fix. Very glad the sample app worked too!
@twelve17 No problem, this is very useful for a pet project of mine :) I wonder if it's possible to get this in a cocoapod or carthage though, any ideas how this could ever be done?
@JeanAzzopardi I'm sure it's possible. :) I'm not familiar with building either. I believe opencv 3.x needs to get into cocoapods before it can be done. As far as Carthage is concerned, I am building alpr via xcodebuild so I suppose it should be doable there too.
Another challenge will be how to build a dynamic framework, which I ran into a lot of headaches trying to do. Either the linker couldn't find the secondary alpr libraries, or when it did, it couldn't load them for unexplained reasons (the errors were vague).
Hi, I have similar problem i cannot resolve
openalpr-ios michal$ bundle exec ./bin/build_frameworks.rb
options: {}
Package opencv2 is already installed. Skipping build.
Package leptonica is already installed. Skipping build.
Building tesseract for armv7 from /Users/michal/src/openalpr-ios/work/tesseract-3.03
make: *** No rule to make target `clean'. Stop.
make: *** No rule to make target `distclean'. Stop.
/Users/michal/src/openalpr-ios/lib/alpr/utils.rb:44:in `execute': Child returned: pid 85645 exit 1 (RuntimeError)
from /Users/michal/src/openalpr-ios/lib/alpr/utils.rb:74:in `log_execute'
from /Users/michal/src/openalpr-ios/lib/alpr/package/automake.rb:141:in `do_autoconf_build'
from /Users/michal/src/openalpr-ios/lib/alpr/package/automake.rb:58:in `build_arch'
from /Users/michal/src/openalpr-ios/lib/alpr/package/base.rb:53:in `block in install'
from /Users/michal/src/openalpr-ios/lib/alpr/package/base.rb:52:in `each'
from /Users/michal/src/openalpr-ios/lib/alpr/package/base.rb:52:in `install'
from ./bin/build_frameworks.rb:76:in `<main>'
What I can see in work/tesseract-3.03/config.log file is:
ld: in /Users/michal/src/openalpr-ios/output/leptonica.framework//liblept.a(pix1.o), building for OSX, but linking in object file built for iOS, for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is work/build.log:
Executing: SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk' CXX='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++' CC='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc' LD='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld' AS='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/as' AR='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar' NM='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm' RANLIB='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib' LDFLAGS='-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/lib/ -L/Users/michal/src/openalpr-ios/work/leptonica-thin-lib/iPhoneOS-armv7' CFLAGS='-arch armv7 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -miphoneos-version-min=9.0 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/ -I/Users/michal/src/openalpr-ios/output/leptonica.framework/Headers' CPPFLAGS='-arch armv7 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -miphoneos-version-min=9.0 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/ -I/Users/michal/src/openalpr-ios/output/leptonica.framework/Headers' CXXFLAGS='-arch armv7 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -miphoneos-version-min=9.0 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/include/ -I/Users/michal/src/openalpr-ios/output/leptonica.framework/Headers' PATH='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Users/michal/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bin:/Users/michal/.rbenv/versions/2.1.2/bin:/usr/local/Cellar/rbenv/0.4.0/libexec:/Users/michal/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/CrossPack-AVR/bin' BUILD_HOST_NAME='arm-apple-darwin7' LIBLEPT_HEADERSDIR='/Users/michal/src/openalpr-ios/output/leptonica.framework/Headers' bash autogen.sh 2>&1
=======================================================================
Running aclocal
Something went wrong, bailing out!
@forecodema - do you have a system leptonica lib installed elsewhere?
I think there is no other leptonica on my system:
michal$ brew unlink leptonica
Error: No such keg: /usr/local/Cellar/leptonica
michal$ brew unlink tesseract
Error: No such keg: /usr/local/Cellar/tesseract
Strange - reinstalling autoconf and automake as follows did the trick.
$brew remove autoconf
$brew remove automake
$brew cleanup && brew prune
$brew install automake
I got nothin'. :)
Hi, thanks for updating the repository! I've tried to run the build script, however I have the following issue:
This is the last line from the build log:
Now, I've checked this folder:
/Users/jeaz/Testing/PersonalTests/openalpr-ios/output/leptonica.framework/Headers
and inside there is a folder calledleptonica
with the following files:Any idea what it could be please?