Boost logo

Boost :

Subject: Re: [boost] [build] How to use with clang on windows?
From: degski (degski_at_[hidden])
Date: 2016-03-27 11:19:49


[THIS IS MY SECOND TRY SENDING THIS EMAIL]

Hi John,

Been looking a bit into what you were trying, and found the following:

using clang : : "C:/Progra~2/LLVM/bin/clang.exe" : <cxxflags>-std=c++14
> <compatibility>vc14 <cxxflags>-fms-compatibility-version=19.00.22609 ;
>

clang.jam (for the moment) dispatches to linux by default (this is easily
changed) or invoke with clang-win instead of clang. Then clang.exe needs to
be clang-cl.exe (clang-win.jam has this hardcoded). The different binaries
(although simple copies) behave differently depending on the file name, it
seems, f.e. "clang-cl.exe /?" works, while "clang-cl.exe -help" does not
work, this is the opposite for clang.exe, clang++.exe. There's also a
cl.exe in the binaries, again a copy, but does it work the same? Would be
nice if the clang people could clarify this.

I've applied Steven's patch to the RC2. And I've used this:

using clang-win : 3.9 : "C:/PROGRA~2/LLVM/bin/clang-cl.exe" :
<compatibility>vc14 ;

Then I run:

bjam cxxflags="-Xclang -std=c++14 -Xclang -O2 -fms-compatibility
-fmsc-version=1900" "-sZLIB_SOURCE=%HOME%\zlib-1.2.8"
"-sBZIP2_SOURCE=%HOME%\bzip2-1.0.6" variant=release instruction-set=haswell
threading=multi link=static runtime-link=static
--stagedir=stage64_static_release address-model=64 architecture=x86
--without-python --without-mpi --disable-filesystem2 install >
msvc_log_install.log

This is not exactly how it should work IMHO, -Xclang -O2 should be /O2, but
that doesn't work. Above features haswell, but should be broadwell (don't
exist).

This gets me 15 libs (including bzip, zlib and nowide, so actually 12) out
of an expected 36:

libboost_atomic-39-mt-s-1_61.lib
libboost_bzip2-39-mt-s-1_61.lib
libboost_chrono-39-mt-s-1_61.lib
libboost_container-39-mt-s-1_61.lib
libboost_date_time-39-mt-s-1_61.lib
libboost_exception-39-mt-s-1_61.lib
libboost_filesystem-39-mt-s-1_61.lib
libboost_iostreams-39-mt-s-1_61.lib
libboost_nowide-39-mt-s-1_61.lib
libboost_program_options-39-mt-s-1_61.lib
libboost_random-39-mt-s-1_61.lib
libboost_regex-39-mt-s-1_61.lib
libboost_system-39-mt-s-1_61.lib
libboost_timer-39-mt-s-1_61.lib
libboost_zlib-39-mt-s-1_61.lib

There is an issue with the toolset variable, the file-names come out as
f.e. libboost_regex-39-mt-s-1_61.lib.

 I'll attach the build log, some libraries don't compile because of the
issues raised by me in the other thread (typeof and type_traits). Some
options that don't belong to clang-cl.exe (see clang-cl.exe /?) get
presented to it, f.e. clang-cl.exe: warning: unknown argument ignored in
clang-cl: '-ftemplate-depth-1024'.

[SCRAP THAT, ATTACHEMENT REJECTED BY THE MODERATOR, 1MB (WTF) IS TOO MUCH]

Let me know if you're interested in the build log (I can send it to your
gmail-account if you would like that),

degski


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