Subject: Re: [boost] [clang] Windows toolset support?
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2012-11-05 12:11:25
> -----Original Message-----
> From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]] On Behalf Of Paul A.
> Sent: Monday, October 29, 2012 9:34 AM
> To: boost_at_[hidden]
> Subject: Re: [boost] [clang] Windows toolset support?
> > On Tue, Oct 23, 2012 at 6:25 AM, Beman Dawes <bdawes_at_[hidden]> wrote:
> > > Cygwin has been shipping clang for six months or so. Has anyone
> > > gotten the cygwin/clang distribution (or any other clang
> > > distribution) to build boost?
> > >
> > > What toolset did you use?
> > >
> > > What does your user-config.jam file look like?
> > >
> > > Do you run bjam/b2 from the Windows command line or the bash command line?
> > I do not use cygwin, however I have successfully been building and
> > using Boost with Clang on
> > using the toolchain provided by rubenvb over at the Mingw-w64 project:
> > http://sourceforge.net/projects/mingw-
> > w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/cl
> > ang-3.1-release/
> > My user-config.jam is empty.
> > I compile with the following command line (windows command line):
> > > set OLDCD=%CD%
> > > pushd %BOOST_ROOT%
> > > set OLDPATH=%PATH%
> > > set PATH=%MINGW32_CLANG%;%MINGW32_CLANG%\bin\;%PATH%
> > > b2 -j %NUMBER_OF_PROCESSORS% toolset=clang cxxflags=-std=c++11
> > > address-model=32 architecture=x86 --stagedir=stage/clang-x86
> > > link=static runtime-link=static threading=multi debug-symbols=on
> > > define=WINVER=_WIN32_WINNT_VISTA
> > > define=_WIN32_WINNT=_WIN32_WINNT_VISTA
> > > stage > %OLDCD%\clang32.txt
> > > set PATH=%OLDPATH%
> > > popd
> > Unfortunately Boost is detecting the compiler as "clang.linux", but
> > other than that it seems to
> work for the
> > most part.
> > The stuff that doesn't work:
> > * Boost.Context (it fails to assemble its assembler files)
> > * Boost.Math (it attempts an 'rm' command, I assume because it thinks
> > it's on *nix)
> > * Boost.Python (the same ::hypot error that also plagues GCC in C++11
> > mode)
> > Most everything else seems to work okay (though I have to use pragmas
> > to disable a LOT of warnings when including boost headers, though that may simply be because I
> warnings enabled).
> > Clang support on Windows still needs a lot of work (Ruben tells me
> > that there's about half a
> > working on it on the Clang side), but perhaps some interest from the
> > Boost community would help
> > some more investment into the platform?
> This sounds rather promising.
> Having got Ruben's mingw gcc binary to work nicely with NetBeans, I tried to use Ruben's Clang
> binary, but I haven't got this configured right yet. Since NetBeans provides a nice IDE on
> Windows, I'm sure there will be lots of enthusiasm from Boosters to be able to use this compiler.
But I am now trying to build the Boost libraries using the mingw.
After some googling, I've added
# Clang compiler using mingw32 dw2 Ruben's release.
: # <cxxflags>-std="c++11"
<cxxflags>-v # diagnostics
<cflags>-nostdinc # Do not include MSVC C headers.
<cxxflags>-nostdinc++ # Do not include MSVC C++ headers.
# Instead use mingw-dw2 for includes
# includes like <cstddef.h> are at C:\mingw32-dw2\include\c++\4.6.3
to my user_config.jam with this results
clang version 3.1 (tags/RELEASE_31/final 161181) (llvm/tags/RELEASE_31/final 161243)
Thread model: posix
-cc1 -triple i686-w64-mingw32
-momit-leaf-frame-pointer -v -g -coverage-file
-D BOOST_ALL_NO_LIB=1 -D BOOST_TEST_DYN_LINK=1 -I .
-mstackrealign -fno-use-cxa-atexit -fno-inline -fgnu-runtime -fobjc-runtime-has-arc
-fobjc-runtime-has-weak -fobjc-fragile-abi -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -o C:/Users/Paul/AppData/Local/Temp/execution_monitor-536331.s
-x c++ "libs\\test\\src\\execution_monitor.cpp"
clang -cc1 version 3.1 based upon LLVM 3.1 default target i686-w64-mingw32
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
ignoring nonexistent directory "/mingw/include"
ignoring nonexistent directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
End of search list.
In file included from libs\test\src\execution_monitor.cpp:16:
In file included from .\boost/test/impl/execution_monitor.ipp:28:
In file included from .\boost/test/detail/config.hpp:19:
In file included from .\boost/config.hpp:40:
.\boost/config/select_stdlib_config.hpp:18:12: fatal error: 'cstddef' file not found
# include <cstddef>
1 error generated.