|
Boost : |
Subject: Re: [boost] [compute] Remove boost::chrono lib dependencie
From: Kyle Lutz (kyle.r.lutz_at_[hidden])
Date: 2016-12-01 01:40:05
On Wed, Nov 30, 2016 at 10:07 PM, Gavin Lambert <gavinl_at_[hidden]> wrote:
> On 1/12/2016 18:32, Kyle Lutz wrote:
>>>
>>> Would it be possible to remove the dependency for boost/chrono is
>>> boost/compute/detail/duration.hpp.
>>>
>>> As it already supports std::chrono via a macro, couldn't the inclusion of
>>> boost/chrono.hpp be excluded?
>>> As it is now, boost compute is dependent on having
>>> libboost_chrono-vc140-mt-gd-1_62.lib built.
>>
>>
>> Hi Viktor,
>>
>> You can remove the dependency on the Boost.Chrono compiled library by
>> defining "BOOST_CHRONO_HEADER_ONLY" before including any Boost
>> headers. See [1] for more details.
>
>
> I think the request was to allow defining BOOST_COMPUTE_NO_BOOST_CHRONO or
> similar which conditionally excludes the Boost.Chrono includes in a similar
> fashion to the existing BOOST_COMPUTE_NO_HDR_CHRONO and std::chrono.
>
> In a modular installation, this would mean that even the Boost.Chrono header
> files wouldn't be required to use Boost.Compute, in an environment where
> std::chrono is supported.
>
> I did a quick search of the code out of curiosity, and while the tests and
> examples assume Boost.Chrono exists, it doesn't look like any of the actual
> Boost.Compute code requires it, except for make_duration_from_nanoseconds
> itself, which has a std::chrono alternate implementation. (And it's called
> from a place where the duration type is templated, so should work with
> either.)
Ah yes, that is feasible.
If you could, please take a look at [1] and ensure that will meet your
needs. Thanks!
-kyle
[1] https://github.com/boostorg/compute/pull/670
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk