How to find where older version of GLIB has been installed? - linux

I am trying to install atk-2.4.0 and I get the error:
'pkg-config --modversion glib-2.0' returned 2.32.3, but GLIB (2.26.1)
*** was found!
I also tried updating PKG_CONFIG_PATH to include the path of glib-2.0.pc but still same error appears. Could anyone help me how to find where 2.26.1 was installed I am relatively new to Ununtu? Thanks.

Posting comments as response:
From find /usr/ -iname "*glib*.pc" it is found that there .pc file related to glib is available in /usr/lib/pkgconfig & /usr/local/lib/pkgconfig. Checking the system package management it appears that version 2.26.1 is installed from the repositories. The path for installation of glib from repositories is generally /usr/lib (This may vary a bit in case of 64 bit systems wherein there are different folders for 32 bit & 64 bit libraries). Thus it appears that glib also has been installed from source (guessing by installation path /usr/local/lib) which of version 2.32.2. If you need version 2.32.2 set PKG_CONFIG_PATH to /usr/local/lib/pkgconfig & LD_LIBRARY_PATH to /usr/local/lib/
Hope this helps!

You have to synchronize you PKG_CONFIG_PATH and LD_LIBRARY_PATH environment variables. Assuming that your prefix is /usr/local the followings should be set:
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
LD_LIBRARY_PATH=/usr/local/lib
You may also need to set other variables to compile glib dependent softwares:
ACLOCAL_PATH=/usr/local/share/aclocal/
PATH=/usr/local/bin:$PATH

Related

Cabal don't find relative library for compilation of gsasl package

I'm using Haskell on webfaction server, with non root access, on a CentOS 6 system.
I have a /lib/ folder which contain libraries.
Actually, i have a problem with some libraries needed for an installation of package using cabal install.
I need the libgsasl library installed, so i download and compile the gsasl package from sources :
I wget the latest tar.gz here
I run ./configure --prefix=$HOME to install compiled libraries into $HOME/lib
i make and make install
Next, i try two way with cabal install gsasl command, which actually fails :
export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH
cabal install gsasl --bindir=$HOME/bin --extra-include-dirs=/home/reyman64/lib/ --extra-lib-dirs=/home/reyman64/lib
Any of the command found the good libraries ...
The pkg-config package 'libgsasl' version superior to 1.1 is required but it could not be found.
So i verify, my version is 1.8, and i have the libgsasl.sa .la .so .so.7 .so.7.9.6 in $HOME/lib and i have a libgsasl.pc into $home/lib/pkgconfig
Any idea of the problem ?
Make sure your PKG_CONFIG_PATH environment variable is set to include $HOME/lib/pkgconfig, i.e. the directory where you've placed libgsasl.pc.

node.js could not use lib in /usr/local/lib

I'm using a node module png which use libpng. After installing libpng, I find some libs in /usr/local/lib. I require the png module:
var png = require('png')
It complained that libpng16.so could not be found.
Error: libpng16.so.16: cannot open shared object file: No such file or directory
But libpng16.so.16 does exist in /usr/local/lib. Then I copy all libpng* to /usr/lib and run code above again, no error for this time!
My question: how could I let Node search libs in /usr/local/lib?
Thanks!
This is a Linux "installing libraries" issue, not a node.js issue (I was confused by the same thing & landed here looking for ideas).
make install will typically copy the library to /usr/local/lib and output some boilerplate suggesting that you modify LD_LIBRARY_PATH or update the ld config. But it doesn't do this for you.
(One thing that can make this more confusing is that the compiler toolchain will search /usr/local by default, so any dependent libraries will compile/link fine.)
Running ldconfig (/sbin/ldconfig) as root or with sudo will update the run-time linker cache, and fix the problem. If not, check that at least one of /etc/ld.so.conf or any of the files in /etc/ld.so.conf.d/ contains the line '/usr/local/lib'.
For more information, run man ldconfig

How to tell Autotools Build System (Guile 1.8.8) Where Libtool is Installed?

I am trying to build Guile 1.8.8 from source. I am stuck at the point where the build system is looking for libtool. I have installed it in a non-standard location.
I have already built Guile 2.0.11. In 2.0.11 build system, there is an explicit flag to configure --with-libltdl-prefix, which I think tells the build system where libtool is installed.
For Guile 1.8.8, I have Libtool installed in a non-standard location. How do I tell the build system where it is installed?
I am specifically getting error messages like:
libguile/Makefile.am:40: Libtool library used but `LIBTOOL' is undefined
libguile/Makefile.am:40: The usual way to define `LIBTOOL' is to add `LT_INIT'
I think in general this is a question regarding one or more of the autotools and how the build system finds programs / headers / libraries in non-standard locations.
This link is informative: How to point autoconf/automake to non-standard packages
Find the directory where *.m4 exists, which corresponds to libtool, or package which is in non-standard location.
export ACLOCAL_PATH=/path/to/m4/file
cd /path/to/configure.[in,ac]
autoreconf -if
./configure

CMake looking for Qt libraries in the wrong path on Ubuntu

CMake on ubuntu is giving me the following error
CMake Error at blah/CMakeLists.txt:19 (ADD_LIBRARY)
Cannot find source file:
/usr/lib/libQtGui.so
The relevant part of CMakeLists.txt is this
FIND_PACKAGE (Qt4 REQUIRED)
INCLUDE(${QT_USE_FILE})
INCLUDE_DIRECTORIES (${QT_INCLUDES})
QT4_WRAP_CPP (QT_SRCS ${HEADERS})
ADD_LIBRARY (blah ${CPP} ${QT_SRCS} ${QT_LIBRARIES})
A little investigation shows that libQtGui.so and its friends live in /usr/lib/i386-linux-gnu (which is correct) instead of /usr/lib as CMake thinks it does.
This build environment worked fine a few months ago. No source or config files have changed, but the software packages have been routinely updated.
What has changed? How can I fix this?
As noted in the answer to this question, the problem is that Ubuntu 12.04 installs libraries to nonstandard paths.
The fix is
export LIBRARY_PATH=/usr/lib/i386-linux-gnu/
export C_INCLUDE_PATH=/usr/include/i386-linux-gnu
export CPLUS_INCLUDE_PATH=/usr/include/i386-linux-gnu

Find libffi header files with CMake

I require libffi to build my C++ project. The problem is that there exists no premade script to find libffi and ffi.h is located at strange locations depending on the version of the library and the Linux distribution.
The is my attempt:
# Look for the header file.
Find_Path(LIBFFI_INCLUDE_DIR NAMES ffi.h)
Mark_As_Advanced(LIBFFI_INCLUDE_DIR)
# Look for the library.
Find_Library(LIBFFI_LIBRARY NAMES
ffi
)
Mark_As_Advanced(LIBFFI_LIBRARY)
# handle the QUIETLY and REQUIRED arguments and set LIBFFI_FOUND to TRUE
# if all listed variables are TRUE
Include(FindPackageHandleStandardArgs)
Find_Package_Handle_Standard_Args(libffi DEFAULT_MSG
LIBFFI_LIBRARY LIBFFI_INCLUDE_DIR)
If(LIBFFI_FOUND)
SET(LIBFFI_LIBRARIES ${LIBFFI_LIBRARY})
SET(LIBFFI_INCLUDE_DIRS ${LIBFFI_INCLUDE_DIR})
Endif(LIBFFI_FOUND)
But it obviously doesn't work because Find_Path() doesn't search recursivly.
How to do it better?
I tried to use CMake's pkg-config module, but pkg-config can't find it either.
[ethon#Fleckstation Paper]$ pkg-config --cflags libffi Package libffi
was not found in the pkg-config search path. Perhaps you should add
the directory containing `libffi.pc' to the PKG_CONFIG_PATH
environment variable No package 'libffi' found
Thanks!
I am the author of libffi. pkg-config should find it. What system are you working on? Do you have a libffi.pc file anywhere on your system?
Take a look at how it's implemented in LLVM project. Search for if( LLVM_ENABLE_FFI ) line.

Resources