"pkg-config script could not be found" on OSX - linux

I am trying to install some software on my mac; however I keep receiving the same error:
configure: error: The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
Alternatively, you may set the environment variables XMEDCON_GLIB_CFLAGS
and XMEDCON_GLIB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See `config.log' for more details
I am not quite sure how to go about adding the pkg-config to the PATH. I have seen online (see link) that I should add the following:
Link showing how to direct PATH variable
export PATH=$PATH:/opt/local/bin # Fixed typo as mentioned in comment
which is where I have placed pkg-config. I still keep getting the error though every time I try to configure the files using ./configure. Any help would be super appreciated!

For Ubuntu/Debian OS,
apt-get install -y pkg-config
For Redhat/Yum OS,
yum install -y pkgconfig
For Archlinux OS,
pacman -S pkgconf

for me, (OSX) the problem was solved doing this:
brew install pkg-config

Answer to my question (after several Google searches) revealed the following:
$ curl https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.tar.gz -o pkgconfig.tgz
$ tar -zxf pkgconfig.tgz && cd pkg-config-0.29
$ ./configure && make install
from the following link: Link showing above
Thanks to everyone for their comments, and sorry for my linux/OSX ignorance!
Doing this fixed my issues as mentioned above.

if you have this error :
configure: error: Either a previously installed pkg-config or "glib-2.0 >= 2.16" could not be found. Please set GLIB_CFLAGS and GLIB_LIBS to the correct values or pass --with-internal-glib to configure to use the bundled copy.
Instead of do this command :
$ ./configure && make install
Do that :
./configure --with-internal-glib && make install

Try
which pkg-config
if it is empty then fire
brew install pkg-config
OR : ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null

MacOS users
Unfortunately, pkg-config does not come with OS X by default. Here are some notes on how to compile from source. It assumes that you have Xcode installed.
Download and extract
curl -O http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
tar xfz pkg-config-0.28.tar.gz
Configure and Install
cd pkg-config-0.28
setenv CC /usr/bin/cc (for tcsh)
export CC=/usr/bin/cc (for bash)
2a) If you have super-user powers
./configure --prefix=/usr/local CC=$CC --with-internal-glib
make
sudo make install
2b) if not
./configure --prefix=$HOME/someplace/in/my/path CC=$CC --with-internal-glib
make
make install
Source: https://opensource.ncsa.illinois.edu/confluence/display/DESDM/Installing+pkg-config+from+source+for+OSX

Related

LFS CoreUtils-8.30 fails with aclocal-1.15 missing

I have a standard core i5 laptop and I'm trying to make LFS (Linux From Scratch) it has all worked fine (after a couple of retries) until I try and make Coreutils-8.30 when I do the Make I get:
lfs#robert-HP-EliteBook-8760w:/mnt/lfs/sources/coreutils-8.30$ make
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /mnt/lfs/sources/coreutils-8.30/build-aux/missing aclocal-1.15 -I m4
/mnt/lfs/sources/coreutils-8.30/build-aux/missing: line 81: aclocal-1.15: command not found
WARNING: 'aclocal-1.15' 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/>
Makefile:6034: recipe for target 'aclocal.m4' failed
make: *** [aclocal.m4] Error 127
I've gone around and around on this and I'm not getting anywhere. I've found a couple of references to gettext but that hasn't helped.
Thanks for any guidance.
Just got through the same issue. You need to install libtool-bin, automake and makeinfo
sudo apt-get install libtool-bin automake makeinfo
Then run autoreconf -f -i in the mpfr directory. After that you can run ./configure etc.
I ran into this issue when I applied the patch for coreutils that was provided in the downloads. I noticed the instructions did not tell me to apply this patch at this step so I tried to build again without the patch applied and it worked.
I just met and solved this problem,My solution is not necessarily the best。
This questions because you don't have "aclocal" tools with version 1.15,
This tools provided by automake-1.15, which depended by autoconf-2.69 or later.
So My solution is installing autoconf-2.69 and automake-1.15:
1. installing autoconf-2.69
tar -xvf autoconf-2.69.tar.xz
./configure --prefix=/tools
make && make install
2. installing automake-1.15
tar -xvf automake-1.15.tar.xz
./configure --prefix=/tools
make && make install
then you can compile your coreutils-8.30
Check if autoinfo from gettext is installed OK.
This error when building coreutils is caused by absence of autopoint.

installing systemc on ubuntu

I am a beginner.
I'm installing systemc231 on Ubuntu and I have done this:
tar -xzvf systemc-2.3.1.tgz
cd systemc-2.3.1
sudo mkdir /usr/local/systemc231
mkdir objdir
cd objdir
export cxx="<compiler>"
export cxx=g++
export cxx=clang++
setevn cxx g++
It answered :command not found
Then I continued:
../configure
It took a moment and checked something but finally it answered :
Configure:error: in /home/Ubuntu/systemc-2.3.1/objdir':
Configure:error:c++compiler cannot create executables see 'config.log' for more details
And then I continued :
make
And it answered :
make:*** no targets specified no makefile found. Stop.
Now what can l do?
This is the link of systemc231 file and I have used its readme and install files for writing the commands :
http://accellera.org/images/downloads/standards/systemc/systemc-2.3.1.tgz
In Ubuntu, you use export to set environmental variables. In other Linux distributions, you use setenv. You only need one of those commands. do a command to figure out if g++ is installed
which g++
If it doesnt return something like
/usr/bin/g++
Then its not installed, just install it with
sudo apt-get install build-essential
then check again with which
You created an installation directory /usr/local/systemc231 you need to specify that you want to install systemc therein in the configure command. Find a tutorial about setting up systemc and eclipse configuration in ubuntu on my blog

How do I install protobuf 2.5 on Arch Linux for compiling hadoop 2.6.0 using maven 3.3.1?

Am looking for installing protobuf 2.5.0 on Arch Linux, so that protoc-2.5.0.so is installed on the OS, so that I can go ahead with building hadoop 2.6.0 from source and make my life easy! :)
BTW, protobuf 2.6.0 does not compile when hadoop is built from source I have tried that as well. Ubuntu 14.04 comes with protoc 2.5.0. I DO NOT want to use Ubuntu.
Please check the screenshot first (there is no protobuf 2.5.0), since the problem lies there.. I guess
am getting the following exception, I am aware that protoc is not installed in arch linux currently.
[ERROR] Failed to execute goal
org.apache.hadoop:hadoop-maven-plugins:2.6.0:protoc (compile-protoc)
on project hadoop-common:
org.apache.maven.plugin.MojoExecutionException: 'protoc --version' did
not return a version -> [Help 1]
Please help me out, since, I have spent 4 hours every day from two days, with no luck.
Compiling Google's protobuf is pretty easy.
I originally found out how to do it on this blog post while compiling hadoop myself.
But here is my version:
$ cd /usr/local/src/
$ wget https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
$ tar xvf protobuf-2.5.0.tar.gz
$ cd protobuf-2.5.0
$ ./autogen.sh
$ ./configure --prefix=/usr
$ make
$ make install
$ protoc --version
Install protobuf for java
$ cd java
$ mvn install
$ mvn package
You should be good to go.
To enable you to install different versions of protobuf, install stow
then change ./configure --prefix=/usr to ./configure --prefix=/usr/local/stow/protobuf-2.5.0
Then link protobuf into your system with stow:
$ cd /usr/local/stow
$ stow protobuf-2.5.0
Note: stow uses /usr/local/bin by default. Make sure thats in your $PATH
To unlink that version of protobuf,
$ stow -D protobuf-2.5.0
Hope this helped.
I wonder why the above answer got downvoted,even I had to perform few more steps (in addition to the accepted answer by Rudker) to get protobuf 2.5 installed on Ubuntu Xenial.
Leaving the additional steps here for everyone's benefit:
apt-get install autoconf in response to the error : ./autogen.sh: autoreconf: not found for command : ./autogen.sh
apt-get install libtool in response to the error : autoreconf: libtoolize is needed because this package uses Libtool for command : ./autogen.sh
apt install g++ in response to the error : configure: error: C++ preprocessor "/lib/cpp" fails sanity check for command : ./configure --prefix=/usr
An easier but not future proof solution (for future queries) would be to head over to Arch Linux Archives: http://seblu.net/a/archive/packages/p/protobuf/
Uninstall the newer version of protobuf and install the downloaded package via pacman -U protobuf-2.5.x..
Though whenever you upgrade the Arch Linux packages via pacman you'd need to ensure you are doing: sudo pacman -Syu --ignore protobuf
I currently don't have enough reputation to comment, so I add a answer here to update the top voted answer.
Since protobuf move to different repo, the new wget command should be:
wget https://github.com/protocolbuffers/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
And in order to run ./autogen.sh, you may need install these:
sudo yum install libtool automake autoconf
For OSX prerequisites, try SunitaKoppar's answer (I don't know why the down-votes).
Thanks for the steps. Just wanted to add that, to get autogen.sh to work, I had to install the below packages (commands for mac below):
brew install gtk
brew install autoconf
brew install automake

gcc on Lubuntu not working

I am trying to use the gcc on Lubuntu.
I have done the following installs but get the message "The program 'gcc' can be found in the following packages"
sudo apt-get install gcc
sudo apt-get install build-essential
What I am doing wrong, is there a way I can verify the gcc was correctly installed?
I bet its not in your path variable
env | grep path
If that doesn't work you need to add the location of gcc to your path environment variable by the looks of it.
To find gcc try:
find . -name gcc
Then to add to path
export PATH=$PATH:/path/to/gcc
echo $PATH;
If that fails, try this guide it may be an issue with your calls to apt-get https://askubuntu.com/questions/240919/how-to-install-gcc-4-7-on-lubuntu-11-10

How do I build/install protobuf 2.4.1 on CentOs (or any LINUX/UNIX system)?

Ok, so I'm kind of a complete foreigner in the UNIX/LINUX land, but I need to install profbuf 2.4.1.
I was following the instructions by doing
wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.bz2
tar xfj protobuf-2.4.1.tar.bz2
pushd protobuf-2.4.1
./configure
make
sudo make install
I could only go as far as ./configure'. WHen I tried runningmake`, I got some error saying "No target specified and no makefile found... Stop"
Does anyone know what I might've done wrong?
Thanks!!!
You probably don't have a g++ compiler in your system or your environment variable doesn't contain the path of it. To install one on linux use the following:
yum install gcc-c++
I had met the same question before, and now I've known the reason. It's lack of corresponding library. If you are using redhat, use root permission to enter the two lines of commands:
# yum install glibc-headers
# yum install gcc-c++
If you are using ubuntu,you can enter this:
# sudo apt-get install build-essential
I've solved my question by that way. Wish you luck!

Resources