Compiling 0.4 on OSX 10.4

19 views
Skip to first unread message

Trimble

unread,
Jun 6, 2009, 2:41:37 PM6/6/09
to ocropus
I am trying ocropus 0.4 on OSX 10.4.11. It doesn't compile.
I can compile ocropus 0.3 (with several osx-specific patches)
just fine. I have libpng, libtiff, libjpeg, iulib, and imagemagick.

Is this just another missing dependency?

$ ./build --with-tesseract=/usr/local --without-leptonica
<snip>
# please run make now
$ make
Making all in .
if g++ -DPACKAGE_NAME=\"ocropus\" -DPACKAGE_TARNAME=\"ocropus\" -
DPACKAGE_VERSION=\"0.3\" -DPACKAGE_STRING=\"ocropus\ 0.3\" -
DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"ocropus\" -DVERSION=\"0.3\" -
DSTDC_HEADERS=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_SYS_TYPES_H=1 -
DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -
DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -
DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FLOAT_H=1 -DHAVE_STDINT_H=1 -
DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_UNISTD_H=1 -DHAVE_WCHAR_H=1 -
DHAVE_LIBZ=1 -DHAVE_LIBPNG=1 -DHAVE_LIBJPEG=1 -DHAVE_LIBTIFF=1 -
DHAVE_LIBIULIB=1 -DHAVE_LIBPTHREAD=1 -DHAVE_LIBTESSERACT_FULL=1 -
DHAVE_LIBBLAS=1 -DHAVE_LIBGOMP=1 -DHAVE_FORK=1 -DHAVE_VFORK=1 -
DHAVE_WORKING_VFORK=1 -DHAVE_WORKING_FORK=1 -DHAVE_DUP2=1 -
DHAVE_MEMSET=1 -DHAVE_SQRT=1 -DHAVE_STRCHR=1 -DHAVE_STRDUP=1 -
DHAVE_STRRCHR=1 -I. -I. -I./include -I./ocr-utils -I/usr/local/
include -I/usr/local/include/tesseract -I/usr/local/include/tesseract
-DHAVE_TESSERACT -I/sw/include -I/opt/include -I/sw/include -I/opt/
include -fopenmp -Wall -Wno-sign-compare -Wno-write-strings -Wno-
deprecated -I/sw/include -I/opt/include -fopenmp -MT ocr-binarize-
otsu.o -MD -MP -MF ".deps/ocr-binarize-otsu.Tpo" -c -o ocr-binarize-
otsu.o `test -f './ocr-binarize/ocr-binarize-otsu.cc' || echo './'`./
ocr-binarize/ocr-binarize-otsu.cc; \
then mv -f ".deps/ocr-binarize-otsu.Tpo" ".deps/ocr-binarize-otsu.Po";
else rm -f ".deps/ocr-binarize-otsu.Tpo"; exit 1; fi
In file included from ./include/ocropus.h:31,
from ./ocr-binarize/ocr-binarize-otsu.cc:27:
./ocr-utils/components.h:89: error: 'iucstring' does not name a type
./ocr-utils/components.h:107: error: 'iucstring' was not declared in
this scope
./ocr-utils/components.h:107: error: template argument 1 is invalid
./ocr-utils/components.h: In member function 'virtual void
ocropus::IComponent::info(int, FILE*)':
./ocr-utils/components.h:95: error: 'object_history' was not declared
in this scope
./ocr-utils/components.h: In member function 'virtual void
ocropus::IComponent::save(FILE*)':
./ocr-utils/components.h:100: error: 'Unimplemented' was not declared
in this scope
./ocr-utils/components.h: In member function 'virtual void
ocropus::IComponent::load(FILE*)':
./ocr-utils/components.h:101: error: 'Unimplemented' was not declared
in this scope
./ocr-utils/components.h: In member function 'void
ocropus::IComponent::pdef(const char*, const char*, const char*)':
./ocr-utils/components.h:122: error: 'throwf' was not declared in this
scope
./ocr-utils/components.h:123: error: request for member 'find' in
'((ocropus::IComponent*)this)->ocropus::IComponent::params', which is
of non-class type 'int'
./ocr-utils/components.h:123: error: 'throwf' was not declared in this
scope
./ocr-utils/components.h:124: error: '((ocropus::IComponent*)this)-
>ocropus::IComponent::params' cannot be used as a function
./ocr-utils/components.h:125: error: 'iucstring' was not declared in
this scope
./ocr-utils/components.h:125: error: expected `;' before 'key'
./ocr-utils/components.h:126: error: 'key' was not declared in this
scope
./ocr-utils/components.h:133: error: '((ocropus::IComponent*)this)-
>ocropus::IComponent::params' cannot be used as a function
./ocr-utils/components.h:135: error: 'class colib::strhash<bool>' has
no member named 'find'
./ocr-utils/components.h:138: error: '((ocropus::IComponent*)this)-
>ocropus::IComponent::params' cannot be used as a function
./ocr-utils/components.h:141: error: '((ocropus::IComponent*)this)-
>ocropus::IComponent::params' cannot be used as a function
./ocr-utils/components.h: In member function 'void
ocropus::IComponent::pdef(const char*, double, const char*)':
./ocr-utils/components.h:147: error: 'iucstring' was not declared in
this scope
./ocr-utils/components.h:147: error: expected `;' before 'svalue'
./ocr-utils/components.h:148: error: 'svalue' was not declared in this
scope
./ocr-utils/components.h: In member function 'virtual bool
ocropus::IComponent::pexists(const char*)':
./ocr-utils/components.h:159: error: request for member 'find' in
'((ocropus::IComponent*)this)->ocropus::IComponent::params', which is
of non-class type 'int'
./ocr-utils/components.h: In member function 'virtual void
ocropus::IComponent::pset(const char*, const char*)':
./ocr-utils/components.h:166: error: request for member 'find' in
'((ocropus::IComponent*)this)->ocropus::IComponent::params', which is
of non-class type 'int'
./ocr-utils/components.h:166: error: 'throwf' was not declared in this
scope
./ocr-utils/components.h:167: error: '((ocropus::IComponent*)this)-
>ocropus::IComponent::params' cannot be used as a function
./ocr-utils/components.h: In member function 'virtual void
ocropus::IComponent::pset(const char*, double)':
./ocr-utils/components.h:172: error: 'iucstring' was not declared in
this scope
./ocr-utils/components.h:172: error: expected `;' before 'svalue'
./ocr-utils/components.h:173: error: 'svalue' was not declared in this
scope
./ocr-utils/components.h: In member function 'const char*
ocropus::IComponent::pget(const char*)':
./ocr-utils/components.h:187: error: request for member 'find' in
'((ocropus::IComponent*)this)->ocropus::IComponent::params', which is
of non-class type 'int'
./ocr-utils/components.h:187: error: 'throwf' was not declared in this
scope
./ocr-utils/components.h:188: error: '((ocropus::IComponent*)this)-
>ocropus::IComponent::params' cannot be used as a function
./ocr-utils/components.h: In member function 'double
ocropus::IComponent::pgetf(const char*)':
./ocr-utils/components.h:194: error: '((ocropus::IComponent*)this)-
>ocropus::IComponent::params' cannot be used as a function
./ocr-utils/components.h:194: error: 'throwf' was not declared in this
scope
./ocr-utils/components.h: In member function 'void
ocropus::IComponent::psave(FILE*)':
./ocr-utils/components.h:201: error: request for member 'keys' in
'((ocropus::IComponent*)this)->ocropus::IComponent::params', which is
of non-class type 'int'
./ocr-utils/components.h:203: error: '((ocropus::IComponent*)this)-
>ocropus::IComponent::params' cannot be used as a function
./ocr-utils/components.h: In member function 'void
ocropus::IComponent::pload(FILE*)':
./ocr-utils/components.h:217: error: '((ocropus::IComponent*)this)-
>ocropus::IComponent::params' cannot be used as a function
./ocr-utils/components.h: In member function 'void
ocropus::IComponent::pprint(FILE*, int)':
./ocr-utils/components.h:224: error: request for member 'keys' in
'((ocropus::IComponent*)this)->ocropus::IComponent::params', which is
of non-class type 'int'
./ocr-utils/components.h:227: error: '((ocropus::IComponent*)this)-
>ocropus::IComponent::params' cannot be used as a function
./ocr-utils/components.h: In function 'T* ocropus::make_component
(const char*)':
./ocr-utils/components.h:326: error: there are no arguments to
'throwf' that depend on a template parameter, so a declaration of
'throwf' must be available
./ocr-utils/components.h:326: error: (if you use '-fpermissive', G++
will accept your code, but allowing the use of an undeclared name is
deprecated)
./ocr-utils/components.h:330: error: there are no arguments to
'throwf' that depend on a template parameter, so a declaration of
'throwf' must be available
./ocr-utils/components.h: In function 'void ocropus::load_component
(FILE*, colib::autodel<T>&)':
./ocr-utils/components.h:352: error: there are no arguments to
'throwf' that depend on a template parameter, so a declaration of
'throwf' must be available
In file included from ./include/ocropus.h:64,
from ./ocr-binarize/ocr-binarize-otsu.cc:27:
./ocr-utils/logger.h: At global scope:
./ocr-utils/logger.h:71: error: 'iucstring' in namespace 'colib' does
not name a type
In file included from ./include/ocropus.h:67,
from ./ocr-binarize/ocr-binarize-otsu.cc:27:
./ocr-utils/docproc.h:109: error: 'iucstring' was not declared in this
scope
./ocr-utils/docproc.h:109: error: template argument 1 is invalid
In file included from ./include/ocropus.h:70,
from ./ocr-binarize/ocr-binarize-otsu.cc:27:
./ocr-utils/pages.h:34: error: 'iucstring' is not a member of 'colib'
./ocr-utils/pages.h:34: error: 'iucstring' is not a member of 'colib'
./ocr-utils/pages.h:34: error: template argument 1 is invalid
./ocr-utils/pages.h:39: error: 'iucstring' in namespace 'colib' does
not name a type
./ocr-utils/pages.h: In member function 'void ocropus::Pages::clear
()':
./ocr-utils/pages.h:52: error: request for member 'clear' in
'((ocropus::Pages*)this)->ocropus::Pages::files', which is of non-
class type 'int'
./ocr-utils/pages.h: In member function 'void ocropus::Pages::addFile
(const char*)':
./ocr-utils/pages.h:55: error: request for member 'push' in
'((ocropus::Pages*)this)->ocropus::Pages::files', which is of non-
class type 'int'
./ocr-utils/pages.h: In member function 'int ocropus::Pages::length
()':
./ocr-utils/pages.h:86: error: request for member 'length' in
'((ocropus::Pages*)this)->ocropus::Pages::files', which is of non-
class type 'int'
./ocr-utils/pages.h: In member function 'void ocropus::Pages::getPage
(int)':
./ocr-utils/pages.h:90: error: 'current_file' was not declared in this
scope
./ocr-utils/pages.h:90: error: invalid types 'int[int]' for array
subscript
./ocr-utils/pages.h: In member function 'bool ocropus::Pages::nextPage
()':
./ocr-utils/pages.h:95: error: request for member 'length' in
'((ocropus::Pages*)this)->ocropus::Pages::files', which is of non-
class type 'int'
./ocr-utils/pages.h: In member function 'void ocropus::Pages::loadImage
()':
./ocr-utils/pages.h:108: error: 'current_file' was not declared in
this scope
./ocr-utils/pages.h: In member function 'const char*
ocropus::Pages::getFileName()':
./ocr-utils/pages.h:127: error: 'current_file' was not declared in
this scope
make[1]: *** [ocr-binarize-otsu.o] Error 1
make: *** [all-recursive] Error 1
$

Thomas Breuel

unread,
Jun 6, 2009, 2:47:08 PM6/6/09
to ocr...@googlegroups.com
Looks like you didn't install the new iulib first; iucstring is a new
class in iulib 0.4

Also, --with-tesseract won't work--there is no Tesseract support.

Tom

Trimble

unread,
Jun 6, 2009, 7:36:21 PM6/6/09
to ocropus
On Jun 6, 1:47 pm, Thomas Breuel <tmb...@gmail.com> wrote:
> Looks like you didn't install the new iulib first; iucstring is a new
> class in iulib 0.4

You're right. I'm still using iulib subversion r124. It looks like
iulib
has moved to http://mercurial.iupr.org. Perhaps we should update
the documentation to remove instructions to install it from google?

After installing mercurial via macports, I'm now trying to build
iulib mercurial version 71.

$ ./configure
...
checking for strrchr... yes
configure: creating ./config.status
config.status: error: cannot find input file: Makefile.in
$

If i install Makefile.in and Makefile.am from version 14, configure
then complains that it needs automake1.10.
When I install automake1.10 and remove the two Makefiles, it still
complains
that Makefile.in and Makefile.am are missing. When I provide both of
them
and automake1.10, make fails thusly:

$ make
...
In file included from ./imgio/io_tiff.h:30,
from ./imgio/imgio.h:30,
from ./imgio/imgio.cc:24:
./imglib/iulib.h:30:22: error: bithacks.h: No such file or directory
./imglib/iulib.h:31:23: error: imgbitptr.h: No such file or directory
./imglib/iulib.h:32:21: error: imgbits.h: No such file or directory
./imglib/iulib.h:33:20: error: imgrle.h: No such file or directory
./imglib/iulib.h:53:23: error: dgraphics.h: No such file or directory
./imglib/iulib.h:54:19: error: vidio.h: No such file or directory
make: *** [imgio.o] Error 1
$

So I edited imglib/iulib.h to include the directories that each of
these headers live in.

Now iulib fails to build with the following error.

$ make
...
rm -f libiulib.a
ar cru libiulib.a imgio.o autoinvert.o io_jpeg.o io_pbm.o io_png.o
imglabels.o imgmisc.o imgrescale.o imggraymorph.o imgops.o imggauss.o
imgfilters.o imgedges.o imgbrushfire.o imgtrace.o imgmap.o imgthin.o
imgmorph.o imgblit_c.o imgbsmp.o imgbits.o imgblit.o imgrle.o
imgbthin.o dgraphics_nosdl.o
ranlib libiulib.a
make: *** No rule to make target `colib/ocrinterfaces.h', needed by
`all-am'. Stop.
$

Any thoughts?

Trimble

unread,
Jun 6, 2009, 9:26:01 PM6/6/09
to ocropus
I found the "build" script; the script creates the
makefiles that I was missing.

The paths to the headers are still creating problems.
Running iulib's build script followed by make gives

$ make
g++ -DPACKAGE_NAME=\"iulib\" -DPACKAGE_TARNAME=\"iulib\" -
DPACKAGE_VERSION=\"0.3\" -DPACKAGE_STRING=\"iulib\ 0.3\" -
DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"iulib\" -DVERSION=\"0.3\" -
DSTDC_HEADERS=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_SYS_TYPES_H=1 -
DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -
DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -
DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FLOAT_H=1 -DHAVE_STDINT_H=1 -
DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_UNISTD_H=1 -DHAVE_WCHAR_H=1 -
DHAVE_LIBZ=1 -DHAVE_LIBPNG=1 -DHAVE_LIBJPEG=1 -DHAVE_LIBTIFF=1 -
DHAVE_OLD_AVFORMAT=1 -DHAVE_FORK=1 -DHAVE_VFORK=1 -
DHAVE_WORKING_VFORK=1 -DHAVE_WORKING_FORK=1 -DHAVE_DUP2=1 -
DHAVE_MEMSET=1 -DHAVE_SQRT=1 -DHAVE_STRCHR=1 -DHAVE_STRDUP=1 -
DHAVE_STRRCHR=1 -I. -I./colib -I./imgio -I./imglib -I/sw/include -I/
opt/include -I/sw/include -I/opt/include -MT imgio.o -MD -MP -
MF .deps/imgio.Tpo -c -o imgio.o `test -f './imgio/imgio.cc' || echo
'./'`./imgio/imgio.cc
In file included from ./imgio/io_tiff.h:30,
from ./imgio/imgio.h:30,
from ./imgio/imgio.cc:24:
./imglib/iulib.h:30:22: error: bithacks.h: No such file or directory
./imglib/iulib.h:31:23: error: imgbitptr.h: No such file or directory
./imglib/iulib.h:32:21: error: imgbits.h: No such file or directory
./imglib/iulib.h:33:20: error: imgrle.h: No such file or directory
./imglib/iulib.h:53:23: error: dgraphics.h: No such file or directory
./imglib/iulib.h:54:19: error: vidio.h: No such file or directory
make: *** [imgio.o] Error 1
$

Editing iulib.h allows me to compile and install iulib without errors,
but then I get the
following error
$ ./build --with-tesseract=/usr/local --without-leptonica
...
# please run make now
$ make
Making all in .
g++ -DPACKAGE_NAME=\"ocropus\" -DPACKAGE_TARNAME=\"ocropus\" -
DPACKAGE_VERSION=\"0.3\" -DPACKAGE_STRING=\"ocropus\ 0.3\" -
DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"ocropus\" -DVERSION=\"0.3\" -
DSTDC_HEADERS=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_SYS_TYPES_H=1 -
DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -
DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -
DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FLOAT_H=1 -DHAVE_STDINT_H=1 -
DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_UNISTD_H=1 -DHAVE_WCHAR_H=1 -
DHAVE_LIBZ=1 -DHAVE_LIBPNG=1 -DHAVE_LIBJPEG=1 -DHAVE_LIBTIFF=1 -
DHAVE_LIBIULIB=1 -DHAVE_LIBPTHREAD=1 -DHAVE_LIBTESSERACT_FULL=1 -
DHAVE_LIBBLAS=1 -DHAVE_LIBGOMP=1 -DHAVE_FORK=1 -DHAVE_VFORK=1 -
DHAVE_WORKING_VFORK=1 -DHAVE_WORKING_FORK=1 -DHAVE_DUP2=1 -
DHAVE_MEMSET=1 -DHAVE_SQRT=1 -DHAVE_STRCHR=1 -DHAVE_STRDUP=1 -
DHAVE_STRRCHR=1 -I. -I./include -I./ocr-utils -I/usr/local/include -I/
usr/local/include/tesseract -I/usr/local/include/tesseract -
DHAVE_TESSERACT -I/sw/include -I/opt/include -I/sw/include -I/opt/
include -fopenmp -Wall -Wno-sign-compare -Wno-write-strings -Wno-
deprecated -I/sw/include -I/opt/include -fopenmp -MT ocr-binarize-
otsu.o -MD -MP -MF .deps/ocr-binarize-otsu.Tpo -c -o ocr-binarize-
otsu.o `test -f './ocr-binarize/ocr-binarize-otsu.cc' || echo './'`./
ocr-binarize/ocr-binarize-otsu.cc
In file included from ./include/ocropus.h:30,
from ./ocr-binarize/ocr-binarize-otsu.cc:27:
/usr/local/include/iulib/iulib.h:30:30: error: imgbits/bithacks.h: No
such file or directory
/usr/local/include/iulib/iulib.h:31:31: error: imgbits/imgbitptr.h: No
such file or directory
/usr/local/include/iulib/iulib.h:32:29: error: imgbits/imgbits.h: No
such file or directory
/usr/local/include/iulib/iulib.h:33:28: error: imgbits/imgrle.h: No
such file or directory
/usr/local/include/iulib/iulib.h:53:29: error: utils/dgraphics.h: No
such file or directory
/usr/local/include/iulib/iulib.h:54:25: error: vidio/vidio.h: No such
file or directory
make[1]: *** [ocr-binarize-otsu.o] Error 1
make: *** [all-recursive] Error 1
$

Installing the original iulib.h in /usr/local/include/iulib then
causes the ocropus make to fail in this way:
$ make
...
g++ -DPACKAGE_NAME=\"ocropus\" -DPACKAGE_TARNAME=\"ocropus\" -
DPACKAGE_VERSION=\"0.3\" -DPACKAGE_STRING=\"ocropus\ 0.3\" -
DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"ocropus\" -DVERSION=\"0.3\" -
DSTDC_HEADERS=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_SYS_TYPES_H=1 -
DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -
DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -
DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FLOAT_H=1 -DHAVE_STDINT_H=1 -
DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_UNISTD_H=1 -DHAVE_WCHAR_H=1 -
DHAVE_LIBZ=1 -DHAVE_LIBPNG=1 -DHAVE_LIBJPEG=1 -DHAVE_LIBTIFF=1 -
DHAVE_LIBIULIB=1 -DHAVE_LIBPTHREAD=1 -DHAVE_LIBTESSERACT_FULL=1 -
DHAVE_LIBBLAS=1 -DHAVE_LIBGOMP=1 -DHAVE_FORK=1 -DHAVE_VFORK=1 -
DHAVE_WORKING_VFORK=1 -DHAVE_WORKING_FORK=1 -DHAVE_DUP2=1 -
DHAVE_MEMSET=1 -DHAVE_SQRT=1 -DHAVE_STRCHR=1 -DHAVE_STRDUP=1 -
DHAVE_STRRCHR=1 -I. -I./include -I./ocr-utils -I/usr/local/include -I/
usr/local/include/tesseract -I/usr/local/include/tesseract -
DHAVE_TESSERACT -I/sw/include -I/opt/include -I/sw/include -I/opt/
include -fopenmp -Wall -Wno-sign-compare -Wno-write-strings -Wno-
deprecated -I/sw/include -I/opt/include -fopenmp -MT glclass.o -MD -MP
-MF .deps/glclass.Tpo -c -o glclass.o `test -f './ocr-line/glclass.cc'
|| echo './'`./ocr-line/glclass.cc
In file included from ./ocr-line/glclass.cc:6:
./include/gsl.h:4:28: error: gsl/gsl_linalg.h: No such file or
directory
In file included from ./ocr-line/glclass.cc:6:
./include/gsl.h:9: error: ISO C++ forbids declaration of 'gsl_vector'
with no type
./include/gsl.h:9: error: expected ';' before '*' token
./include/gsl.h:10: error: 'gsl_vector_view' does not name a type
./include/gsl.h:37: error: expected type-specifier before
'gsl_vector_view'
./include/gsl.h:40: error: expected type-specifier before 'gsl_vector'
./include/gsl.h: In constructor 'gsl::vector::vector(int)':
./include/gsl.h:12: error: 'p' was not declared in this scope
./include/gsl.h:12: error: 'gsl_vector_alloc' was not declared in this
scope
./include/gsl.h:13: error: 'view' was not declared in this scope
./include/gsl.h:13: error: 'gsl_vector_subvector_with_stride' was not
declared in this scope
./include/gsl.h: In destructor 'gsl::vector::~vector()':
./include/gsl.h:16: error: 'p' was not declared in this scope
./include/gsl.h:16: error: 'gsl_vector_free' was not declared in this
scope
./include/gsl.h: In member function 'int gsl::vector::length()':
./include/gsl.h:20: error: 'p' was not declared in this scope
./include/gsl.h: In member function 'int gsl::vector::dim(int)':
./include/gsl.h:23: error: 'p' was not declared in this scope
./include/gsl.h: In member function 'void gsl::vector::resize(int)':
./include/gsl.h:27: error: 'p' was not declared in this scope
./include/gsl.h:27: error: 'gsl_vector_free' was not declared in this
scope
./include/gsl.h:28: error: 'gsl_vector_alloc' was not declared in this
scope
./include/gsl.h: In member function 'void gsl::vector::operator=
(double)':
./include/gsl.h:31: error: 'p' was not declared in this scope
./include/gsl.h:31: error: 'gsl_vector_set_all' was not declared in
this scope
./include/gsl.h: In member function 'double& gsl::vector::operator()
(int)':
./include/gsl.h:34: error: 'p' was not declared in this scope
./include/gsl.h:35: error: 'p' was not declared in this scope
./include/gsl.h: At global scope:
./include/gsl.h:58: error: ISO C++ forbids declaration of 'gsl_matrix'
with no type
./include/gsl.h:58: error: expected ';' before '*' token
./include/gsl.h:59: error: 'gsl_matrix_view' does not name a type
./include/gsl.h:86: error: expected type-specifier before
'gsl_matrix_view'
./include/gsl.h:89: error: expected type-specifier before 'gsl_matrix'
./include/gsl.h: In constructor 'gsl::matrix::matrix(int, int)':
./include/gsl.h:61: error: 'p' was not declared in this scope
./include/gsl.h:61: error: 'gsl_matrix_alloc' was not declared in this
scope
./include/gsl.h:62: error: 'view' was not declared in this scope
./include/gsl.h:62: error: 'gsl_matrix_view_array_with_tda' was not
declared in this scope
./include/gsl.h: In destructor 'gsl::matrix::~matrix()':
./include/gsl.h:65: error: 'p' was not declared in this scope
./include/gsl.h:65: error: 'gsl_matrix_free' was not declared in this
scope
./include/gsl.h: In member function 'int gsl::matrix::dim(int)':
./include/gsl.h:69: error: 'p' was not declared in this scope
./include/gsl.h:70: error: 'p' was not declared in this scope
./include/gsl.h: In member function 'void gsl::matrix::resize(int,
int)':
./include/gsl.h:74: error: 'p' was not declared in this scope
./include/gsl.h:74: error: 'gsl_matrix_free' was not declared in this
scope
./include/gsl.h:75: error: 'gsl_matrix_alloc' was not declared in this
scope
./include/gsl.h:76: error: 'view' was not declared in this scope
./include/gsl.h:76: error: 'gsl_matrix_view_array_with_tda' was not
declared in this scope
./include/gsl.h: In member function 'void gsl::matrix::operator=
(double)':
./include/gsl.h:79: error: 'p' was not declared in this scope
./include/gsl.h:79: error: 'gsl_matrix_set_all' was not declared in
this scope
./include/gsl.h: In member function 'double& gsl::matrix::operator()
(int, int)':
./include/gsl.h:82: error: 'p' was not declared in this scope
./include/gsl.h:83: error: 'p' was not declared in this scope
./include/gsl.h:84: error: 'p' was not declared in this scope
./ocr-line/glclass.cc: In function 'void glinerec::least_square
(colib::floatarray&, colib::floatarray&, colib::floatarray&)':
./ocr-line/glclass.cc:1307: error: 'gsl_linalg_SV_decomp_mod' was not
declared in this scope
./ocr-line/glclass.cc:1308: error: 'gsl_linalg_SV_solve' was not
declared in this scope
/usr/local/include/colib/narray.h: In member function
'colib::narray<T>& colib::narray<T>::truncate(int) [with T = char]':
./ocr-utils/narray-binio.h:48: instantiated from here
/usr/local/include/colib/narray.h:261: warning: no return statement in
function returning non-void
/usr/local/include/colib/narray.h: In member function
'colib::narray<T>& colib::narray<T>::truncate(int) [with T = int]':
./ocr-line/glclass.cc:295: instantiated from here
/usr/local/include/colib/narray.h:261: warning: no return statement in
function returning non-void
make[1]: *** [glclass.o] Error 1
make: *** [all-recursive] Error 1
$

gsl_linalg.h -- aha. I'm missing gsl.


Trimble

unread,
Jun 6, 2009, 9:33:04 PM6/6/09
to ocropus
Installing gsl1.12 via macports causes ocropus to fail to build like
this:

$ make
...
g++ -DPACKAGE_NAME=\"ocropus\" -DPACKAGE_TARNAME=\"ocropus\" -
DPACKAGE_VERSION=\"0.3\" -DPACKAGE_STRING=\"ocropus\ 0.3\" -
DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"ocropus\" -DVERSION=\"0.3\" -
DSTDC_HEADERS=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_SYS_TYPES_H=1 -
DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -
DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -
DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FLOAT_H=1 -DHAVE_STDINT_H=1 -
DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_UNISTD_H=1 -DHAVE_WCHAR_H=1 -
DHAVE_LIBZ=1 -DHAVE_LIBPNG=1 -DHAVE_LIBJPEG=1 -DHAVE_LIBTIFF=1 -
DHAVE_LIBIULIB=1 -DHAVE_LIBPTHREAD=1 -DHAVE_LIBTESSERACT_FULL=1 -
DHAVE_LIBBLAS=1 -DHAVE_LIBGOMP=1 -DHAVE_FORK=1 -DHAVE_VFORK=1 -
DHAVE_WORKING_VFORK=1 -DHAVE_WORKING_FORK=1 -DHAVE_DUP2=1 -
DHAVE_MEMSET=1 -DHAVE_SQRT=1 -DHAVE_STRCHR=1 -DHAVE_STRDUP=1 -
DHAVE_STRRCHR=1 -I. -I./include -I./ocr-utils -I/usr/local/include -I/
usr/local/include/tesseract -I/usr/local/include/tesseract -
DHAVE_TESSERACT -I/sw/include -I/opt/include -I/sw/include -I/opt/
include -fopenmp -Wall -Wno-sign-compare -Wno-write-strings -Wno-
deprecated -I/sw/include -I/opt/include -fopenmp -MT components.o -MD -
MP -MF .deps/components.Tpo -c -o components.o `test -f './ocr-utils/
components.cc' || echo './'`./ocr-utils/components.cc
./ocr-utils/components.cc: In member function 'virtual void
ocropus::IComponent::check_parameters_()':
./ocr-utils/components.cc:52: error: 'environ' was not declared in
this scope
make[1]: *** [components.o] Error 1

Thomas Breuel

unread,
Jun 7, 2009, 3:01:57 AM6/7/09
to ocr...@googlegroups.com
Thanks for the reports. A couple of things:

* If you can supply patches or (better) publish your own Mercurial
repository, we can look into incorporating your changes.

* If you can write/update a Google Docs document for OS X installatino
and invite me as a co-owner, I can link it into the web site. That
way, you could keep the instructions up-to-date.

Tom

oneey...@googlemail.com

unread,
Jun 7, 2009, 4:32:53 AM6/7/09
to ocropus
This

> ./ocr-utils/components.cc:52: error: 'environ' was not declared in this scope

is the subject of issue 158

http://code.google.com/p/ocropus/issues/detail?id=158

Basically you can patch components.cc with

extern char **environ;

Cheers

Duncan

oneey...@googlemail.com

unread,
Jun 7, 2009, 4:42:16 AM6/7/09
to ocropus
I have a build on Mac OS (10.5) that I'm happy to share with anyone. I
built the dependencies (libtiff, gsl etc) with configure and make, and
then iulib and ocropus with XCode. One of my reasons for this strategy
is that I am a keen never to 'make install', so that I have a self-
contained distribution (VelOCRaptor is a Mac GUI app).

Drop me a line and I will ship either the binaries or the XCode
project. I haven't published more formally because, given that I have
lots of instances of issue 160, I wonder if the resulting build is
flawed in some way.

Cheers

Duncan
www.VelOCRaptor.com - Simple Affordable Mac OCR

PS - BTW Tom - I notice that issue 160 has been closed - I am still
seeing it.

Thomas Breuel

unread,
Jun 7, 2009, 4:52:34 AM6/7/09
to ocr...@googlegroups.com
I tried the SA-tax.jpg and all the internally generated exceptions
seem to be caught, so it runs to completion..

It will still output lots of noise about things it's unhappy about,
but that is as it should be.

(The output is also not very good right now, but that will take some
time to fix.)

Tom

Trimble

unread,
Jun 7, 2009, 10:02:54 AM6/7/09
to ocropus
Installing gsl fixes the gsl dependency (of course) and Issue 112
returns:
http://code.google.com/p/ocropus/issues/detail?id=112

Applying the patch described on that page, I get

$ build --with-tesseract=/usr/local --without-leptonica
...
$ make
Making all in .
make[1]: *** No rule to make target `ocr-autoclean/ocr-
orientation.cc', needed by `ocr-orientation.o'. Stop.
make: *** [all-recursive] Error 1
$
This was described at http://groups.google.com/group/ocropus/browse_thread/thread/7874d8154a530c46
Removing references to the missing files from the Makefile,

$ make
Making all in .
g++ -I/sw/include -I/opt/local/include -fopenmp -Wall -Wno-sign-
compare -Wno-write-strings -Wno-deprecated -I/sw/include -I/opt/local/
include -fopenmp -L/sw/lib -L/opt/local/lib -L/usr/local/lib -L/usr/
local/lib -L/usr/local/include/liblept/../../lib -lgomp -o ocropus
ocropus.o libocropus.a -lgomp -lSDL_gfx -lSDL -lblas -lgsl -lgslcblas -
llept -ltesseract_full -lpthread -liulib -ltiff -ljpeg -lpng -lz
/usr/bin/ld: Undefined symbols:
iulib::dsection_set(char const*)
iulib::dactive()
collect2: ld returned 1 exit status
make[1]: *** [ocropus] Error 1
make: *** [all-recursive] Error 1
$

which, like most compiler errors, is beyond my abilities
to diagnose.

Max MacLeod

unread,
Jun 8, 2009, 7:04:46 AM6/8/09
to ocr...@googlegroups.com
Hi Duncan,
I'd be very interested to have a look at the XCode project. Would you have 0.3 available also?

I can get it to build and compile fine, and it runs the Lua commands also.

When I try and test it with an image it takes ages then comes back with a bus error.

Cheers,
Max

oneey...@googlemail.com

unread,
Jun 8, 2009, 8:48:13 AM6/8/09
to ocropus
Hmmm, I wonder if something is up with my build. I posted the new
stack trace to 160 before it was closed, does it give any clues?

Duncan

oneey...@googlemail.com

unread,
Jun 8, 2009, 9:03:51 AM6/8/09
to ocropus
I've zipped up the project and put it at

http://www.velocraptor.com/downloads/ocropus-0.4-mac-build.zip

I think the structure should be reasonably obvious - it needs the
source of the dependencies filled into the holes. I ran configure,
then make, for each, but not make install, so that the xcode project
then takes the libs from where they are built.

I don't have the 0.3 build in anything like as convenient a form I'm
afraid.

Be sure to let me know if you get results

Cheers

Duncan

On Jun 8, 12:04 pm, Max MacLeod <max.macl...@gmail.com> wrote:
> Hi Duncan,
> I'd be very interested to have a look at the XCode project. Would you have
> 0.3 available also?
>
> I can get it to build and compile fine, and it runs the Lua commands also.
>
> When I try and test it with an image it takes ages then comes back with a
> bus error.
>
> Cheers,
> Max
>
> 2009/6/7 dun...@oneeyedmen.com <oneeyed...@googlemail.com>
>
>
>
> > I have a build on Mac OS (10.5) that I'm happy to share with anyone. I
> > built the dependencies (libtiff, gsl etc) with configure and make, and
> > then iulib and ocropus with XCode. One of my reasons for this strategy
> > is that I am a keen never to 'make install', so that I have a self-
> > contained distribution (VelOCRaptor is a Mac GUI app).
>
> > Drop me a line and I will ship either the binaries or the XCode
> > project. I haven't published more formally because, given that I have
> > lots of instances of issue 160, I wonder if the resulting build is
> > flawed in some way.
>
> > Cheers
>
> > Duncan
> >www.VelOCRaptor.com- Simple Affordable Mac OCR

Max MacLeod

unread,
Jun 8, 2009, 9:20:56 AM6/8/09
to ocr...@googlegroups.com
Brilliant. Will take a look.

Thanks Duncan.

Cheers,
Max

Trimble

unread,
Jun 11, 2009, 10:07:46 PM6/11/09
to ocropus
After patching ocr-utils/components.cc to fix the environ problem,
patching ocr-voronoi/read_image.cc to fix the TIFF_VERSION_CLASSIC
problem,
patching genAM.py to remove instructions to build the two files that
aren't there
any more, ocropus still fails to build with the above error;

usr/bin/ld: Undefined symbols:
iulib::dsection_set(char const*)

There is a recent recipe for applying these patches here:
http://code.google.com/p/ocropus/issues/detail?id=1
Making those patches (but still using automake) my build
fails the same way.

Is there anything else to do?

Thomas Breuel

unread,
Jun 12, 2009, 3:16:55 PM6/12/09
to ocr...@googlegroups.com
Hi,

if you could create a public Mercurial repository for the OS X version
of OCRopus, we can keep pulling changes from it.

Alternatively, can you package up your changes with "hg bundle" and
attach them to an issue.

Tom

oneey...@googlemail.com

unread,
Jun 18, 2009, 10:15:06 AM6/18/09
to ocropus
I've smartened up my Mac build to use MacPorts to install the
dependencies, and then XCode to build just iulib and ocropus.

The XCode project is available from
http://www.velocraptor.com/downloads/ocropus-0.4-mac-build.2.zip
with instructions in README

Note that I still have crashes in the Release build when openSMP
support is turned on.

Duncan

oneey...@googlemail.com

unread,
Jun 18, 2009, 3:40:22 PM6/18/09
to ocropus
Just discovered that I missed a patch in the README. It should say

To build OCRopus 0.4 on MacOS X

1. Install MacPorts

2. Use MacPorts to install jpeg, tiff, libpng, gsl... I think that's
it.

3. Install source
$ hg clone http://iulib.googlecode.com/hg iulib
$ hg clone http://ocropus.googlecode.com/hg ocropus

4. Patch iulib/utils/dgraphics_nosdl.cc
diff -r 8015520179e9 utils/dgraphics_nosdl.cc
--- a/utils/dgraphics_nosdl.cc Tue Jun 09 23:47:16 2009 +0200
+++ b/utils/dgraphics_nosdl.cc Thu Jun 18 13:45:34 2009 +0100
@@ -68,4 +68,13 @@

void dwait() {
}
+
+ bool dactive() {
+ return false;
+ }
+
+ const char *dsection_set(const char *name) {
+ return name;
+ }
+
}

5. Patch ocropus/ocr-utils/components.cc

diff -r a23e62d08a19 ocr-utils/components.cc
--- a/ocr-utils/components.cc Fri Jun 05 07:40:19 2009 +0200
+++ b/ocr-utils/components.cc Thu Jun 18 20:37:54 2009 +0100
@@ -27,6 +27,8 @@
#include "iulib/iulib.h"
#include "components.h"

+extern char **environ;
+
using namespace colib;

namespace {


6. Extract ocropus/data/models/default.fst.gz to ocropus/data/models/
default.fst

7. Build the XCode project.
Reply all
Reply to author
Forward
0 new messages