Adjusting PKG_CONFIG_PATH does not work - pkg-config

I am having problems with installing a package that depends on another package - poppler-glib. I have poppler-glib (newest version) installed with the prefix /home/user/local/poppler-glib with *.pc files present in /home/user/local/poppler-glib/lib/pkgconfig. I have added that path to the PKG_CONFIG_PATH variable (I am on tcsh):
setenv PKG_CONFIG_PATH /home/user/local/poppler-glib/lib/pkgconfig
Nevertheless, when I try to run the ./configure script of the other package, I am getting the following error:
configure: error: Package requirements (poppler-glib >= 0.5.4) were not met:
No package 'poppler-glib' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables POPPLERGLIB_CFLAGS
and POPPLERGLIB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
Therefore, question: how can I adjust the PKG_CONFIG_PATH variable to make it visible?

Just install poppler-glib by using the command:
sudo apt-get install libpoppler-glib-dev

Related

How to properly install GO with paths and all?

I have installed GO, setup the paths but when i run a file i get this error:
error!! exec: "sqlboiler": executable file not found in $PATH
exec: "sqlboiler": executable file not found in $PATH
exec: "sqlboiler": executable file not found in $PATH
exit status 3
What is going wrong?
The installation instructions are good, https://go.dev/doc/install. However, for me un Ubuntu 20.4 in wsl2, the suggested path for the binaries wasn't enough. Only go and gofmt are added to /usr/local/go/bin.
I did add the below to my .bashrc, since go install puts the binaries in this location on my system.
export PATH="$HOME/go/bin:$PATH"
Note, that the path to the binaries may differ on your system, so you have to adjust it accordingly.
Any binary you install with go install that is added to this path will be available to your shell afterwards.
For example:
$ go install github.com/volatiletech/sqlboiler/v4#latest
$ go install github.com/volatiletech/sqlboiler/v4/drivers/sqlboiler-psql#latest
$ whereis sqlboiler
sqlboiler: /home/blue/go/bin/sqlboiler
Potentially, you also need some database packages to your system. I am not sure on this any more. For example, you could add some Postgres libs if you are using Postgres. You have to see if it works without.
apt-get install postgresql-client-common postgresql-client-12
How to properly install GO with paths and all?
Install Go with the installer (Windows) or archive (extract into /usr/local on Linux/Mac).
When installing from archive, manually add the directory path where the go binary is located (/usr/local/go) to PATH.
Set GOPATH to a directory path wherein to contain bin, pkg and src sub-directories.
Add ${GOPATH}/bin to PATH.
What is going wrong?
The program you are running is trying to run the executable sqlboiler, which cannot be found in any of the directories specified in PATH.

What causes package samplerate not being found in the pkg-config search path?

I stumbled upon a problem when I was trying to install gosamplerate for my project. I was following installation manual on the repository https://github.com/dh1tw/gosamplerate but after succesfully installing libsamplerate0, I get error response while trying to execute go get github.com/dh1tw/gosamplerate:
# pkg-config --cflags -- samplerate
Package samplerate was not found in the pkg-config search path.
Perhaps you should add the directory containing `samplerate.pc'
to the PKG_CONFIG_PATH environment variable
No package 'samplerate' found
pkg-config: exit status 1
Can anyone help me resolve this issue?
This particular error is unrelated to Go and indicates samplerate.pc isn't in the pkgconfig search path. You may have installed libsamplerate under /usr/local or somewhere else that is outside the default pkg-config search path.
Options:
Install libsamplerate from your distribution (if it exists) so samplerate.pc is installed in one of the default pkgconfig directories.
Set PKG_CONFIG_PATH to enable pkg-config to find samplerate.pc:
First, find where the samplerate.pc is installed (maybe /usr/local/lib/pkgconfig?). Then set PKG_CONFIG_PATH:
$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
pkg-config should find the config now.
Manually rebuild and install libsamplerate in using ./configure --prefix /usr. This will install it along other system libraries, but makes it much harder to uninstall. NOT RECOMMENDED

Build conda package from a local C++ program

I am trying to build (and later upload) a conda package which would contain my custom program that I have developed in C++.
Simplifying the problem, I have a following meta.yaml:
package:
name: CoolName
version: "1.0.0"
source:
path: ./source
requirements:
build:
- make
and the following build.sh:
make
I have two questions here:
1) How and where should I copy the binary which is a result of the make compilation so that it is indeed recognized upon environment activation?
2) How should I specify g++ as a dependancy? I would like to have this package be later available for linux-64 and osx-64... In the building process (in the Makefile) I am using only g++.
Edit
I have modified my build script to have:
make
mkdir -p $PREFIX/bin
cp my_binary $PREFIX/bin/my_binary
And now the conda-build is successful. However, when I later try to install the package locally with conda install --use-local I get:
Collecting package metadata (current_repodata.json): done
Solving environment: done
# All requested packages already installed.
But this is not true, my binary is not installed anywhere and is not recognized...
How and where should I copy the binary which is a result of the make compilation so that it is indeed recognized upon environment activation?
As you mentioned in your edit, install somewhere within ${PREFIX}
How should I specify g++ as a dependancy?
To use conda-supplied compilers (rather than your system compiler), use this:
requirements:
build:
- {{ compiler('cxx') }}
I would like to have this package be later available for linux-64 and osx-64... In the building process (in the Makefile) I am using only g++.
Note: On Mac, it will use clang++, not g++. Make sure your Makefile respects the ${CXX} environment variable instead of hard-coding g++.
However, when I later try to install the package locally with conda install --use-local I get:
That is strange. conda install --use-local CoolName should do what you want. But here are some things to try:
Double-check the contents of the environment you're trying to install it into:
conda list
Try installing to a fresh environment:
conda create -n my-new-env --use-local CoolName
Delete any obsolete versions of the package you might have created before you successfully built the package:
# Inspect the packages you've created,
# and consider deleting all but the most recent one.
ls $(conda info --base)/conda-bld/linux-64/CoolName*.tar.bz2
...then try running conda install again.

macOS Issue when installing geany plugins

I have been trying to install the Geany plugins since yesterday but unsuccessfully.
I am using a mac os Sierra version 10.12.6
I installed Geany 1.31 on my mac.
and here are the steps I follow to install the plugins:
1- I dowloaded the plugins folder
then on the terminal I type:
cd /Users/davidabitbol/Downloads/untitled\ folder/geany-plugins-1.31
then
./configure
and here it does not work. this is what I get:
Package geany was not found in the pkg-config search path.
Perhaps you should add the directory containing `geany.pc'
to the PKG_CONFIG_PATH environment variable
No package 'geany' found
checking for GEANY... no
configure: error: Package requirements (geany >= 1.29) were not met:
No package 'geany' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables GEANY_CFLAGS
and GEANY_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
I can't manage to solve this issue.
Any idea what should be done?
thanks

How to build goncurses on os x, centos 6

OS X, Centos 6 and Debian Squeeze all come with v5.7 of ncurses, but the go wrapper "goncurses" requires 5.9. Trying to build it on any of those platforms will give you an error like this:
$ go get -v code.google.com/p/goncurses
code.google.com/p/goncurses
# code.google.com/p/goncurses
/tmp/go-build527609801/code.google.com/p/goncurses/_obj/goncurses.o:
In function 'ncurses_is_subwin':src/code.google.com/p/goncurses/goncurses.c:71: undefined reference to `is_subwin'
/tmp/go-build527609801/code.google.com/p/goncurses/_obj/goncurses.o:
In function 'ncurses_is_pad':src/code.google.com/p/goncurses/goncurses.c:63: undefined reference to `is_pad'
You can use homebrew to install ncurses v5.9 on os x, and build from source into /usr/local/ on linux, but how do you get go to use your upgraded ncurses when building?
#JimB answered my other question How to change lib path for "go build" with a suggestion to leverage pkg-config, which solution will look like this:
On CentOS 6 you can build ncurses from source like this, which will put the .pc files that drive pkg-config into your own directory instead of /usr/lib64/pkgconfig/
mkdir ~/local-pkg-config
PKG_CONFIG_LIBDIR=~/local-pkg-config ./configure --prefix=/usr/local/ --enable-pc-files --with-pkg-config
make && make install
On OS X you can install ncurses from homebrew. Homebrew usually puts .pc files along with the package, e.g. /usr/local/Cellar/pango/1.34.1/lib/pkgconfig/pango.pc. For some reason homebrew doesn't have any .pc files with its ncurses, but I successfully grabbed the CentOS ones into ~/local-pkg-config and changed them to suit:
## -1,7 +1,7 ##
-prefix=/usr/local/
+prefix=/usr/local/Cellar/ncurses/5.9/
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
-includedir=${prefix}/include/ncurses
+includedir=${prefix}/include
major_version=5
version=5.9.20110404
Now on either platform you're set up to go get the goncurses package:
PKG_CONFIG_PATH=~/local-pkg-config/ go get -v code.google.com/p/goncurses
This Gist is a modified ncurses formula for Homebrew that adds the .pc files to the keg. If you install ncurses with it, use the PKG_CONFIG_PATH environment variable to point pkg-config to the .pc files, before calling go build or go run.
$ export PKG_CONFIG_PATH=/usr/local/Cellar/ncurses/5.9/lib/pkgconfig
$ go run your_ncurses_program.go

Resources