Boost logo

Boost-Build :

Subject: [Boost-build] Configuring modular -boost develop for b2 / bjam for Clang 3.9.1 on Windows 10 VS 2015 Update 3
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2017-02-27 10:22:26


I've trying and failing to install the latest Clang 3.9.1 on Windows 10, Visual studio 2015 14.0.25402.00 update 3 RC Version
4.6.01586.

modular-boost develop branch, currently up-to-date.

I:\modular-boost\libs\hello_boost\example>b2 -v
Boost.Jam Version 2015.07. OS=NT.
   Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc.
   Copyright 2001 David Turner.
   Copyright 2001-2004 David Abrahams.
   Copyright 2002-2015 Rene Rivera.
   Copyright 2003-2015 Vladimir Prus.

I can run the compiler from the command line and using CodeBlocks, for example:

clang++.exe -Wall -fexceptions -g -m64 -II:\modular-boost -I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\ucrt" -c
J:\Cpp\hellos\hello_boost\hello_boost.cpp -o obj\Debug\hellos\hello_boost\hello_boost.o
b2 -v

So I believe that the compiler is working OK.

-I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\ucrt" is needed to find corecrt.h
(and also a library link).

To try to match this my user-config contains

using clang
  : # version
    3.9.1
  : # location Clang compiler .exe location. # from http://llvm.org/releases/download.html
    # "C:\\Program Files\\LLVM\\bin\\clang++.exe"
    # "C:/Program Files/LLVM/bin/clang++.exe"
   : # options
    <cxxflags>-i"C:/Program Files (x86)/Windows Kits/10/Include/10.0.10586.0/ucrt"
  ;

One puzzling feature is that neither of the clang++.exe file specifications commented-out are recognized???

But these are OK.

"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\cl.exe"
"C:\\Program Files\\mingw-w64\\x86_64-4.9.1-win32-seh-rt_v3-rev1\\mingw64\\bin\\g++.exe"

Nor are either of these where the spaces after Program and File etc are misparsed after Program, missing the space, despite the
quotes around the whole file specification.

   # <cxxflags>-i"C:/Program Files (x86)/Windows Kits/10/Include/10.0.10586.0/ucrt"
   # <cxxflags>-i"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.10586.0\\ucrt"

What am I doing wrong here?

However, clang++.exe is found automatically by b2 configuration, so after commenting both file specifications out, it finds the
Clang compiler OK (but I want to have more than one version so I need to be able to differentiate them in future).

But when I let it proceed, the configuration fails to find cstddefs.h

clang-linux.compile.c++.without-pth
..\..\..\bin.v2\libs\hello_boost\example\hello_boost.test\clang-linux-3.9.1\debug\hello_boost.obj
In file included from hello_boost.cpp:15:
In file included from ..\..\..\boost/config.hpp:44:
..\..\..\boost/config/select_stdlib_config.hpp:18:12: fatal error: 'cstddef' file not found
# include <cstddef>
           ^
1 error generated.

  "clang++" -c -x c++ -O0 -g -fno-inline -Wall -g -m64 -DBOOST_ALL_NO_LIB=1 -I"..\..\.." -o
"..\..\..\bin.v2\libs\hello_boost\example\hello_boost.test\clang-linux-3.9.1\debug\hello_boost.obj" "hello_boost.cpp"

It is correct that it says "clang-linux-3.9.1" when the OK is Windows (MSYS2 also installed)?

Should I be using clang-cl.exe
"C:\\Program Files\\LLVM\\bin\\clang-cl.exe" ? Or ?

Do I need any

<cxxflags>-fms-compatibility-version=19.00 items?

<cxxflags>-i"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\0.0.10586.0\\ucrt"

(debug-configuration log attached in case that helps).

Suggestions please.

Thanks.

Paul

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



Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk