Configure fails on `PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.12.3)' - configure

I am attempting to create a fairly simple BitBake recipe that uses autotools, which you can see here:
SUMMARY = "an example autotools recipe"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
inherit autotools
SRC_URI = "file://${TOPDIR}/piu/geo_utilities"
S = "${TOPDIR}/piu/geo_utilities"
After starting a BitBake build with this recipe's default package included, do_configure fails with the following:
configure: line 12851: syntax error near unexpected token `GLIB,'
configure: line 12851: `PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.12.3)'
When I run ldd --version, I get this: ldd (GNU libc) 2.17.
I've found several sites like this Google Groups post and this GitHub issue which suggest that the problem can be solved by updating pkg-config. I'm running Red Hat, so I've run sudo yum install pkgconfig which returns that pkgconfig-0.27.1-4.el7.x86_64 already installed and latest version.
(this question followed after this question was solved by the answerer)

The proper fix is to inherit pkgconfig. Specifically you need pkgconfig-native built.

I believe that this error was due to the do_configure step of my custom recipe being ran before the glib for my target machine was generated. I was able to resolve this error by adding this line to the recipe:
DEPENDS += " glib-2.0 pkgconfig "

Related

XML::LibXML - problem installing the module on a fresh macOS BigSur

I've been successfully using XML::LibXML module for a while on macOS.
Now I am trying to install it on a new machine with macOS BigSur:
perl Makefile.PL
make
make test
make install
However, in "make test" I get multiple errors of the kind:
t/00-report-prereqs.t .............................. ok
t/01basic.t ........................................
Can't load '/Users/lockit/Desktop/TESTS_Irina/XML-LibXML-2.0204/blib/arch/auto/XML/LibXML/LibXML.bundle'
for module XML::LibXML: dlopen(/Users/lockit/Desktop/TESTS_Irina/XML-LibXML-2.0204/blib/arch/auto/XML/LibXML/LibXML.bundle, 0x0002):
symbol '_xmlFree' not found, expected in flat namespace by
'/Users/lockit/Desktop/TESTS_Irina/XML-LibXML-2.0204/blib/arch/auto/XML/LibXML/LibXML.bundle'
at /System/Library/Perl/5.28/darwin-thread-multi-2level/DynaLoader.pm line 197.
at /Users/lockit/Desktop/TESTS_Irina/XML-LibXML-2.0204/blib/lib/XML/LibXML.pm line 156.
BEGIN failed--compilation aborted
at /Users/lockit/Desktop/TESTS_Irina/XML-LibXML-2.0204/blib/lib/XML/LibXML.pm line 156.
Compilation failed in require at t/01basic.t line 6.
And the module cannot be installed.
Any hints what I am missing and how to fix?
Thanks,
Irina
Have you read the README for the module? It includes the following:
DEPENDENCIES
============
Prior to installation you MUST have installed the libxml2 library. You can get the
latest libxml2 version from
http://xmlsoft.org/
Without libxml2 installed this module will neither build nor run.
Also XML::LibXML requires the following packages:
o XML::SAX - base class for SAX parsers
o XML::NamespaceSupport - namespace support for SAX parsers
These packages are required. If one is missing some tests will fail.
Again, libxml2 is required to make XML::LibXML work. The library is not just required
to build XML::LibXML, it has to be accessible during run-time as well. Because of
this you need to make sure libxml2 is installed properly. To test this, run the
xmllint program on your system. xmllint is shipped with libxml2 and therefore should
be available. For building the module you will also need the header file for libxml2,
which in binary (.rpm,.deb) etc. distributions usually dwell in a package named
libxml2-devel or similar.
So you need to have libxml2 (and its development header files) installed on your system.
Looks like it's an issue with Apple's dynamic linker as described here:
https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/381.
I installed the suggested ExtUtils-MakeMaker-7.58 module and this solved the initial issue.
However, now there is a new error on make:
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- LibXML.bs blib/arch/auto/XML/LibXML/LibXML.bs 644
cc -c -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -g -pipe -fno-strict-aliasing -fstack-protector-strong -DPERL_USE_SAFE_PUTENV -Wno-error=implicit-function-declaration -Os -DVERSION="2.0206" -DXS_VERSION="2.0206" "-I/System/Library/Perl/5.28/darwin-thread-multi-2level/CORE" -DHAVE_UTF8 Av_CharPtrPtr.c
Av_CharPtrPtr.c:6:10: fatal error: 'EXTERN.h' file not found
#include "EXTERN.h"
Any clue?

make: f77: No such file or directory

Whilst attempting to make/compile the grafic package, I'm seeing this error after calling the make command within the grafic directory:
f77 -O2 -c grafic1.f
make: f77: No such file or directory
make: *** [grafic1.o] Error 1
I have XCode and all associated command line tools installed, what could be causing this error?
This error is make telling you that you have no binary in your path called f77. There are two things you need to look at the fix this:
Do you have a Fortran compiler installed? MacOS X/Xcode does not come pre-installed with one by default. The easiest options to install one are via third-party tools like macports or homebrew where you can install gfortran which may be a standalone package or may be part of the gcc package.
Once you have a compiler installed, your makefile needs to know about it. Without seeing the makefile this is only an assumption, but if autotools are not used the fortran compiler is usually hardcoded in a variable called FC, e.g. you might see a line
FC=f77
and you would change this to
FC=gfortran
assuming gfortran is in your path.
Once you have a Fortran compiler installed and the makefile knows about it, you should be able to execute make successfully.

ld: library not found for -lgsl

I'm working in OSX and I'm attempting to run a make file and when I try I get the following:
ld: library not found for -lgsl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [harm] Error 1
Earlier I found out the I needed to get the gsl library and I used mac ports and typed:
sudo port install gsl
into my command line window and it seemed to isntall okay. Is the missing lgsl not configured correctly or does it not come with gsl? I tried googling lgsl but didn't get much. I've only been at programming a few days and I don't know if I was supposed to set a path, or even really how to do that.
Thanks for any help you guys could offer.
I just wanted to say that I had the exact problem on OSX. Rather than setting an environment variable, I used an additional compiler flag -L/opt/local/lib, which then lets one use -lgsl. I reference this answer.
I got the same issue and here is how I fixed it:
export LIBRARY_PATH=/usr/local/Cellar/gsl/1.16/lib/
I had previously installed gsl using:
brew install gsl
You need to add the path for where the macports installed the gsl library to your LD_LIBRARY_PATH environment variable (or most likely into the build script environment). I believe macports stores things in /opt/local/lib

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

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

boost library gives errors on ubuntu

I am trying to compile a package on ubuntu 8.1
when executing this command: ./configure I get the follwoing error:
checking for Boost headers version >= 103700... no
configure: error: cannot find Boost headers version >= 103700
knowing that I installed needed boost packages using these command:
$ apt-get install libboost-dev libboost-graph-dev libboost-iostreams-dev
Can anybody help please?
thank you. Now it works but i get another error when running ./configure: checking boost/iostreams/device/file_descriptor.hpp usability... yes checking boost/iostreams/device/file_descriptor.hpp presence... yes checking for boost/iostreams/device/file_descriptor.hpp... yes checking for the Boost iostreams library... no configure: error: cannot not find the flags to link with Boost iostreams any ideas please?
It could be that the version of boost that you're getting from the Ubuntu repository is too old (it's suggested here that the highest version for 8.10 is 1.35; it looks like your configure script is asking for 1.37). You might need to build from source; there's some more info in the answers to the question I linked to which will hopefully help.
UPDATE:
From your new error, it sounds like configure now can't find the boost_iostreams library. On my system it's /usr/lib/libboost_iostreams-mt.[a|so] - do you have those files (possibly in a different directory depending on where you installed boost)?
You can also try running ldconfig in case there's a missing symlink (from, say,
libboost_iostreams-mt.so.1.37.0 to libboost_iostreams-mt.so).
Is this configure one generated by GNU autoconf? If it is, there should be a file called config.log in the same directory which contains a list of all the commands configure tried to run when looking for things. If there's anything in there about boost_iostreams could you post it?
One totally random guess: some examples I've found on the web link to boost_iostreams without the multi-threading suffix -mt - but I don't have those on my machine at all. Maybe your configure script is running into the same problem?
UPDATE 2
The configure script seems to be looking for a single-threaded debug build of the boost iostreams library, which won't be produced by default when building from source on linux. Also, the default on linux is not to name the libraries based on the build configuration (so the libs you found in /usr/lib might not be the ones you installed from source unless you overrode this). This stuff isn't really explained on the boost website, I only found out by looking in the Jamroot file (bjam --help works too)! Anyway, to get a library with the right build configuration, and named correctly, I need to go into the root of the boost source tree and run:
sudo bjam --with-iostreams --layout=tagged variant=debug threading=single install
For me this puts the libraries (libboost_iostreams-d.a and the shared versions) into /usr/local/lib where ld will find them by default, so this should be fine. If you need them to go somewhere else you can use the --prefix=... option to bjam eg. if you want them in /usr/lib you can do --prefix=/usr. If the package you're building needs more boost libraries you can remove the --with-iostreams and then they'll all be built (or replace iostream with the name of each other library you need).
A side note: I had to install the libbz2-dev package to get boost iostreams to build - it's easy to miss the error here if you build all of boost as there's so much output!

Resources