Boost logo

Boost Users :

Subject: Re: [Boost-users] Building boost to NOT USE built-in Visual Studio 2010TR1 random
From: John Maddock (boost.regex_at_[hidden])
Date: 2012-05-03 11:44:05


> boost 1.49.0 and Visual Studio 2010 / Visual Studio 2005 / & g++ 4.6.3 on
> (Win7 and Ubuntu 12.04)
> Build boost libs locally, using the local compilers.
>
> The objective is to get exactly the same random number generator behaviour
> for the same application built with VS2005, VS2010 and Gnu compilers.
>
> Building the same code, I see the* same normal & uniform* results under
> gnu
> and VS2005 builds (presumably boost random is used under VS2005).
>
> Building the same code, I see the different *normal results* under gnu and
> VS2010 builds (presumably the native VC lib is used under VS2010).
>
> So I would like to use (at least) boost's random library instead of the
> native Visual C++ 2010 library.
>
>>From boost docs I learned that it is possible to set up the boost config
> files such as to use/not use the native compiler/library TR1
> implementation:
> http://www.boost.org/doc/libs/1_49_0/libs/config/doc/html/index.html#boost_config.configuring_boost_for_your_platform
> http://www.boost.org/doc/libs/1_49_0/libs/config/doc/html/boost_config/boost_macro_reference.html
> http://www.boost.org/doc/libs/1_49_0/doc/html/boost_tr1/usage.html#boost_tr1.usage.native
>
> I cannot however, figure out how to do this from the above docs.
> BOOST_HAS_TR1_RANDOM comes into it, but I fail to get the big picture.
>
> Can anybody please advise?

You can't force the Boost.TR1 library *not* to use the native version if
it's available since those names have already been taken up in std::tr1.
Just use Boost.Random directly instead.

HTH, John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net