Boost logo

Boost :

Subject: Re: [boost] Use of third-party libraries
From: John Maddock (boost.regex_at_[hidden])
Date: 2014-07-24 03:56:43


> On 23/07/2014 9:31 PM, Andrey Semashev wrote:
>> The library build scripts should perform auto-detection checks at
>> build time. I have something like this in Boost.Log, although I test
>> whether the compiler supports SSE/AVX and whether Message Compiler is
>> available. But the approach should be similar - you attempt to compile
>> a test application and set up build macros or select the actual
>> sources to build from.
>
> So let's say I'm trying to decide whether libpq is installed. Your
> suggestion is that I "attempt to compile a test application". So I would
> have to tell the compiler the location of libpq's incude directory (and
> if I attempt to link then I have to tell the linker the location of the
> libpq binary). Now, at the moment, the only way I know these locations
> is from the constants "libpq_include_dir" and "libpq_lib_dir", defined
> in user-config.jam (see
> http://quince-lib.com/preparation/configuring_boost_build.html). So I
> might as well test those constants directly, no? Or should I be
> determining the "installed" locations of those things by some other means?

While it can be convenient to have a backdoor that lets the user
explicitly set the path to the lib, on most Unix-like systems those
libraries will be installed in standard location which are searched by
default. You might want to look at how the multiprecision lib handles
locating gmp, mpfr etc for inspiration.

HTH, John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk