Boost logo

Boost :

Subject: [boost] Libc++ failures on linux
From: Tom Kent (lists_at_[hidden])
Date: 2017-03-10 22:33:51


So I tried to add my first linux regression runner using libc++ with clang,
and I'm seeing the following error saying it can't find <cstddef>:
http://www.boost.org/development/tests/develop/developer/output/teeks99-02-dc3-9-1z-lc-Docker-64on64-boost-bin-v2-libs-accumulators-test-count-test-clang-linux-3-9~c++1z~lc-debug-link-static.html

  "clang++-3.9" -c -x c++ -Wno-c99-extensions -std=c++1z -stdlib=libc++ -O0
-g -fno-inline -Wall -g -m64 -DBOOST_ALL_NO_LIB=1
-DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_CHRONO_THREAD_DISABLED
-DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1
-DBOOST_TEST_NO_AUTO_LINK=1 -DBOOST_TIMER_STATIC_LINK=1 -I".." -o
"/var/boost/run/results/boost/bin.v2/libs/accumulators/test/count.test/clang-linux-3.9~c++1z~lc/debug/link-static/count.o"
"../libs/accumulators/test/count.cpp"

In file included from ../libs/accumulators/test/count.cpp:6:
In file included from ../boost/test/unit_test.hpp:18:
In file included from ../boost/test/test_tools.hpp:17:
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.

However when I try to compile the following program on the same docker
image (teeks99/boost-build:clang-3.9)

// basic.cpp
#include <cstddef>

int main(int argc, char* argv[])
{
   size_t three = 3;
   return three;
}

with:

$ clang++-3.9 -stdlib=libc++ -std=c++1z basic.cpp

It works fine
$ ./a.out
$ echo $?
3

I can build this sample file fine with the whole command line shown above,
so it doesn't seem to be one of the other options conflicting.

Any thoughts on why boost code wouldn't be able to find this but some basic
stuff would?

One relevant detail, I'm building with clang 3.9, however the libc++
version that I'm using (ubuntu default) is the one that shipped with clang
3.7. That shouldn't preclude including a file!

I also found a couple old threads with the same error, but never any good
resolution.
http://lists.boost.org/boost-testing/2012/07/7075.php
http://lists.boost.org/boost-users/2012/11/76659.php

Tom


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