• 0

Configure/Make/Makefile dependency walker or package manager?


Question

Hi,

 

Lately I have been doing a lot of C++ programming and part of my workflow requires me to compile different libraries, etc... But the constant issue I run into with the ./configure|make command is that sometimes the source I'm trying to compile has dependencies on bunch of libraries and each library has its own array of dependencies. Is there a nice dependency checker? I compile my programs on Windows, Mac and Linux systems. So, something that can tell me which libraries I will need and possibly give me a URL or a command to install these packages on the OS I'm working on would be awesome!

 

Any suggestions?

 

* something like PIP, PHP composer or ruby gems would be cool!

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

If you're compiling the libraries yourself, you'll have to check and make sure you have the relevant dependencies for them. If the code uses GNU autotools, it should be making use of the M4 macro PKG_CHECK_MODULES().

Link to comment
Share on other sites

  • 0

If you're compiling the libraries yourself, you'll have to check and make sure you have the relevant dependencies for them. If the code uses GNU autotools, it should be making use of the M4 macro PKG_CHECK_MODULES().

 

I am compiling the source myself. I'm not sure if the source use GNU autotools but usually the common error I run into is when the program is compiling it throws an error saying XYZ library is not found. So, I have to install the library and when I attempt to compile again, the compiler complains about some other library not installed. Don't tell me this is how most C++ programmers work... HUGE waste of time!

 

Usually, installing a developers package takes care of a lot of the dependencies but it's still not the most efficient way to go. Ideally, if there was a tool that can determine what libraries the source depends on and whether my system currently has them or not is strongly desirable!

Link to comment
Share on other sites

  • 0

I am compiling the source myself. I'm not sure if the source use GNU autotools but usually the common error I run into is when the program is compiling it throws an error saying XYZ library is not found. So, I have to install the library and when I attempt to compile again, the compiler complains about some other library not installed.

The library's documentation should tell you its dependencies. Failing that, something like PKG_CHECK_MODULES() will notify you that something is missing.

 

Don't tell me this is how most C++ programmers work... HUGE waste of time!

Then don't compile the library from source. Install the developer version of it through your package manager. It's really not that difficult unless you are haphazardly pulling in outside source code.

On arch for example, I only have to 'yaourt -S gtk3' to install gtk3 + glib and all the associated development files such as headers, pkg-config files and so forth. I don't find it a waste of time at all.

 

Usually, installing a developers package takes care of a lot of the dependencies but it's still not the most efficient way to go. Ideally, if there was a tool that can determine what libraries the source depends on and whether my system currently has them or not is strongly desirable!

That's what PKG_CHECK_MODULES() is for. This only occurs when you're building said libraries from source. If you install with your package manager, it will bring through all relevant dependencies. If it's a reputable library, it should state its dependencies and requirements in its documentation.
Link to comment
Share on other sites

This topic is now closed to further replies.