unexpected token `LEPTONICA,' PKG_CHECK_MODULES(LEPTONICA - tesseract

I'm using the JavaCPP Presets project to build Leptonica and Tesseract. I have managed to build Leptonica 1.7 using the following commands:
cd leptonica
./cppbuild.sh install leptonica
cd cppbuild/linux-x86_64/leptonica-1.72/
./configure
make && sudo make install
cd ../../../
mvn clean install
cd ..
The compiled libraries are /usr/local/lib
When I try to build Tesseract using the following command I get this error:
./cppbuild.sh install tesseract
./configure: line 17620: syntax error near unexpected token `LEPTONICA,'
./configure: line 17620: `PKG_CHECK_MODULES(LEPTONICA, lept >= 1.74, have_lept=true, have_lept=false)'
/opt/javacpp-presets/tesseract
Then I put the complete trace:
/opt/javacpp-presets /opt/javacpp-presets/tesseract
Detected platform "linux-x86_64"
Building for platform "linux-x86_64"
Installing "tesseract"
/opt/javacpp-presets/tesseract/cppbuild /opt/javacpp-presets
Decompressing archives...
Bytes leídos en total: 12032000 (12MiB, 33MiB/s)
Running aclocal
Running /usr/bin/libtoolize
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'config'.
libtoolize: copying file 'config/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
Running autoheader
Running automake --add-missing --copy
configure.ac:309: installing 'config/compile'
configure.ac:69: installing 'config/missing'
api/Makefile.am: installing 'config/depcomp'
Running autoconf
All done.
To build the software now, do something like:
$ ./configure [--enable-debug] [...other options]
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -m64 accepts -g... yes
fatal: Not a git repository: './.git'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking whether make supports nested variables... yes
checking dependency style of g++ -m64... gcc3
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking --enable-graphics argument... yes
checking whether to disable cube... no
checking --enable-embedded argument... no
checking --enable-opencl argument... no
checking how to run the C++ preprocessor... g++ -m64 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking CL/cl.h usability... no
checking CL/cl.h presence... no
checking for CL/cl.h... no
checking OpenCL/cl.h usability... no
checking OpenCL/cl.h presence... no
checking for OpenCL/cl.h... no
checking tiffio.h usability... yes
checking tiffio.h presence... yes
checking for tiffio.h... yes
checking for clGetPlatformIDs in -lOpenCL... no
checking --enable-visibility argument... no
checking --enable-multiple-libraries argument... no
checking whether to use tessdata-prefix... yes
checking whether to enable debugging... no
checking how to print strings... printf
checking for gcc... gcc -m64
checking whether we are using the GNU C compiler... yes
checking whether gcc -m64 accepts -g... yes
checking for gcc -m64 option to accept ISO C89... none needed
checking whether gcc -m64 understands -c and -o together... yes
checking dependency style of gcc -m64... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc -m64... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver #FILE support... #
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc -m64 object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc -m64 supports -fno-rtti -fno-exceptions... no
checking for gcc -m64 option to produce PIC... -fPIC -DPIC
checking if gcc -m64 PIC flag -fPIC -DPIC works... yes
checking if gcc -m64 static flag -static works... yes
checking if gcc -m64 supports -c -o file.o... yes
checking if gcc -m64 supports -c -o file.o... (cached) yes
checking whether the gcc -m64 linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -m64 -E
checking for ld used by g++ -m64... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ -m64 linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ -m64 option to produce PIC... -fPIC -DPIC
checking if g++ -m64 PIC flag -fPIC -DPIC works... yes
checking if g++ -m64 static flag -static works... yes
checking if g++ -m64 supports -c -o file.o... yes
checking if g++ -m64 supports -c -o file.o... (cached) yes
checking whether the g++ -m64 linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether byte ordering is bigendian... no
checking if compiling with clang... no
checking whether compiler supports C++11... yes
checking for snprintf... yes
checking for library containing sem_init... -lpthread
checking for ANSI C header files... (cached) yes
checking whether time.h and sys/time.h may both be included... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking sys/ipc.h usability... yes
checking sys/ipc.h presence... yes
checking for sys/ipc.h... yes
checking sys/shm.h usability... yes
checking sys/shm.h presence... yes
checking for sys/shm.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
checking whether #! works in shell scripts... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for getline... yes
checking for wchar_t... yes
checking for long long int... yes
checking for off_t... yes
checking for mbstate_t... yes
./configure: line 17620: syntax error near unexpected token `LEPTONICA,'
./configure: line 17620: `PKG_CHECK_MODULES(LEPTONICA, lept >= 1.74, have_lept=true, have_lept=false)'
/opt/javacpp-presets/tesseract
The version I am using from autoconf is 2.9.
Thanks in advance

There's a similar issue raised over on the github account for tesseract earlier this year. One comment in response says:
Thank you for this report. You found a bug in the installation guide: we did not mention that the package pkg-config is required. I fixed it in the Wiki page and will send a pull request to update the distributed INSTALL* files.
I had the same problem on OS X today, and installing pkg-config seems to have fixed the issue.

Related

Error in ./configure step. (CentOS 7) Your compiler does not have the necessary C++17 support

The lower part is as follows.
How do we solve this?
checking whether the g++ linker (/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether C++ compiler accepts -std=c++17... no
checking whether C++ compiler accepts -std=c++20... no
configure: error: Your compiler does not have the necessary C++17 support! Cannot proceed.
I had the same issue and tried everything out. At the end i found the solution in this thread ->
g++: error: unrecognized '-std=c++17' (what is g++ version and how to install)
yum install devtoolset-10-gcc-c++
scl enable devtoolset-10 bash
make
exit

"scons qemu" error "sh: 1: qemu: not found"

I want learn a toy OS FreeNOS, its doc says use "scons qemu" to boot it. But I run this command shows:
scons: Reading SConscript files ...
Checking for -m32 ... (cached) yes
Checking for -fno-stack-protector ... (cached) yes
Checking for -O0 ... (cached) yes
Checking for -g3 ... (cached) yes
Checking for -Wall ... (cached) yes
Checking for -W ... (cached) yes
Checking for -Wno-unused-parameter ... (cached) yes
Checking for -fno-builtin ... (cached) yes
Checking for -nostdinc ... (cached) yes
Checking for -Wno-write-strings ... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
qemu -usb -cdrom boot/boot.iso
sh: 1: qemu: not found
scons: *** [qemu] Error 127
scons: building terminated because of errors.
But I have installed qemu, when I run "ls /usr/bin", It shows :
here are many items about but no one is named "qemu"
so I want know how could I boot this OS..
You've nearly answered your question yourself. qemu is not found because there is no qemu.
Simply create a symlink to your desired target platform. Looking at freenos.org x86, mips and arm are supported, so most likely ln -s qemu-system-i386 qemu should work.
For clarification: all qemu binaries are of the form qemu-system-< arch > or qemu-< arch >[-static]. qemu-system-* emulates a hole system (e.g a x86 pc with disk, network and graphics card), whereas with qemu-< arch > you can run a single binary of architecture < arch > on your current host architecture.

varnish installation by pecl get error on whm

I'm trying to install varnish cache, which is oficially released via PECL:after that problem im also trying install varnish cache through command but it was also not successfull and we had get some error
downloading varnish-1.1.1.tgz ...
Starting to download varnish-1.1.1.tgz (22,852 bytes)
........done: 22,852 bytes
11 source files, building
running: phpize
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
building in /root/tmp/pear/temp/pear-build-rootSVST4d/varnish-1.1.1
running: /root/tmp/pear/temp/varnish/configure
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20100525
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for varnish support... yes, shared
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for sys/types.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking for varnish files in default path... not found
configure: error: Please reinstall the varnish distribution
ERROR: `/root/tmp/pear/temp/varnish/configure' failed
The varnish.so object is not in /usr/local/lib/php/extensions/no-debug-non-zts-20100525
Tidying /usr/local/lib/php.ini...
No changes
Tidying /usr/local/cpanel/3rdparty/php/53/etc/php.ini...
No changes
You need install the varnish dev packages.
In Ubuntu try install the package: libvarnishapi-dev
sudo apt-get install libvarnishapi-dev

Compiling fish shell under MSYS?

I found this post Compiling fish shell under Cygwin? which talks about compiling fish against Cygwin.
What would be the instructions to compile for MSYS? (and especially MSYSGIT)?
This is what I did
install msysgit-netInstall https://code.google.com/p/msysgit/downloads/detail?name=msysGit-netinstall-1.8.4-preview20130916.exe&can=2&q=
install autoconf from http://sourceforge.net/projects/mingw/files/MSYS/msysdev/autoconf/autoconf-2.68-1/autoconf-2.68-1-msys-1.0.17-bin.tar.lzma/download
clone the fish repo
run autoconf
run ./configure
the process fails with
$ ./configure
checking if autoconf needs to be run... no
checking if autoheader needs to be run... no
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for a BSD-compatible install... /bin/install -c
CXXFLAGS: -g -O2
checking for /usr/pkg/include include directory... no
checking for /usr/pkg/lib library directory... no
checking for /usr/pkg/bin command directory... no
checking for /sw/include include directory... no
checking for /sw/lib library directory... no
checking for /sw/bin command directory... no
checking for /opt/include include directory... no
checking for /opt/lib library directory... no
checking for /opt/bin command directory... no
checking for /opt/local/include include directory... no
checking for /opt/local/lib library directory... no
checking for /opt/local/bin command directory... no
checking for /usr/local/include include directory... no
checking for /usr/local/lib library directory... no
checking for /usr/local/bin command directory... no
checking for msgfmt... msgfmt
checking for doxygen... no
checking if we are compiling against glibc... no
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking target system type... i686-pc-mingw32
checking if we are under Solaris... no
checking if we are using non varargs tparm.... yes
checking if we are under BSD... no
checking for /proc/self/stat... no
checking for library containing connect... no
configure: error: Cannot find the socket library, needed to build this package.
Any idea?

Stuck on PHP Mongo install

Not sure if I am in a right place to ask, but I have a problem on installing php mongo.
Here's what I have. I'm on a OSX Mavericks and have mongoDB installed and working. Now when I do the sudo pecl install mongo, it gives the following output and gets stuck infinitely:
downloading mongo-1.4.5.tgz ...
Starting to download mongo-1.4.5.tgz (141,417 bytes)
..............................done: 141,417 bytes
84 source files, building
running: phpize
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
building in /private/tmp/pear/install/pear-build-rootOyPUZ5/mongo-1.4.5
running: /private/tmp/pear/install/mongo/configure
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i386-apple-darwin13.0.0
checking host system type... i386-apple-darwin13.0.0
checking target system type... i386-apple-darwin13.0.0
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib/php/extensions/no-debug-non-zts-20100525
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to enable Mongo extension... yes, shared
checking whether byte ordering is bigendian... no
checking whether to compile for recent osx architectures... yes
checking whether to include code coverage symbols... no
checking Build with PHP streams support... yes
checking for ld used by cc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
Previously I had successfully installed on older OSX version. So what might be the problem?
Am I missing something?
It appeared that the new XCode was needed with it's command line tools. Just installed XCode 5 and everything went fine.