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

compilation error #52

Open
Ndshah82 opened this issue Sep 8, 2015 · 2 comments
Open

compilation error #52

Ndshah82 opened this issue Sep 8, 2015 · 2 comments

Comments

@Ndshah82
Copy link

Ndshah82 commented Sep 8, 2015

I'm running into compilation errors when using the tesseract-ocr gem on my heroku ruby environment. My ruby version is 2.2.2 and ubuntu version is 14.04. Can you shed some light on how to resolve this issue?

Here is the tesseract buildpack I am using:
https://github.com/matteotiziano/heroku-buildpack-tesseract

Here is a snapshot of my tesseract version:

tesseract: /app/vendor/tesseract-ocr/lib/libtiff.so.5: no version information available (required by /app/vendor/tesseract-ocr/lib/liblept.so.4)
tesseract 3.03
leptonica-1.70
libgif 4.1.6(?) : libjpeg 8d : libpng 1.2.50 : libtiff 4.0.3 : zlib 1.2.8 : webp 0.4.0

Here is a snapshot of my error logs:
2015-09-08T17:14:01.370398+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/ffi-inline-0.0.4.3/lib/ffi/inline/compilers/gcc.rb:35:in compile': compile error: see logs at /tmp/.ffi-inline-4045/3cdb4edaddbba892937d7cffd2d6b0edeadc3d5a.log (CompilationError) 2015-09-08T17:14:01.370416+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/ffi-inline-0.0.4.3/lib/ffi/inline/builders/c.rb:114:inshared_object'
2015-09-08T17:14:01.370418+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/ffi-inline-0.0.4.3/lib/ffi/inline/builders.rb:90:in block in build' 2015-09-08T17:14:01.370422+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/ffi-inline-0.0.4.3/lib/ffi/inline/builders.rb:87:ininstance_eval'
2015-09-08T17:14:01.370423+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/ffi-inline-0.0.4.3/lib/ffi/inline/builders.rb:87:in build' 2015-09-08T17:14:01.370424+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/ffi-inline-0.0.4.3/lib/ffi/inline/inline.rb:54:insingleton_inline'
2015-09-08T17:14:01.370425+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/ffi-inline-0.0.4.3/lib/ffi/inline/inline.rb:39:in inline' 2015-09-08T17:14:01.370427+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/tesseract-ocr-0.1.7/lib/tesseract/c.rb:34:inmodule:C'
2015-09-08T17:14:01.370428+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/tesseract-ocr-0.1.7/lib/tesseract/c.rb:31:in <module:Tesseract>' 2015-09-08T17:14:01.370429+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/tesseract-ocr-0.1.7/lib/tesseract/c.rb:29:in<top (required)>'
2015-09-08T17:14:01.370430+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/tesseract-ocr-0.1.7/lib/tesseract/api.rb:26:in require' 2015-09-08T17:14:01.370433+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/tesseract-ocr-0.1.7/lib/tesseract/api.rb:26:in<top (required)>'
2015-09-08T17:14:01.370434+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/tesseract-ocr-0.1.7/lib/tesseract-ocr.rb:35:in require' 2015-09-08T17:14:01.370435+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/tesseract-ocr-0.1.7/lib/tesseract-ocr.rb:35:in<top (required)>'
2015-09-08T17:14:01.370436+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:76:in require' 2015-09-08T17:14:01.370437+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:76:inblock (2 levels) in require'
2015-09-08T17:14:01.370440+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:72:in each' 2015-09-08T17:14:01.370441+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:72:inblock in require'
2015-09-08T17:14:01.370442+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:61:in each' 2015-09-08T17:14:01.370445+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:61:inrequire'
2015-09-08T17:14:01.370446+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler.rb:134:in require' 2015-09-08T17:14:01.370449+00:00 app[web.1]: from /app/config.ru:5:inblock in

'
2015-09-08T17:14:01.370452+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in instance_eval' 2015-09-08T17:14:01.370455+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:ininitialize'
2015-09-08T17:14:01.370458+00:00 app[web.1]: from /app/config.ru:in new' 2015-09-08T17:14:01.370460+00:00 app[web.1]: from /app/config.ru:in'
2015-09-08T17:14:01.370463+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in eval' 2015-09-08T17:14:01.370466+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:innew_from_string'
2015-09-08T17:14:01.370469+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in parse_file' 2015-09-08T17:14:01.370473+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:299:inbuild_app_and_options_from_config'
2015-09-08T17:14:01.370474+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:208:in app' 2015-09-08T17:14:01.370476+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:336:inwrapped_app'
2015-09-08T17:14:01.370479+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:272:in start' 2015-09-08T17:14:01.370482+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:147:instart'
2015-09-08T17:14:01.370485+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/bin/rackup:4:in <top (required)>' 2015-09-08T17:14:01.370573+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/bin/rackup:23:inload'
2015-09-08T17:14:01.370575+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/bin/rackup:23:in `'
2015-09-08T17:14:02.341851+00:00 heroku[web.1]: Process exited with status 1
2015-09-08T17:14:02.364725+00:00 heroku[web.1]: State changed from starting to crashed

@jvarsoke
Copy link

I also have the same problem:
(versioning, errors and error-file follow).

Ruby: ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]

Setting up libopenjp2-7:amd64 (2.1.0-2.1) ...
Setting up liblept4 (1.72-3) ...
Setting up libleptonica-dev (1.72-3) ...
Setting up libtesseract3 (3.04.00-5+b1) ...
Setting up libtesseract-dev (3.04.00-5+b1) ...
Processing triggers for libc-bin (2.19-20) ...

sudo gem install tesseract-ocr

Fetching: refining-0.0.5.5.gem (100%)
Successfully installed refining-0.0.5.5
Fetching: call-me-0.0.2.3.gem (100%)
Successfully installed call-me-0.0.2.3
Fetching: iso-639-0.2.5.gem (100%)
Successfully installed iso-639-0.2.5
Fetching: ffi-extra-0.1.0.gem (100%)
Successfully installed ffi-extra-0.1.0
Fetching: ffi-inline-0.0.4.3.gem (100%)
Successfully installed ffi-inline-0.0.4.3
Fetching: tesseract-ocr-0.1.8.gem (100%)
Successfully installed tesseract-ocr-0.1.8
Parsing documentation for call-me-0.0.2.3
Installing ri documentation for call-me-0.0.2.3
Parsing documentation for ffi-extra-0.1.0
Installing ri documentation for ffi-extra-0.1.0
Parsing documentation for ffi-inline-0.0.4.3
Installing ri documentation for ffi-inline-0.0.4.3
Parsing documentation for iso-639-0.2.5
Installing ri documentation for iso-639-0.2.5
Parsing documentation for refining-0.0.5.5
Installing ri documentation for refining-0.0.5.5
Parsing documentation for tesseract-ocr-0.1.8
Installing ri documentation for tesseract-ocr-0.1.8
Done installing documentation for call-me, ffi-extra, ffi-inline, iso-639, refining, tesseract-ocr after 1 seconds
6 gems installed

% tesseract.rb -h
/var/lib/gems/2.1.0/gems/ffi-inline-0.0.4.3/lib/ffi/inline/compilers/gcc.rb:35:in compile': compile error: see logs at /tmp/.ffi-inline-1000/3d702cf4f51902a978aedfd62b0e04b75d8512ea.log (CompilationError) from /var/lib/gems/2.1.0/gems/ffi-inline-0.0.4.3/lib/ffi/inline/builders/c.rb:114:inshared_object'
from /var/lib/gems/2.1.0/gems/ffi-inline-0.0.4.3/lib/ffi/inline/builders.rb:90:in block in build' from /var/lib/gems/2.1.0/gems/ffi-inline-0.0.4.3/lib/ffi/inline/builders.rb:87:ininstance_eval'
from /var/lib/gems/2.1.0/gems/ffi-inline-0.0.4.3/lib/ffi/inline/builders.rb:87:in build' from /var/lib/gems/2.1.0/gems/ffi-inline-0.0.4.3/lib/ffi/inline/inline.rb:54:insingleton_inline'
from /var/lib/gems/2.1.0/gems/ffi-inline-0.0.4.3/lib/ffi/inline/inline.rb:39:in inline' from /var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb:30:inmodule:BaseAPI'
from /var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb:27:in <module:C>' from /var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb:25:inmodule:Tesseract'
from /var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb:25:in <top (required)>' from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require' from /var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/lib/tesseract/c.rb:89:in<top (required)>'
from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/lib/tesseract/api.rb:26:in <top (required)>' from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require' from /var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/lib/tesseract-ocr.rb:35:in<top (required)>'
from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/lib/tesseract.rb:25:in <top (required)>' from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require' from /var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/bin/tesseract.rb:3:in<top (required)>'
from /usr/local/bin/tesseract.rb:23:in load' from /usr/local/bin/tesseract.rb:23:in

'

cat /tmp/.ffi-inline-1000/3d702cf4f51902a978aedfd62b0e04b75d8512ea.log
g++ -shared -fPIC -o /tmp/.ffi-inline-1000/3d702cf4f51902a978aedfd62b0e04b75d8512ea.so /tmp/.ffi-inline-1000/3d702cf4f51902a978aedfd62b0e04b75d8512ea.cpp -ltesseract 2>>/tmp/.ffi-inline-1000/3d702cf4f51902a978aedfd62b0e04b75d8512ea.log
/var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb: In function ‘void set_image(tesseract::TessBaseAPI_, const Pix_)’:
/var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb:171:22: error: invalid conversion from ‘const Pix_’ to ‘Pix_’ [-fpermissive]
api->SetImage(pix);
^
In file included from /tmp/.ffi-inline-1000/3d702cf4f51902a978aedfd62b0e04b75d8512ea.cpp:1:0:
/usr/include/tesseract/baseapi.h:354:8: note: initializing argument 1 of ‘void tesseract::TessBaseAPI::SetImage(Pix_)’
void SetImage(Pix_ pix);
^
/var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb: In function ‘bool process_pages(tesseract::TessBaseAPI_, const char_, STRING_)’:
/var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb:183:55: error: no matching function for call to ‘tesseract::TessBaseAPI::ProcessPages(const char_&, NULL, int, STRING_&)’
return api->ProcessPages(filename, NULL, 0, output);
^
In file included from /tmp/.ffi-inline-1000/3d702cf4f51902a978aedfd62b0e04b75d8512ea.cpp:1:0:
/usr/include/tesseract/baseapi.h:541:8: note: candidate: bool tesseract::TessBaseAPI::ProcessPages(const char_, const char_, int, tesseract::TessResultRenderer_)
bool ProcessPages(const char* filename, const char* retry_config,
^
/usr/include/tesseract/baseapi.h:541:8: note: no known conversion for argument 4 from ‘STRING_’ to ‘tesseract::TessResultRenderer_’
/var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb: In function ‘bool process_page(tesseract::TessBaseAPI_, Pix_, int, const char_, STRING_)’:
/var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb:189:71: error: no matching function for call to ‘tesseract::TessBaseAPI::ProcessPage(Pix_&, int&, const char_&, NULL, int, STRING_&)’
return api->ProcessPage(pix, page_index, filename, NULL, 0, output);
^
In file included from /tmp/.ffi-inline-1000/3d702cf4f51902a978aedfd62b0e04b75d8512ea.cpp:1:0:
/usr/include/tesseract/baseapi.h:556:8: note: candidate: bool tesseract::TessBaseAPI::ProcessPage(Pix_, int, const char_, const char_, int, tesseract::TessResultRenderer_)
bool ProcessPage(Pix_ pix, int page_index, const char* filename,
^
/usr/include/tesseract/baseapi.h:556:8: note: no known conversion for argument 6 from ‘STRING_’ to ‘tesseract::TessResultRenderer_’
g++ -shared -fPIC -o /tmp/.ffi-inline-1000/3d702cf4f51902a978aedfd62b0e04b75d8512ea.so /tmp/.ffi-inline-1000/3d702cf4f51902a978aedfd62b0e04b75d8512ea.cpp -ltesseract 2>>/tmp/.ffi-inline-1000/3d702cf4f51902a978aedfd62b0e04b75d8512ea.log
/var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb: In function ‘void set_image(tesseract::TessBaseAPI_, const Pix_)’:
/var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb:171:22: error: invalid conversion from ‘const Pix_’ to ‘Pix_’ [-fpermissive]
api->SetImage(pix);
^
In file included from /tmp/.ffi-inline-1000/3d702cf4f51902a978aedfd62b0e04b75d8512ea.cpp:1:0:
/usr/include/tesseract/baseapi.h:354:8: note: initializing argument 1 of ‘void tesseract::TessBaseAPI::SetImage(Pix_)’
void SetImage(Pix_ pix);
^
/var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb: In function ‘bool process_pages(tesseract::TessBaseAPI_, const char_, STRING_)’:
/var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb:183:55: error: no matching function for call to ‘tesseract::TessBaseAPI::ProcessPages(const char_&, NULL, int, STRING_&)’
return api->ProcessPages(filename, NULL, 0, output);
^
In file included from /tmp/.ffi-inline-1000/3d702cf4f51902a978aedfd62b0e04b75d8512ea.cpp:1:0:
/usr/include/tesseract/baseapi.h:541:8: note: candidate: bool tesseract::TessBaseAPI::ProcessPages(const char_, const char_, int, tesseract::TessResultRenderer_)
bool ProcessPages(const char* filename, const char* retry_config,
^
/usr/include/tesseract/baseapi.h:541:8: note: no known conversion for argument 4 from ‘STRING_’ to ‘tesseract::TessResultRenderer_’
/var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb: In function ‘bool process_page(tesseract::TessBaseAPI_, Pix_, int, const char_, STRING_)’:
/var/lib/gems/2.1.0/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb:189:71: error: no matching function for call to ‘tesseract::TessBaseAPI::ProcessPage(Pix_&, int&, const char_&, NULL, int, STRING_&)’
return api->ProcessPage(pix, page_index, filename, NULL, 0, output);
^
In file included from /tmp/.ffi-inline-1000/3d702cf4f51902a978aedfd62b0e04b75d8512ea.cpp:1:0:
/usr/include/tesseract/baseapi.h:556:8: note: candidate: bool tesseract::TessBaseAPI::ProcessPage(Pix_, int, const char_, const char_, int, tesseract::TessResultRenderer_)
bool ProcessPage(Pix_ pix, int page_index, const char* filename,
^
/usr/include/tesseract/baseapi.h:556:8: note: no known conversion for argument 6 from ‘STRING_’ to ‘tesseract::TessResultRenderer_’

@cxhartmann
Copy link

I found a fix for an instance of this compilation error which may help here. Details in another thread #50 (comment)

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

No branches or pull requests

3 participants