[Build/make tools] My strong interest in some 'boost-config' script...

Dear boosters, As a programmer under Unix-like systems, I really appreciate when a library (say `mylib') provides some `mylib-config' script that helps its users to build compiler flags. Several industrial strength libraries have such a tool: GSL, MySQL and, in the field of particle physics software I work: CLHEP, ROOT, CERNLIB... Here is an example for the GSL (GNU Scientific Library):
$ gsl-config Usage: gsl-config [OPTION]
Known values for OPTION are: --prefix show GSL installation prefix --libs print library linking information, with cblas --libs-without-cblas print library linking information, without cblas --cflags print pre-processor and compiler flags --help display this help and exit --version output version information An external CBLAS library can be specified using the GSL_CBLAS_LIB environment variable. The GSL CBLAS library is used by default. <<< I makes really easy to write rather portable makefiles using things like: CPPFLAGS+=$(shell gsl-config --cflags) LDFLAGS+=$(shell gsl-config --libs) Up to now and AFAIK it seems Boost does not provide such script that could be generated at build stage for any Unix-like system. Of course, I wrote my own script for my own usage (and for people who work with me). But at the end, I think it would be better to use an `official' tool. For my experience, it is also a strong argument to convince newbies to use Boost on top of standard C++, because it comes in some rather transparent way. So I have a few questions: - Is there such a script hidden in the Boost source tree? - If not, is there any plan to provide one? - Is someone else interested with it? Thank you very much for your comments. [hope this topic has not been addressed in the past! I apologize in advance for that!] regards frc [PS: I previously posted this mail within the wrong thread... sorry!] -- F.Mauger

On Wednesday 11 March 2009 06:54:24 François Mauger wrote:
Up to now and AFAIK it seems Boost does not provide such script that could be generated at build stage for any Unix-like system. Of course, I wrote my own script for my own usage (and for people who work with me). But at the end, I think it would be better to use an `official' tool. For my experience, it is also a strong argument to convince newbies to use Boost on top of standard C++, because it comes in some rather transparent way.
So I have a few questions: - Is there such a script hidden in the Boost source tree?
No, to the best of my knowledge.
- If not, is there any plan to provide one?
Again, no; however, if you use bjam or cmake, it is possible to obtain the information with a little extra work.
- Is someone else interested with it?
I am interested. However, this question should be asked in the boost.build and in the boost.cmake mailing lists because a boost-config file script would be generated at install time by the appropriate build system. It is very easy to write a cmake script to do it and is probably just as easy for boost.build. Patches would likely be welcome on both mailing lists. Regards, Ravi

On Wednesday 11 March 2009 11:54:24 François Mauger wrote:
As a programmer under Unix-like systems, I really appreciate when a library (say `mylib') provides some `mylib-config' script that helps its users to build compiler flags. Several industrial strength libraries have such a tool: GSL, MySQL and, in the field of particle physics software I work: CLHEP, ROOT, CERNLIB...
[...]
So I have a few questions: - Is there such a script hidden in the Boost source tree? I am not an expert in Boost, but I do not believe there is such a script, or even a pkg-config file. From the archives, the post
http://lists.boost.org/Archives/boost/2007/02/116513.php which is essentially identical to yours, received no replies. It seems most people use either the GNU autotools or the CMake build system to automatically find and use Boost headers and libraries. Of these, CMake is what I would recommend, unless you plan to deploy or compile on obscure Unix platforms. CMake provides the FindBoost.cmake, which in recent versions is quite decent.
- If not, is there any plan to provide one?
Not that I can see. It is not so easy to do as it first appears, though. Essentially, you would need to generate a pkg-config file containing the base include for boost, the path to the library install dir and the names of all the relevant libraries for the boost installation. However * such a file would need to be generated by the build system ** The build system in Boost is the little-known or used bjam system. ** Also, I think the system would also have to work with CMake, as I believe that boost can or soon will be able to build with CMake. * The system would need to be able to handle several parallel installs in different versions. * The system would have to somehow handle the several components that comprises boost. These difficulties might be large enough that it is beyond the scope of pkg- config or a utility script such as you describe. So perhaps simply using CMake (or GNU autotools) would be the simplest solution. Such a solution would also be able to automatically handle most or all or your configuration, dependencies, and installation needs. Personally, I think that Makefiles are only useful for small scripts or as an intermediate language.
- Is someone else interested with it?
Quite likely, though I think most people just goes with auto* or CMake. Hope this helps. -- Kind regards, Esben

Esben Mose Hansen wrote:
On Wednesday 11 March 2009 11:54:24 François Mauger wrote:
As a programmer under Unix-like systems, I really appreciate when a library (say `mylib') provides some `mylib-config' script that helps its users to build compiler flags. Several industrial strength libraries have such a tool: GSL, MySQL and, in the field of particle physics software I work: CLHEP, ROOT, CERNLIB...
[...]
So I have a few questions: - Is there such a script hidden in the Boost source tree? I am not an expert in Boost, but I do not believe there is such a script, or even a pkg-config file. From the archives, the post
http://lists.boost.org/Archives/boost/2007/02/116513.php
which is essentially identical to yours, received no replies. It seems most people use either the GNU autotools or the CMake build system to automatically find and use Boost headers and libraries. Of these, CMake is what I would recommend, unless you plan to deploy or compile on obscure Unix platforms. CMake provides the FindBoost.cmake, which in recent versions is quite decent.
- If not, is there any plan to provide one?
Not that I can see. It is not so easy to do as it first appears, though. Essentially, you would need to generate a pkg-config file containing the base include for boost, the path to the library install dir and the names of all the relevant libraries for the boost installation. However * such a file would need to be generated by the build system ** The build system in Boost is the little-known or used bjam system.
There's no "bjam system". The build tool used by C++ Boost is called Boost.Build. - Volodya

François Mauger wrote:
CPPFLAGS+=$(shell gsl-config --cflags) LDFLAGS+=$(shell gsl-config --libs)
Up to now and AFAIK it seems Boost does not provide such script that could be generated at build stage for any Unix-like system. Of course, I wrote my own script for my own usage (and for people who work with me). But at the end, I think it would be better to use an `official' tool. For my experience, it is also a strong argument to convince newbies to use Boost on top of standard C++, because it comes in some rather transparent way.
So I have a few questions: - Is there such a script hidden in the Boost source tree? - If not, is there any plan to provide one?
Yes, probably for next release. - Volodya
participants (4)
-
Esben Mose Hansen
-
François Mauger
-
Ravi
-
Vladimir Prus