Boost logo

Boost :

Subject: Re: [boost] Clang 4.0.0 MPL error in Boost next.hpp and prior.hpp
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2017-03-28 14:18:41


> -----Original Message-----
> From: Boost [mailto:boost-bounces_at_[hidden]] On Behalf Of Peter Dimov via Boost
> Sent: 27 March 2017 18:12
> To: boost_at_[hidden]
> Cc: Peter Dimov
> Subject: Re: [boost] Clang 4.0.0 MPL error in Boost next.hpp and prior.hpp
>
> Paul A. Bristow wrote:
> The correct way to set the include path is with
>
> <include>"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include"

Adding that to my clang compiler options in my user-config.jam has no effect (wrong place?).

But adding that to my hello_boost jamfile produces a command line

  "C:/LLVM/bin/clang.exe" -c -x c++ -O0 -g -fno-inline -Wall -g -v -fmsc-version=1900 -m64 -DBOOST_ALL_NO_LIB=1 -I"..\..\.."
-I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" -o
"..\..\..\bin.v2\libs\hello_boost\example\hello_boost.test\clang-linux-4.0.0\debug\hello_boost.obj" "hello_boost.cpp"

which is as I expect - apart from the clang-linux rather than clang-msvc or clang-win?

It start as I expect too

clang version 4.0.0 (tags/RELEASE_400/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\LLVM\bin
 "C:\\LLVM\\bin\\clang.exe" -cc1 -triple x86_64-pc-windows-msvc19.0.0 -emit-obj -mrelax-all -mincremental-linker-compatible
-disable-free -main-file-name hello_boost.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -momit-leaf-frame-pointer -v -dwarf-column-info -debug-info-kind=limited
-dwarf-version=4 -debugger-tuning=gdb -coverage-notes-file
"I:\\modular-boost\\libs\\hello_boost\\example\\..\\..\\..\\bin.v2\\libs\\hello_boost\\example\\hello_boost.test\\clang-linux-4.0.0\
\debug\\hello_boost.gcno" -resource-dir "C:\\LLVM\\bin\\..\\lib\\clang\\4.0.0" -D BOOST_ALL_NO_LIB=1 -I "..\\..\\.." -I "C:\\Program
Files (x86)\\Microsoft Visual Studio 14.0\\VC\\include" -internal-isystem "C:\\LLVM\\bin\\..\\lib\\clang\\4.0.0\\include"
-internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.10586.0\\ucrt" -O0 -Wall -fdeprecated-macro
-fdebug-compilation-dir "I:\\modular-boost\\libs\\hello_boost\\example" -ferror-limit 19 -fmessage-length 0 -fms-extensions
-fms-compatibility -fms-compatibility-version=19.0 -std=c++14 -fdelayed-template-parsing -fno-inline -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -o
"..\\..\\..\\bin.v2\\libs\\hello_boost\\example\\hello_boost.test\\clang-linux-4.0.0\\debug\\hello_boost.obj" -x c++ hello_boost.cpp
clang -cc1 version 4.0.0 based upon LLVM 4.0.0 default target x86_64-pc-windows-msvc
#include "..." search starts here:
#include <...> search starts here:
 ..\..\..
 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include
 C:\LLVM\bin\..\lib\clang\4.0.0\include
 C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\ucrt

but then there are warnings, and then terminates with extreme prejudice :-(

In file included from hello_boost.cpp:13:
In file included from ..\..\..\boost/config.hpp:48:
In file included from ..\..\..\boost/config/stdlib/dinkumware.hpp:98:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\typeinfo:21:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\exception:320:8: warning: private field '_Data1' is not used
[-Wunused-private-field]
        void* _Data1;
              ^
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\exception:321:8: warning: private field '_Data2' is not used
[-Wunused-private-field]
        void* _Data2;
              ^
Assertion failed: ~FI && "Expected valid index", file D:\src\llvm_package_4.0.0\llvm\lib\CodeGen\AsmPrinter/DwarfDebug.h, line 92
Wrote crash dump file "C:\Users\Paul\AppData\Local\Temp\clang.exe-ad54f0.dmp"
...

So, in some desperation, I changed my system variable INCLUDE to provide the necessary MSVC include files, and could then use bjam
to build the chrono and system libraries with Clang (lots of warnings, some not suppressible) , and run my timing test to compare
Lambert_w timing with GCC and MSVC (surprisingly Clang and MSVC are similar but GCC takes over twice as long).

Phew!

But thanks for all your many efforts on my behalf. I think that the changed to MPL config were critically important).

Paul

PS I think the next step is to install the VS 2017 upgrade and hope this include problem just goes away.

PPS (Changing the system INCLUDE might not be a good idea? Does anyone know how this works usually?
C:\Users\Paul\AppData\Local\Temp\b2_msvc_14.0_vcvarsall_x86.cmd contains this setting

SET INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt;C:\Program Files (x86)\Windows
Kits\NETFXSDK\4.6.1\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\shared;C:\Program Files (x86)\Windows
Kits\10\include\10.0.10586.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\winrt;C:\Program Files (x86)\Windows
Kits\10\Include\10.0.10586.0\ucrt)

so how is Clang not finding/using it???

---
Paul A. Bristow
Prizet Farmhouse
Kendal UK LA8 8AB
+44 (0) 1539 561830

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