1

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.

MDeBusk
  • 1,067
  • 1
  • 8
  • 21
Tanus Szabo
  • 13
  • 1
  • 5
  • did you try to run `.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:34
  • @abu-ahmedal-khatiri I did run before running the MakeFile to installation. At least in the tutorial it says to run ```configure --prefix=/path/to/installation```, run ```make``` and ```make install```. After installation, they say to put a .cpp and other MakeFile in another directory and run ```make```, this one is the one giving me problems. – Tanus Szabo Aug 04 '22 at 12:49
  • AFAIK `pkg-config --variable pc_path pkg-config` only shows you the default (i.e. compiled in) search path. Have you actually confirmed the existence of a `.pc` file in `/home/tanusszabo/Softwares/lib/pkgconfig`? What was the actual value of `--prefix=/path/to/installation` that you used? – steeldriver Aug 04 '22 at 13:35
  • @steeldriver I confirmed again, it trully has a .pc file in that directory. and the exactly code I'm using is ```./configure --prefix=/home/tanusszabo/Softwares/``` The relevant structure of my directories are, in the ```home/tanusszabo/Softwares/``` has a ```include```, ```lib``` and a ```Simu``` directories. The ```include``` has a ```ibsimu-1.0.6``` folder with many ```.hpp``` files. The ```lib``` has a ```pkgconfig``` folder with the ```ibsimu-1.0.6.pc``` file. And the ```Simu``` has a ```test``` folder with the ```Makefile``` and ```vlasov2d.cpp``` which I'm trying to run. – Tanus Szabo Aug 04 '22 at 14:00
  • @TanusSzabo please [edit](https://askubuntu.com/posts/1421933/edit) your question including that the relevant structure. – abu-ahmed al-khatiri Aug 04 '22 at 14:04
  • @abu-ahmedal-khatiri done! See if it's understandable. – Tanus Szabo Aug 04 '22 at 14:09
  • I may be wrong, but I believe that the package name has to match the .pc file name i.e. `pkg-config --cflags ibsimu-1.0.6` not `pkg-config --cflags ibsimu-1.0.6dev`. You can use `PKG_CONFIG_PATH=/home/tanusszabo/Softwares/lib/pkgconfig pkg-config --list-all | grep ibsimu` to confirm. – steeldriver Aug 04 '22 at 14:46
  • @steeldriver I'm trying for 3 days now to use this software, if you're thinking that the problem is just a mismatch in the names.... you're completely right! For some reason the author wrote ```ibsimu-1.0.6dev``` in the example Makefile, while the library was only ```ibsimu-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:52
  • ... the file name does appear to be `ibsimu-1.0.6dev.pc` if you clone the git repo as suggested on [the Download page](http://ibsimu.sourceforge.net/download.html) - maybe the sourceforge snapshot is different? – steeldriver Aug 04 '22 at 16:39
  • if you download the source from git or tar.gz, the file does appear to be same name `ibsimu-1.0.6dev.pc` but it only defferent folder. – abu-ahmed al-khatiri Aug 04 '22 at 19:35

0 Answers0