I've just start using GNU make because of a software package I'm trying to install. The tutorial is really good, but for some reason I'm not able to do it properly. I downloaded the files, extracted them to a folder, and did the installation. I think it's all correct, but I can't use it as the tutorial explains.
I created a directory with a c++ tutorial file and its Makefile in the same folder, but when I ran make, I received a message:
$ make
g++ -c -o vlasov2d.o vlasov2d.cpp -Wall -g `pkg-config --cflags ibsimu-1.0.6dev`
Package ibsimu-1.0.6dev was not found in the pkg-config search path.
Perhaps you should add the directory containing 'ibsimu-1.0.6dev.pc'
to the PKG_CONFIG_PATH environment variable
No package 'ibsimu-1.0.6dev' found
vlasov2d.cpp:1:10: fatal error: epot_bicgstabsolver.hpp: No such file or directory
1 | #include "epot_bicgstabsolver.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:9: vlasov2d.o] Error 1
As this explains, I tried to insert the path to the .pc files in the pkg-config using PKG_CONFIG_PATH but, for some reason, it doesn't work. The pkg-config still doesn't have the specific path:
$ export PKG_CONFIG_PATH=/home/tanusszabo/Softwares/lib/pkgconfig
$ echo $PKG_CONFIG_PATH
/home/tanusszabo/Softwares/lib/pkgconfig
$ 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
Is it possible to add some other path in pkg-config? Or do I need to install the software and its .pc file in a folder that is already in pkg-config?
In case it matters, my Ubuntu version is 20.04.4 LTS, g++ is 9.4.0, and pkg-config is 0.29.1.
The relevant structure of my directories after installation is:
home/tanusszabo/Softwares/
include/
ibsimu-1.0.6/
many .hpp files (including the epot_bicgstabsolver.hpp)
lib/
pkgconfig/
ibsimu-1.0.6.pc
Simu/
test/
Makefile
vlasov2d.cpp
The only directory I created was Simu with its files. The include and the lib were created with the installation.
.configure --prefix=/home/username/Softwares/before running MakeFile?, seems like you are not set custom LDFLAGS, CFLAGS and LD_LIBRARY_PATH. – abu-ahmed al-khatiri Aug 04 '22 at 12:34configure --prefix=/path/to/installation, runmakeandmake install. After installation, they say to put a .cpp and other MakeFile in another directory and runmake, this one is the one giving me problems. – Tanus Szabo Aug 04 '22 at 12:49pkg-config --variable pc_path pkg-configonly shows you the default (i.e. compiled in) search path. Have you actually confirmed the existence of a.pcfile in/home/tanusszabo/Softwares/lib/pkgconfig? What was the actual value of--prefix=/path/to/installationthat you used? – steeldriver Aug 04 '22 at 13:35./configure --prefix=/home/tanusszabo/Softwares/The relevant structure of my directories are, in thehome/tanusszabo/Softwares/has ainclude,liband aSimudirectories. Theincludehas aibsimu-1.0.6folder with many.hppfiles. Thelibhas apkgconfigfolder with theibsimu-1.0.6.pcfile. And theSimuhas atestfolder with theMakefileandvlasov2d.cppwhich I'm trying to run. – Tanus Szabo Aug 04 '22 at 14:00pkg-config --cflags ibsimu-1.0.6notpkg-config --cflags ibsimu-1.0.6dev. You can usePKG_CONFIG_PATH=/home/tanusszabo/Softwares/lib/pkgconfig pkg-config --list-all | grep ibsimuto confirm. – steeldriver Aug 04 '22 at 14:46ibsimu-1.0.6devin the example Makefile, while the library was onlyibsimu-1.0.6. I fixed the Makefile and the software worked just fine. Thank you so so much, you saved my week! – Tanus Szabo Aug 04 '22 at 15:52ibsimu-1.0.6dev.pcif you clone the git repo as suggested on the Download page - maybe the sourceforge snapshot is different? – steeldriver Aug 04 '22 at 16:39ibsimu-1.0.6dev.pcbut it only defferent folder. – abu-ahmed al-khatiri Aug 04 '22 at 19:35