Pkg-config file is on the pkg-config path but can not be found by configure script - c

I am trying to install libvirt from source. The version I am trying to install is 1.2.7. I want libssh2 enabled. Here is how I call the configure script:
./configure --prefix=/home/administrator/dev/workspaces/libvirt/built/libvirt-1.2.7/ --with-sasl --with-qemu --with-lxc --with-gnutls --with-remote --with-ssh2 --with-polkit
I got the following error:
configure: error: You must install the libssh2 >= 1.3 pkg-config module to compile libvirt
I downloaded the libssh2 lib version 1.4.3 and installed it using the default options:
$ ./configure
$ make
$ sudo make install
Here is some useful info:
$ sudo ldconfig
$ sudo updatedb
$ locate libssh2.so
/usr/local/lib/libssh2.so
/usr/local/lib/libssh2.so.1
/usr/local/lib/libssh2.so.1.0.1
$ locate libssh2.pc
/usr/local/lib/pkgconfig/libssh2.pc
$ pkg-config --variable pc_path pkg-config
/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
Obviously the libssh2.pc file is on the pkg-config path. However, when I tried executing the configure script for libvirt, the same error occurred. Any ideas what I am doing wrong ? Thank you.
EDIT: Fragment of the config.log file:
34475 configure:59141: checking for SSH2
34476 configure:59148: $PKG_CONFIG --exists --print-errors "libssh2 >= 1.3"
34477 configure:59151: $? = 0
34478 configure:59165: $PKG_CONFIG --exists --print-errors "libssh2 >= 1.3"
34479 configure:59168: $? = 0
34480 configure:59182: result: no
34481 Package libssl was not found in the pkg-config search path.
34482 Perhaps you should add the directory containing `libssl.pc'
34483 to the PKG_CONFIG_PATH environment variable
34484 Package 'libssl', required by 'libssh2', not found
34485 configure:59225: error: You must install the libssh2 >= 1.3 pkg-config module to compile libvirt
...
34576 ac_cv_env_PKG_CONFIG_LIBDIR_set=
34577 ac_cv_env_PKG_CONFIG_LIBDIR_value=
34578 ac_cv_env_PKG_CONFIG_PATH_set=
34579 ac_cv_env_PKG_CONFIG_PATH_value=
34580 ac_cv_env_PKG_CONFIG_set=
34581 ac_cv_env_PKG_CONFIG_value=
...
34874 ac_cv_path_ac_pt_PKG_CONFIG=/usr/bin/pkg-config
36432 PKG_CONFIG='/usr/bin/pkg-config'
36433 PKG_CONFIG_LIBDIR=''
36434 PKG_CONFIG_PATH=''

Related

Static library -lzita-resampler installed in /usr/local/lib unable to be found when using gcc

I'm trying to install a binary called audiowmark (link) from source on my Mac. The instructions say to run ./configure but when I do that, I run in to an error that claims:
checking for _Z28zita_resampler_major_versionv in -lzita-resampler... no
configure: error: You need to install libzita-resampler to build this package.
As a result, I need to install the libzita-resampler library. As a novice in C/CMake/Make, this is where things got a bit confusing for me. I think I'm installing this package correctly (I see the libzita-resampler.a in my usr/local/lib), but I still receive the above error. Can someone help guide me in the right direction to ensure I installed correctly? From my understanding, /usr/local/lib is a default path that is checked for libraries when running gcc.
To install libzita-resampler, I found the GitHub repo (link) and loaded the source to my computer.
I first created a build directory in this library and cd-ed in to it:
mkdir build && cd build
With cmake installed, I was able to run
cmake ..
Which created the Makefile for my computer, I then ran the following commands with Make
make
Which output the following
jordan#Jordans-MBP-3 build % make
[ 20%] Building CXX object CMakeFiles/zita-resampler.dir/source/resampler.cc.o
[ 40%] Building CXX object CMakeFiles/zita-resampler.dir/source/vresampler.cc.o
[ 60%] Building CXX object CMakeFiles/zita-resampler.dir/source/resampler-table.cc.o
[ 80%] Building CXX object CMakeFiles/zita-resampler.dir/source/cresampler.cc.o
[100%] Linking CXX static library libzita-resampler.a
[100%] Built target zita-resampler
And therefore ran the install step
make install
Which output
jordan#Jordans-MBP-3 build % make install
[100%] Built target zita-resampler
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/lib/libzita-resampler.a
-- Installing: /usr/local/lib/cmake/zita-resampler/zita-resamplerConfig.cmake
-- Installing: /usr/local/lib/cmake/zita-resampler/zita-resamplerConfigVersion.cmake
-- Installing: /usr/local/lib/cmake/zita-resampler/zita-resamplerTargets.cmake
-- Installing: /usr/local/lib/cmake/zita-resampler/zita-resamplerTargets-noconfig.cmake
Which successfully added the static library .a to my lib directory.
So with this set up, I'd assume I would be able to then run the audiowmark's ./configure command again but I still receive the same error indicating that I didn't install this library correctly. Is there a final step to get the ./configure step to "find" this new library that I installed that I missed?
Here's the relevant code that looks for the library in the ./configure script. I see that it's adding LIBS= -lzita-resampler so it should find it in my directory path now...right?
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _Z28zita_resampler_major_versionv in -lzita-resampler" >&5
printf %s "checking for _Z28zita_resampler_major_versionv in -lzita-resampler... " >&6; }
if test ${ac_cv_lib_zita_resampler__Z28zita_resampler_major_versionv+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lzita-resampler $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
char _Z28zita_resampler_major_versionv ();
int
main (void)
{
return _Z28zita_resampler_major_versionv ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_zita_resampler__Z28zita_resampler_major_versionv=yes
else $as_nop
ac_cv_lib_zita_resampler__Z28zita_resampler_major_versionv=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_zita_resampler__Z28zita_resampler_major_versionv" >&5
printf "%s\n" "$ac_cv_lib_zita_resampler__Z28zita_resampler_major_versionv" >&6; }
if test "x$ac_cv_lib_zita_resampler__Z28zita_resampler_major_versionv" = xyes
then :
printf "%s\n" "#define HAVE_LIBZITA_RESAMPLER 1" >>confdefs.h
LIBS="-lzita-resampler $LIBS"
else $as_nop
as_fn_error $? "You need to install libzita-resampler to build this package." "$LINENO" 5
fi
Thanks for any guidance, learning as I go here.

Go 1.8 plugins, fatal error: stddef.h: No such file

Observe:
$ cat /tmp/plugin.go
package main
import "fmt"
var V int
func F() { fmt.Printf("Hello, number %d\n", V) }
$ go build -buildmode=plugin -o /tmp/plugin.so /tmp/plugin.go
# runtime/cgo
cgo-builtin-prolog:1:57: fatal error: stddef.h: No such file or directory
compilation terminated.
Why is that?
This is under Ubuntu 17.04, and I have build-essentials installed:
$ go version
go version go1.9 linux/amd64
$ uname -r
4.10.0-37-generic
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 17.04
Release: 17.04
Codename: zesty
$ apt-cache policy build-essential
build-essential:
Installed: 12.1ubuntu2
Candidate: 12.1ubuntu2
please not the "Compilation error: "stddef.h: No such file or directory"" is NOT the answer as my gcc-core package and gcc-g++ are of the same version -- here are my gcc related packages:
gcc_4:6.3.0-2ubuntu1
gcc-6_6.3.0-12ubuntu2
gcc-6-base:amd64_6.3.0-12ubuntu2
libgcc-6-dev:amd64_6.3.0-12ubuntu2
libgcc1:amd64_1:6.3.0-12ubuntu2
UPDATE:
thanks #peterSO, seems to be my gcc's own problem:
$ cat /tmp/foo.c
#include <stdio.h>
$ gcc /tmp/foo.c
In file included from /tmp/foo.c:1:0:
/usr/include/stdio.h:33:21: fatal error: stddef.h: No such file or directory
# include <stddef.h>
While searching for solution for it, I found someone suggested to reinstall gcc, so I did, together with libc6-dev:
apt-get --reinstall install libgcc-6-dev gcc-6 gcc-6-base:amd64 libc6-dev:amd64
Now my simple .c file compiles OK now, but I'm bumped into a new problem with cgo:
$ go build -buildmode=plugin -o /tmp/plugin.so /tmp/plugin.go
# runtime/cgo
In file included from /usr/include/errno.h:35:0,
from cgo-gcc-prolog:21:
/usr/include/x86_64-linux-gnu/bits/errno.h:24:26: fatal error: linux/errno.h: No such file or directory
# include <linux/errno.h>
^
compilation terminated.
I know this might be a Ubuntu/gcc specific problem (Ref: Why is stddef.h not in /usr/include? and my stddef.h is under /usr/src/linux-headers-4.10.0-37/include/linux/stddef.h), but anybody here knows Go and gcc good enough to know how to fix it, so that Go plugins can be compiled properly?
Thx!

MOTIF compiling error / X11/intrinsic.h missing

i have MOTIF installed X11
a easy program is saved as hello.c
there is the following message
where can i get the X11/intrinsic.h , file ???
need help to compile
my system : MX-16 Linux Debian Jessie / i386
Code:
hans#mx1:~/Documents
$ cc push.c -o push -lXm -lXt -lX11
In file included from push.c:2:0:
/usr/include/Xm/Xm.h:59:27: fatal error: X11/Intrinsic.h: No such file or directory
#include <X11/Intrinsic.h>
^
compilation terminated.
hans#mx1:~/Documents
I installed the libxt-dev package on my Debian box:
apt-get install libxt-dev
Then the proper header will be installed:
# find /usr -name "Intrinsic.h" -print
/usr/include/X11/Intrinsic.h
Been using xv for several decades now -- I always find myself trying to rebuild it.
The copy on my system came from libxt-dev
$ locate Intrinsic
/usr/include/X11/Intrinsic.h
/usr/include/X11/IntrinsicI.h
/usr/include/X11/IntrinsicP.h
$ dpkg-query -S /usr/include/X11/Intrinsic.h
libxt-dev:amd64: /usr/include/X11/Intrinsic.h
You may want to install and use apt-file - you can ask it for a filename and it will tell you which packages (that you don't even have to have installed - just from the repos in your sources.lists) contain a file with that name

Build Jansson 2.7 failed if I copy the directory elsewhere

I'm using Jansson 2.7 for my project. I found something that causes a build failed.
If I try:
tar -zxvf jansson-2.7.tar.gz
cd jansson-2.7/
./configure
make
Everything is just fine. But If I try:
tar -zxvf jansson-2.7.tar.gz
cp jansson-2.7 jansson-2.7-test -r
cd jansson-2.7-test/
./configure
make
Configure will success, but make will fail:
make
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/nick/Downloads/jansson-2.7-test/missing aclocal-1.14
/home/nick/Downloads/jansson-2.7-test/missing: line 81: aclocal-1.14: command not found
WARNING: 'aclocal-1.14' is missing on your system.
You should only need it if you modified 'acinclude.m4' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'aclocal' program is part of the GNU Automake package:
<http://www.gnu.org/software/automake>
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
<http://www.gnu.org/software/autoconf>
<http://www.gnu.org/software/m4/>
<http://www.perl.org/>
make: *** [aclocal.m4] Error 127
Any clues? Thanks!
I ran into this same issue simply extracting and trying to run configure/make. Following the link provided by nick2100, I found the following commands fixed the problem:
./configure
make AUTOCONF=: AUTOHEADER=: AUTOMAKE=: ACLOCAL=:
make AUTOCONF=: AUTOHEADER=: AUTOMAKE=: ACLOCAL=: install

cabal install fails when installing pango

Cabal fails when trying to install pango, complaining that it cant find pkg-config.
peauters:~ $ sudo cabal install pango -v
Password:
Reading available packages...
Choosing modular solver.
Resolving dependencies...
Extracting
/Users/chris/Library/Haskell/repo-cache/hackage.haskell.org/pango/0.12.3/pango-0.12.3.tar.gz
to /tmp/pango-0.12.3-76116...
creating /tmp/pango-0.12.3-76116/pango-0.12.3/dist/setup
creating /tmp/pango-0.12.3-76116/pango-0.12.3/dist
creating /tmp/pango-0.12.3-76116/pango-0.12.3/dist/setup
/usr/bin/ghc --make /tmp/pango-0.12.3-76116/pango-0.12.3/Setup.hs -o /tmp/pango-0.12.3-76116/pango-0.12.3/dist/setup/setup -odir /tmp/pango-0.12.3-76116/pango-0.12.3/dist/setup -hidir /tmp/pango-0.12.3-76116/pango-0.12.3/dist/setup -i -i/tmp/pango-0.12.3-76116/pango-0.12.3 -package Cabal-1.14.0
[1 of 2] Compiling SetupWrapper ( /tmp/pango-0.12.3-76116/pango-0.12.3/SetupWrapper.hs, /tmp/pango-0.12.3-76116/pango-0.12.3/dist/setup/SetupWrapper.o )
[2 of 2] Compiling Main ( /tmp/pango-0.12.3-76116/pango-0.12.3/Setup.hs, /tmp/pango-0.12.3-76116/pango-0.12.3/dist/setup/Main.o )
Linking /tmp/pango-0.12.3-76116/pango-0.12.3/dist/setup/setup ...
/tmp/pango-0.12.3-76116/pango-0.12.3/dist/setup/setup configure --verbose=2
--ghc --prefix=/Library/Haskell/$compiler/lib/$pkgid --libsubdir=
--datasubdir= --docdir=$prefix/doc --enable-library-profiling --global
--flags=new-exception --constraint=process ==1.1.0.1 --constraint=pretty
==1.1.1.0 --constraint=mtl ==2.1.1 --constraint=glib ==0.12.3.1
--constraint=directory ==1.1.0.2 --constraint=containers ==0.4.2.1
--constraint=cairo ==0.12.3.1 --constraint=base ==4.5.0.0 --constraint=array
==0.4.0.0 --disable-tests --disable-benchmarks
[1 of 2] Compiling Gtk2HsSetup ( Gtk2HsSetup.hs, dist/setup-wrapper/Gtk2HsSetup.o )
[2 of 2] Compiling Main ( SetupMain.hs, dist/setup-wrapper/Main.o )
Linking dist/setup-wrapper/setup ...
Configuring pango-0.12.3...
Flags chosen: new-exception=True
Dependency array ==0.4.0.0: using array-0.4.0.0
Dependency base ==4.5.0.0: using base-4.5.0.0
Dependency cairo ==0.12.3.1: using cairo-0.12.3.1
Dependency containers ==0.4.2.1: using containers-0.4.2.1
Dependency directory ==1.1.0.2: using directory-1.1.0.2
Dependency glib ==0.12.3.1: using glib-0.12.3.1
Dependency mtl ==2.1.1: using mtl-2.1.1
Dependency pretty ==1.1.1.0: using pretty-1.1.1.0
Dependency process ==1.1.0.1: using process-1.1.0.1
setup: The pkg-config package pango version <1.26.0 || >1.26.2 is required but
it could not be found.
World file is already up to date.
cabal: Error: some packages failed to install:
pango-0.12.3 failed during the configure step. The exception was:
ExitFailure 1
pkg-config is installed via Homebrew:
peauters:~ $ which pkg-config
/usr/local/bin/pkg-config
peauters:~ $ pkg-config --version
0.25
An ideas on the issue?
This error was slightly confusing.
What this is saying is that you need to install the non-cabal package "pango".
I did this with brew install pango and solved this problem.
For ubuntu see http://www.haskell.org/haskellwiki/Gtk2Hs/Linux which gives
sudo apt-get install libgtk2.0-dev libpango1.0-dev libglib2.0-dev libcairo2-dev

Resources