Boost logo

Boost :

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.
> Bristow
> 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
> Windows
> > 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
have all
> warnings enabled).
> >
> > Clang support on Windows still needs a lot of work (Ruben tells me
> > that there's about half a
> person
> > working on it on the Clang side), but perhaps some interest from the
> > Boost community would help
> drive
> > 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.
using clang
  : 3.1
  : "C:/mingw32-dw2/bin/clang++.exe"
  : # <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
    <cxxflags>-cxx-include-arch="C:/mingw32-dw2/i686-w64-mingw32"
    <cxxflags>-cxx-include-root="C:/mingw32-dw2/include/c++/4.6.3"
    <cxxflags>-cxx-include-32bit-dir=32
    <cxxflags>-stdlib=libc++
    <linkflags>-stdlib=libc++
  ;
  
  # includes like <cstddef.h> are at C:\mingw32-dw2\include\c++\4.6.3

to my user_config.jam with this results

compile.c++.without-pth
i:\boost-trunk\boost\bin.v2\libs\test\build\clang-linux-3.1\debug\threading-multi\execution_monitor.
obj
clang version 3.1 (tags/RELEASE_31/final 161181) (llvm/tags/RELEASE_31/final 161243)
Target: i686-w64-mingw32
Thread model: posix
 "C:/mingw32-dw2/bin/clang++.exe"
-cc1 -triple i686-w64-mingw32
-S
-disable-free -disable-llvm-verifier
-main-file-name execution_monitor.cpp
-mrelocation-model static
-mdisable-fp-elim
-mconstructor-aliases
 -target-cpu pentium4
-target-linker-version 2.22.0.20120323
-momit-leaf-frame-pointer -v -g -coverage-file
C:/Users/Paul/AppData/Local/Temp/execution_monitor-536331.s
-nostdinc++
-resource-dir "C:/mingw32-dw2/bin\\..\\lib\\clang\\3.1"
 -D BOOST_ALL_NO_LIB=1 -D BOOST_TEST_DYN_LINK=1 -I .
 -fmodule-cache-path "C:\\Users\\Paul\\AppData\\Local\\Temp\\clang-module-cache"
-stdlib=libc++
 -O0 -Wall
 -pedantic
-fdeprecated-macro
-fno-dwarf-directory-asm
 -ferror-limit 19
-fmessage-length 0
-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
"C:/mingw32-dw2/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include"
ignoring nonexistent directory "/mingw/include"
ignoring nonexistent directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 .
 C:/mingw32-dw2/bin/../lib/clang/3.1/include
 C:/mingw32-dw2/bin/../lib/clang/3.1/../../../i686-w64-mingw32/include
 C:/mingw32-dw2/bin/../lib/clang/3.1/../../../include
 c:/mingw/include
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.


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