pkg-config: PKG_PROG_PKG_CONFIG: command not found - macos

I get the following error
./configure: line 11162: PKG_PROG_PKG_CONFIG: command not found
when this is code is executed in (kivy-ios/tools-build-sdlmixer.sh)
if [ ! -f libtremor/tremor/.libs/libvorbisidec.a ]; then
try cd libtremor/tremor
echo > asm_arm.h
CC="$ARM_CC" AR="$ARM_AR" \
LDFLAGS="$ARM_LDFLAGS" CFLAGS="$ARM_CFLAGS" \
OGG_CFLAGS="-I../../libogg/include" \
OGG_LDFLAGS="-L../../libogg/src/.libs" \
PKG_CONFIG_LIBDIR="../../libogg" \
ACLOCAL_FLAGS="-I $DESTROOT/share/aclocal -I `aclocal --print-ac-dir`" ./autogen.sh \
--prefix=$DESTROOT \
--disable-shared \
--host=arm-apple-darwin \
--enable-static=yes \
--enable-shared=no
try make
try make install
try cd ../..
fi
My pkg-config application is in my PATH (/usr/local/bin). I've also tried exporting PKG_CONFIG_PATH on my command line to /usr/local/bin/pkg-config and /usr/local/lib/pkgconfig. I've tried exporting LD_LIBRARY_PATH to various paths as well (not sure where it should point to tbh), and that doesn't seem to help either.
I read something about multiple aclocal directories on my system, which could be problematic, but its not clear to me how to resolve that or determine its the issue.
This linux build newbie (on OSX) appreciates any help.

When that script calls autogen.sh, aclocal is failing to find pkg.m4, an M4 macro package that comes with pkg-config and provides the PKG_PROG_PKG_CONFIG macro. Where is pkg-config installed, and what directories is aclocal searching?

Had the same issue with linux Alpine for an DockerImage.
Solved it by installing autoconf, automake and pkgconf:
apk --update add autoconf automake build-base libtool nasm pkgconf

Related

Singularity 3.6.2 Installation

I have problems with installation of singularity 3.6.2 in linux mint, I followed the instructions of https://sylabs.io/guides/3.0/user-guide/installation.html.
I installed the dependencies and Go.
Then I run the command for install the latest version:
export VERSION=3.6.2 && # adjust this as necessary \
mkdir -p $GOPATH/src/github.com/sylabs && \
cd $GOPATH/src/github.com/sylabs && \
wget https://github.com/sylabs/singularity/releases/download/v${VERSION}/singularity-${VERSION}.tar.gz && \
tar -xzf singularity-${VERSION}.tar.gz && \
cd ./singularity && \
./mconfig
The error is:
Configuring for project `singularity' with languages: C, Golang
=> running pre-basechecks project specific checks ...
=> running base system checks ...
checking: host C compiler... cc
checking: host C++ compiler... c++
checking: host Go compiler (at least version 1.13)... not found!
mconfig: could not complete configuration
I have go (go version)
go version go1.15.2 linux/amd64
I don't know what happend!
Thanks so much!
I was struggling with the same error. All the suggestions say that probably you have an older version of Go and that's why. But turned out it's even more important to place Go and Singularity in the right locations.
I found these docs https://github.com/hpcng/singularity/blob/release-3.5/INSTALL.md are the most useful and correct about where to put what in terms of directories.
The key is to clone Singularity in a directory which is GOPATH:
You won't have this directory by default so create it first
$ mkdir -p ${GOPATH}/src/github.com/sylabs && \
cd ${GOPATH}/src/github.com/sylabs && \
git clone https://github.com/sylabs/singularity.git && \
cd singularity
Make sure your singularity is here: {GOPATH}/src/github.com/sylabs/singularity
To summarize:
The Go itself is located here /usr/local/go
GOPATH would be something like home/your_username/go and the singularity will be located inside in e.g. home/your_username/go/src/github.com/sylabs/singularity
The issue was reported in 5099.
# 5320 also mentions:
I deleted the PPO python 3.6 and this worked fine!
Make sure nothing is executed as root, which would have a $PATH different from your current user.
If someone faces this issue, follow this installation guide.
sudo apt-get update && \
sudo apt-get install -y build-essential \
libseccomp-dev pkg-config squashfs-tools cryptsetup
sudo rm -r /usr/local/go
export VERSION=1.13.15 OS=linux ARCH=amd64 # change this as you need
wget -O /tmp/go${VERSION}.${OS}-${ARCH}.tar.gz https://dl.google.com/go/go${VERSION}.${OS}-${ARCH}.tar.gz && \
sudo tar -C /usr/local -xzf /tmp/go${VERSION}.${OS}-${ARCH}.tar.gz
echo 'export GOPATH=${HOME}/go' >> ~/.bashrc && \
echo 'export PATH=/usr/local/go/bin:${PATH}:${GOPATH}/bin' >> ~/.bashrc && \
source ~/.bashrc
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh |
sh -s -- -b $(go env GOPATH)/bin v1.21.0
mkdir -p ${GOPATH}/src/github.com/sylabs && \
cd ${GOPATH}/src/github.com/sylabs && \
git clone https://github.com/sylabs/singularity.git && \
cd singularity
git checkout v3.6.3
cd ${GOPATH}/src/github.com/sylabs/singularity && \
./mconfig && \
cd ./builddir && \
make && \
sudo make install
singularity version

Can't build latest libcurl on RHEL 7.3

What's the proper way to fix this compilation error so I can install the latest libcurl on RHEL 7.3?
I've been able to get the latest openssl, build, and install it. OpenSSL 1.1.1-dev xx XXX xxxx is reported by openssl version now. Latest curl is cloned/pulled from https://github.com/curl/curl.git. Here's the bash script fragment I'm using:
CD=$(pwd)
CPPFLAGS="-I$CD/zlib -I$CD/openssl -I$CD/openssl/include"
LDFLAGS="-L$CD/zlib -L$CD/openssl"
LIBS="-ldl"
cd curl
./buildconf
./configure --disable-shared --with-zlib --with-ssl
make
make install
Running the batch with sudo, make completes without errors. make install produces this:
CC libcurl_la-openssl.lo
vtls/openssl.c: In function 'Curl_ossl_seed':
vtls/openssl.c:279:5: error: implicit declaration of function 'RAND_egd' [-
Werror=implicit-function-declaration]
int ret = RAND_egd(data->set.str[STRING_SSL_EGDSOCKET]?
^
cc1: some warnings being treated as errors
make[2]: *** [libcurl_la-openssl.lo] Error 1
make[2]: Leaving directory `/home/john/curl/lib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/john/curl/lib'
make: *** [all-recursive] Error 1
RAND_egd() is no longer part of the default OpenSSL install. See this git commit. You can fix the problem by adding enable-egd in the configure command.
Edit: Updated with cleaner version
Here's steps for building curl with the latest openssl
CD=$(pwd)
echo Setting up openssl
if [ ! -d openssl ]; then
git clone https://github.com/openssl/openssl.git
cd openssl
else
cd openssl
git pull
fi
# you may not need -Wl,--enable-new-dtags but it works for me
./config -Wl,--enable-new-dtags --prefix=/usr/local/ssl --openssldir=/usr/local/ssl
make depend
make
sudo make install
cd ..
lib=zlib-1.2.11
echo Setting up zlib
if [ ! -d zlib ]; then
wget http://zlib.net/$lib.tar.gz
tar xzvf $lib.tar.gz
mv $lib zlib
fi
cd zlib
./configure
make
cd ..
echo Setting up curl ...
CD=$(pwd)
if [ ! -d curl ]; then
git clone https://github.com/curl/curl.git
cd curl
else
cd curl
git pull
fi
cd curl
./buildconf
PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig LIBS="-ldl" ./configure --with-
zlib=$CD/zlib --disable-shared
make
# I use local curl build without installing it
# make install
cd ..
I sincerely hope this helps someone else.

Regarding "make install"

I was installing OpenGV and it is said there that
At least under Linux and OSX, the installation on the host OS (including the headers) can be activated by simply setting INSTALL_OPENGV to ON.
Is this meant for the make install? At least that is how I understand it.
If that is the case, why in the dockerfile of the OpenSfM (this library depends on the OpenGV), it is like this?
# Install opengv from source
RUN \
mkdir -p /source && cd /source && \
git clone https://github.com/paulinus/opengv.git && \
cd /source/opengv && \
mkdir -p build && cd build && \
cmake .. -DBUILD_TESTS=OFF -DBUILD_PYTHON=ON && \
make install && \
cd / && \
rm -rf /source/opengv
The flag for INSTALL_OPENGV is not set to on and yet, it is ok to make install. Looking at the CMakeLists.txt file of the OpenGV, the INSTALL_OPENGV flag is default to OFF.
Judging from CMakeLists.txt, when INSTALL_OPENGV is OFF, only headers are installed.
When the flag is ON, it also installs binaries produced by the opengv target.
CMake's install target is a default target that gets generated even if there are no install() calls in CMakeLists.txt. In that case make install would simply do nothing.

Make install causes recompiles

I am writing a master makefile to compile and install multiple autoconf based libraries, which depend on each other. All works well for the first go. The issue is: if I am working on one of these libraries individually and do "make && make install" header files in the prefix folder are overwritten (even if they are untouched). This causes all dependent libraries to compile from scratch.
Is there a way to avoid the unnecessary recompiles without hacking into the makefiles?
Maybe the solution is a little late, but
./configure INSTALL="install -p"
fixes the recompilation problem. This flag makes GNU install set the timestamps of the installed files to the timestamps of the built files.
You could use sentinel files that exist only to establish your dependency graph. For eg.
prefix := /usr/local
.PHONY: all
all: libx-built
libx-built \
: libx.tar.gz \
; tar xzvf $# \
&& cd libx \
&& ./configure --prefix=$(prefix) \
&& make && make install \
&& touch $#
Then, you'd make a dependent liby build only when libx-built is new.
liby-built \
: liby.tar.gz libx-built \
; ...

Installing readline 6.0 on OS X

I'm trying to install readline 6 from source but run into an error during 'make install'.
Here is the end of the output after executing 'sudo make install'
( cd shlib ; make DESTDIR= install )
/bin/sh ../support/mkdirs /usr/local/lib
/bin/sh ../support/shlib-install -O darwin9.7.0 -d /usr/local/lib -b /usr/local/bin -i "/usr/bin/install -c -m 644" libhistory.6.0.dylib
/bin/sh ../support/shlib-install -O darwin9.7.0 -d /usr/local/lib -b /usr/local/bin -i "/usr/bin/install -c -m 644" libreadline.6.0.dylib
install: you may need to run ldconfig
I know that ldconfig isn't installed by default on OS X, and I read somewhere that it shouldn't be needed to fix this issue. I believe it has something to do with dynamic libraries, but I haven't been able to find out how to fix the issue, anyone have any insight?
FYI, I'm running OS X on an intel 2.4ghz macbook
thanks
P.S. I also applied the 3 available readline 6 patches before running configure and make
Actually, this isn't an error at all... it's just a notice message at the end of the install. It get this too, and my readline 6 is happily installed.
If you check /usr/local/lib and see readline there, you're done :-) No need to run any equivalent of ldconfig.
$ ls /usr/local/lib | grep readline
libreadline.6.0.dylib
libreadline.6.dylib
libreadline.a
libreadline.dylib

Resources