Boost logo

Boost Users :

Subject: Re: [Boost-users] Mingw64 Boost Threads Build
From: Vladimir Prus (vladimir_at_[hidden])
Date: 2010-12-31 01:34:04


Dustin T. Clifford wrote:

> Good Afternoon,
>
> We have been using boost-threads for our native APIs and, thus far, Boost has been a godsend! We
> had a recent request to build a 64-bit version of this API. To accomplish this we have attempted
> to build using MinGW64. Unfortunately, I have had zero luck getting boost-threads to build. I can
> build the 32-bit address model without a problem but 64-bit continues to elude me.
>
> I first tried Boost 1.35.0 and have now moved on to 1.45.0. I believe that the environment is set
> up correctly (see below). This build is being performed on a Windows 7 64-bit using MinGW64 from
> Cygwin.
>
> export CC=x86_64-w64-mingw32-gcc.exe
> export CXX=x86_64-w64-mingw32-g++.exe
> export LD=x86_64-w64-mingw32-ld.exe

I don't think this environment variables have any effect on Boost.Build.

> I have, also, modified my PATH to use the appropriate 64-bit bintools and aliased gcc, g++ and ld
> to the 64-bit MinGW64 compilers and linkers.
>
> To build Boost I have used the following with no success.
>
> boostrap.sh address-model=64 -prefix=<install> --with-libraries=thread; bjam -a install;
> boostrap.sh -prefix=<install> --with-libraries=thread; bjam -a address-model=64 install;
> boostrap.sh -prefix=<install> --with-libraries=thread; bjam -a install;
>
> The last build attempt succeeds but appears to have built 32-bit binaries. The previous two fail
> in building boost-threads complaining that 'address-model-64' is not found for certain build
> artifacts.

Sadly, I don't quite understand what emits the above error message, and I'm not sure this
is 100% verbatim error message either.

> I have, also, tried the above with a prebuilt bjam with the same results.
>
> I have tried much more than what I have cited here (including MSVC builds)

MSVC is surely the easiest. Just type:

        bjam --with-thread address-model=64 toolset=msvc install

If you have one version of MSVC and it's installed in default paths, this should work
without any configuration.

For mingw, the right command line would be

        bjam --with-thread address-model=64 toolset=gcc install

However, you would have to setup user-config.jam to point to the right gcc (mingw one,
not cygwin one, at in the right location). See:

  http://www.boost.org/boost-build2/doc/html/bbv2/overview/configuration.html
  http://www.boost.org/boost-build2/doc/html/bbv2/reference/tools.html#bbv2.reference.tools.compiler.gcc

- Volodya


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