configure: error: leptonica library missing (when building tesseract-ocr-3.01 on MinGW) - compilation

When running configure it fails with
checking for leptonica... yes
checking for pixCreate in -llept... no
configure: error: leptonica library missing
But I have leptonica 1.69 built (downloaded source and ran ./configure && make install)
Edit
I think configure: error: leptonica library missing is a bit misleading, please note that it first says checking for leptonica... yes, and then fails on checking for pixCreate in -llept... no. So maybe the problem is not that the library is missing, but something else.

I finally managed to make it compile, after reading this and this thread. The proper steps for were:
./autogen.sh
export LIBLEPT_HEADERSDIR=/local/include
./configure --with-extra-libraries=/local/lib
make install

for leptonica 1.69, lib renamed to .libs, so, parameters are
export LIBLEPT_HEADERSDIR=<your_path>/leptonica-1.69/src
./autogen.sh
./configure --prefix= --with-extra-libraries=<your_path>/leptonica-1.69/src/.libs
and so on

Maybe this could solve the issue:
export LIBLEPT_HEADERSDIR=/usr-or-other/local/include

I am working on redhat linux 7.2 . None of the solution worked for me I was getting following errors in config.log. Package lept was not found in the pkg-config search path.
Perhaps you should add the directory containing `lept.pc'
to the PKG_CONFIG_PATH environment variable PKG_CONFIG_PATH
configure script uses pkg-config utility to check for packages . It was not able to find lept package ( although i had installed leptonica seperately ) By setting PKG_CONFIG_PATH pointing to the directory where lept.pc is present , i was able to resolve the issue . export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

The FAQ addresses this issue and worked for me with tesseract 3.02.02 on Mac OSX 10.6.8.

Apart from the Leptonica library, png, jpeg, tiff libraries had to passed to the configure script with CXX and CPP flags.
To run configure as non-root -
1. LIBLEPT_HEADERSDIR=; export LIBLEPT_HEADERSDIR;
2. CXXFLAGS="-ltiff -lpng -ljpeg" CPPFLAGS="-ltiff -lpng -ljpeg" ./configure --prefix= --with-extra-libraries=

In my case, this issue was caused by a missing compiler. Searching config.log revealed the following:
./configure:17287: g++ -o conftest -I/Usr/local/include/leptonica -L/usr/local/lib conftest.cpp -llept >&5
./configure: line 2040: g++ command not found
Running apt-get install g++ solved the problem. There is an issue in the tesseract issue tracker about this.

In my case (for Ubuntu/Debian) I downloaded the latest leptonica version and the error was not fixed.
To fix it I removed the package "leptonica-dev" with sudo apt-get remove libleptonica-dev and then tesseract found the leptonica version installed from the source code.
Hope it helps!

The answer is going to be slightly different for everyone, depending on the state of your system.
At a high level, the pkg-config software needs to know that leptonica is installed. It searches paths for a .pc file that has the definition for the leptonica package. That file will be in different locations for different people.
You can find it using the Linux locate utility at the command line. locate lept.pc. (If you've done some recent installing/uninstalling, you may need to refresh the locate utilities database with the command updatedb.)
Whichever directory locate finds the file in, export PKG_CONFIG_PATH as that directory (export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig for example).
Then you can continue your configure/build.

i had a similar problem with trying to compile from source, but did not experience it with
apt-get to install tesseract
sudo apt-get install tesseract-ocr

export LIBLEPT_HEADERSDIR=$dir/letonica168/include
./autogen.sh
./configure --prefix=$anotherdir --with-extra-libraries=/$dir/letonica168/lib
make
make install

Related

Compiling FileZilla on OSX

I've been trying to compile the FileZilla versions 3.11 and 3.24 on Mac for a research project but when I run ../configure I get the following error:
configure: error: libgnutls 3.1.12 greater was not found. You can get it from http://gnutls.org/
However, I've installed gnutls using homebrew; when I run
brew list gnutls
I can see the library installed at /usr/local/Cellar/gnutls/3.5.8/
Any ideas to resolve the problem are appreciated. Thanks
Updated Answer
It seems that GNUtls, as installed by homebrew ships with a pkgconfig file. So, you need to install pkgconfig if you don't have it already using:
brew install pkgconfig
Then, once you have that, you can find the compiler include file settings with:
pkg-config --cflags gnutls
Sample Output
-I/usr/local/Cellar/gnutls/3.5.8/include -I/usr/local/Cellar/nettle/3.3/include -I/usr/local/Cellar/libtasn1/4.10/include -I/usr/local/Cellar/p11-kit/0.23.3/include/p11-kit-1
And the linker library settings with:
pkg-config --libs gnutls
Sample Output
-L/usr/local/Cellar/gnutls/3.5.8/lib -lgnutls
So, we (just) need to convey that information to FileZilla. So, first we run:
./configure --help | grep -i utls
Sample Output
--enable-gnutlssystemciphers
Enables the use of gnutls system ciphers.
LIBGNUTLS_CFLAGS
C compiler flags for LIBGNUTLS, overriding pkg-config
LIBGNUTLS_LIBS
linker flags for LIBGNUTLS, overriding pkg-config
So it looks like we need to do something like:
export LIBGNUTLS_CFLAGS=$(pkg-config --cflags gnutls)
export LIBGNUTLS_LIBS=$(pkg-config --libs gnutls)
./configure
Original Answer
I haven't tried this with FileZilla, but I use it with other packages, and there is nothing to lose...
If homebrew has installed your GNUtls in /usr/local/Cellar/gnutls/3.5.8/, you could try telling FileZilla that location in your configure like this:
./configure CPPFLAGS="-I/usr/local/Cellar/gnutls/3.5.8/include" LDFLAGS="-L/usr/local/Cellar/gnutls/3.5.8/lib" ... other flags

gcc unable to find shared library libisl.so

I installed gcc version 5.1 locally on a cluster having OS as CentOS where I dont have root access (so i cant use any commands like 'sudo'). (The global gcc version installed is 4.4). I also modified the path variable to include the path to my local version at the beginning of the path variable. Before, when I was trying to install boost using the global version, it worked fine. But now, when I try to install boost, it shows the following error:
/users/home/head/cmp/soft/sft/gcc/bin/../libexec/gcc/x86_64-unknown-linux-gnu/5.1.0/cc1: error while loading shared libraries: libisl.so.10: cannot open shared object file: No such file or directory
Any ideas on how to fix this will be highly appreciated.
Follow the instructions at https://gcc.gnu.org/wiki/InstallingGCC
Specifically, don't install ISL manually in some non-standard path, because GCC needs to find its shared libraries at run-time.
The simplest solution is to use the download_prerequisites script to add the GMP, MPFR, MPC and ISL source code to the GCC source tree, which will cause GCC to build them for you automatically, and link to them statically.
I have the same issue. I solved it as follows:
Download the source code of isl available here
Unzip and install: ./configure && make && make install
cp /usr/local/lib/libisl* /usr/lib
Note: a symlink also works:
$ cd /usr/lib
$ ln -s /usr/local/lib/libisl.so.10 libisl.so.10
You can do the same in Debian distros:
apt-get install libisl-dev
Adjust the references of shared libs:
$ cp /usr/local/lib/libisl* /usr/lib
Note: a symlink also works:
$ cd /usr/lib
$ ln -s /usr/local/lib/libisl.so.10 libisl.so.10

Compiling gcc-4.1

Unfortunately I'm forced to use gcc-4.1 and I'm using debian wheezy. Since gcc-4.1 is not in repository I'm trying to build gcc from sources.
But I'm getting compiling error:
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.a when searching for -lc
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/x86_64-linux-gnu/crti.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/x86_64-linux-gnu/crtn.o' is incompatible with i386 output
It looks that ld is picking wrong version of libraries, but I checked my /usr/lib32 and /usr/lib/x86_64-linux-gnu/ and it contains those files:
/usr/lib32/libc.a
/usr/lib32/libc.so
/usr/lib32/crtn.o
/usr/lib32/crti.o
/usr/lib/x86_64-linux-gnu/libc.a
/usr/lib/x86_64-linux-gnu/libc.so
/usr/lib/x86_64-linux-gnu/crtn.o
/usr/lib/x86_64-linux-gnu/crti.o
And ld should have access to them
~$ echo $LIBRARY_PATH
/usr/lib/x86_64-linux-gnu:/usr/lib32/
So I have no idea where the problem is.
I managed to work around the problem.
Run configure with:
./configure --disable-multilib ...
But than I encountered another problem with makeinfo, if you have newer version >=4.10 than it might not be found by configure. So simple fix in generated makefile worked for me:
Change this line:
MAKEINFO = /home/lecopivo/Downloads/gcc412/gcc412/gcc-4.1.2/missing makeinfo
To this:
MAKEINFO = makeinfo
I found this helpful.
LD_LIBRARY_PATH is only for running programs already linked.
You probably need to set LDFLAGS when you configure gcc:
./configure LDFLAGS="-L/usr/lib32" .....
It might be LDFLAGS_FOR_HOST or LIBS or something like that though.
I had this problem recently and finally solved it this way:
ln -s /usr/lib32 /usr/lib/i386-linux-gnu
Notes:
I assumed you do not have /usr/lib/i386-linux-gnu directory in your 64bit linux. If this directory exists and is empty, please delete it and make the above link.
If the directory already exists and is not empty, you have to make links inside it for (32bit) libraries which cause build error one by one; e.g.:
ln -s /usr/lib32/crti.o /usr/lib/i386-linux-gnu/crti.o
ln -s /usr/lib32/crtn.o /usr/lib/i386-linux-gnu/crtn.o
...
If 32bit development libraries are not installed, you may have to install them first. I've searched different forums and found that installing following set of packages in ubuntu will provide them:
libc6-dev libc6-dev-i386
gcc-multilib g++-multilib
zlib1g-dev lib32z1-dev
libncurses5-dev lib32ncurses5-dev libncursesw5-dev lib32ncursesw5-dev
Also adjust LD_LIBRARY_PATH and LIBRARY_PATH variables so that they contain /usr/lib/i386-linux-gnu and /usr/lib/x86_64-linux-gnu (i.e. multiarch lib-dirs). I am not sure which one of above variables is effective, so I adjust both of them the same.
If you use ./configure --disable-multilib as it is frequently suggested on web, though gcc will be built, but when you want to use that gcc for compiling e.g. legacy grub, you probably get error of "gcc cannot build executable" (or such).
Optionally, you can make similar linking for these pair of libdirs:
ln -s /lib32 /lib/i386-linux-gnu
Doing so, I managed to compile gcc-3.4.6 in a Ubuntu 16.04.6-amd64 used for compiling old 32bit programs like SDL 1.2 and legacy GRUB4DOS 0.4.4.
Also take a look at my answer to similar (though opposite) error here.
Good luck.

configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+

I am attempting to build GCC-4.7.0 on a MacBook Pro running OS X 10.7.4. However, I am continuing to experience the same error:
configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
This error occurred after running the following line:
./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/
To get rid of this error I have tried the following actions:
Using homebrew I downloaded gmp-5.0.4, mpc-0.21, and mpfr-3.1.0. At this point I attempting to point to where gmp, mpc, and mpfr are located with the following command:
./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/ --with-gmp=/usr/local/Cellar/ --with-mpfr=/usr/local/Cellar/ --with-mpc=/usr/local/Cellar/
However, this caused the same error. So, I tried pointing gcc to various locations around the Cellar directory:
./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/ --with-gmp=/usr/local/Cellar/gmp/ --with-mpfr=/usr/local/Cellar/mpfr --with-mpc=/usr/local/Cellar/mpc/
./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/ --with-gmp=/usr/local/Cellar/gmp/5.0.4/ --with-mpfr=/usr/local/Cellar/mpfr/3.1.0/ --with-mpc=/usr/local/Cellar/mpc/0.21/
./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/ --with-gmp=/usr/local/Cellar/gmp/5.0.4/include/ --with-mpfr=/usr/local/Cellar/mpfr/3.1.0/include/ --with-mpc=/usr/local/Cellar/mpc/0.21/share/
In the end these all produced the same error. I then downloaded the versions of gmp, mpc, and mpfr linked from the gcc error message (found here: ftp://gcc.gnu.org/pub/gcc/infrastructure/). After building these from the source and running all the same configurations I am left with the same problem. The configurations I have tried with this installation are:
./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/
./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/ --with-gmp=/usr/local/ --with-mpfr=/usr/local/ --with-mpc=/usr/local/
./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/ --with-gmp=/usr/local/include/ --with-mpfr=/usr/local/include/ --with-mpc=/usr/local/include/
Then I read somewhere that there could be a problem if I didn't explicitly set the configuration to run in 64-bit mode. So, I tried all of these configurations again with the added setting of 'CC=gcc -m64'. But this didn't change anything. If anyone has any ideas I would be greatly appreciative.
If you don't know how to build and properly direct GCC's configure to the libraries you can put them in the source tree of GCC itself:
/some/dir/source/gcc/[libstdc++|libgomp|gcc|libiberty|....]
/some/dir/source/gcc/gmp/[configure|...]
/some/dir/source/gcc/mpfr/[configure|...]
/some/dir/source/gcc/mpc/[configure|...]
So without the version number appended. Then just run GCC configure without any arguments related to GMP/MPC/MPFR.
I've faced the same issue and it was easily solved by installing the corresponding development packages: gmp-devel, mpfr-devel and libmpc-devel
Yigal
EasyBuild (a tool to make building software easier) can be of help here. It comes with a small easyconfig file that specifies which GCC version to build, and which features to enable (see for example https://github.com/hpcugent/easybuild/blob/master/easybuild/easyconfigs/g/GCC/GCC-4.7.0.eb).
Once you've downloaded EasyBuild and configured it, you can just run
$EBHOME/easybuild.sh myGCC.eb
with EBHOME set to the location where you unpacked EasyBuild, and myGCC.eb a copy of the example GCC easyconfig, which you modified to your needs.
This command will download the GCC source tarball for you and build/install it, after doing the same to any dependencies, for example GMP, MPFR and MPC, saving you a lot of headaches.
For more information on EasyBuild, see https://github.com/hpcugent/easybuild/wiki .

Cannot configure gcc - mpfr not found

I'm installing gcc 4.5.2 with mpc 0.8.2, mpfr 3.1.0, and gmp 5.0.2. I've copied each of the mpc, mpfr, and gmp directories into the gcc-4.5.2 directory (removing the version tags). GCC successfully configures. When I run make, however, I get:
checking for MPFR... no
configure: error: libmpfr not found or uses a different ABI.
make[1]: *** [configure-mpc] Error 1
make[1]: leaving directory cross/build/gcc
make: *** [all] Error 2
MPFR is located in cross/src/gcc-4.5.2/mpfr. MPFR already was built successfully. Anyone know why mpc is unable to configure?
I think the problem may partially have to do with the libs/headers for MPFR being in cross/src/gcc-4.5.2/mpfr/src and not in cross/src/gcc-4.5.2/mpfr. All I did was extract and copy though- this is the default directory structure.
I was having the same issue.
But it seems this happens because latest version of MPFR (in your case 3.1.0) changed the directory hierarchy.
Instead, before configuring, run the following when you are inside gcc's source directory (may only work for gcc4.5.2 or later):
./contrib/download_prerequisites
It will download the necessary MPFR, GMP and MPC versions (but probably not the latest versions) and unpack those for gcc installation.
After that, you can continue with your configure, make and make install.
Hope this helps.
-Rakib
I found that if I ran export C_INCLUDE_PATH=/cross/gcc-4.5.2/mpfr/src then export LD_LIBRARY_PATH=/cross/build-gcc-4.5.2/mpfr/src/.libs and finally export LIBRARY_PATH=$LD_LIBRARY_PATH everything worked as expected.
The nagging question is why gcc's own configure scripts set the flags wrong. It should know that mpfr's libs are not in mpfr/.libs but in mpfr/src/.libs, however it passes the former to mpc/configure.
Try this while configuring:
./configure --prefix=<DIR YOU WANT TO INSTALL GCC> \
--with-gmp=<DIRECTORY YOU INSTALLED GMP> \
--with-mpc=<MPC DIR> --with-mpfr=<MPFR DIR>
I've had the same problem for a few hours, but I solved it in another other way.
I've deleted all old folders like gcc-4.* and gcc-build, because there was an old configuration inside. After that, I checked out again with version-check.sh if everything was in the right location.
I used Debian and it was missing bison and gnu awk! Why whatever. I installed the two again and started with installing gcc. Now everything is OK.
Perhapse you have a similar problam which can be solved in the same manner. I have to check every time when I start vbox and maybe it is a problem with my vbox-image, so when I start vbox I run a versions-check.
No need you can try like this:
./configure \
--with-gmp=/opt/install/local\
--with-mpfr=/opt/install/local \
--with-mpc=/opt/install/local \
--with-gmp-include=/opt/install/build/gmp-6.0.0 \
--with-mpfr-include=/opt/install/build/mpfr-3.1.2/src \
--with-mpc-include=/opt/install/build/mpc-1.0.2/src --enable-languages=c,c++
instead of --with-mpfr=, I used --with-mpfr-lib=your-mprf-dir/lib(64?) --with-mpfr-include=your-mprf-dir/include.
This works for me.
PS: mprf-3.1.0 gmp-5.0.2 mpc-0.9

Resources