[cfe-users] libcxx.llvm.org linux build instructions unclear

Larry Evans cppljevans at suddenlink.net
Thu Jul 10 12:43:28 PDT 2014


On 07/10/2014 11:57 AM, Larry Evans wrote:
> On 07/10/2014 11:28 AM, Larry Evans wrote:
>> On 07/09/2014 12:23 AM, Ben Pope wrote:
>>> On Wednesday, July 09, 2014 02:48 AM, Larry Evans wrote:
>>>> The instructions on:
>>>>    http://libcxx.llvm.org/
>>>> say:
>>>>     We can now run CMake:
>>>>
>>>>      CC=clang CXX=clang++ cmake -G "Unix Makefiles"
>>>> -DLIBCXX_CXX_ABI=libstdc++
>>>> -DLIBCXX_LIBSUPCXX_INCLUDE_PATHS="/usr/include/c++/4.7/;/usr/include/c++/4.7/x86_64-linux-gnu/"
>>>>
>>>>
>>>>
>>>> -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
>>>> <libc++-source-dir>
>>>>
>>>> however, it does not say what to put for <libc++-source-dir>
>>>> or in which directory this command is to be run.  One might
>>>> guess this command is to be run inb the directory where the buildit
>>>> script is located, because that's what the earlier instructions
>>>> (for Mac OS) were run from; however, that's not at all clear.
>>>
>>> CMake encourages out of source build.
>>>
>>> You run CMake in your build directory and you point it to your source
>>> diectory (the one with CMakeLists.txt).
>>>
>>> E.g.:
>>>
>>> /libcxx_build
>>> /libcxx
>>>     /include
>>>     CMakeLists.txt
>>>
>>> cd /libcxx/build
>>> CMake ../libcxx
>>>
>>> Or:
>>> /libcxx
>>>     /build
>>>     /include
>>>     CMakeLists.txt
>>>
>>> cd /libcxx/build
>>> CMake ..
>>>
>>> Ben
>> Thanks Ben.
>>
>> I tried the 2nd directory hierarchy:
>>
>>    /home/evansl/dwnlds/llvm/svn/libcxx:
>>    total used in directory 144 available 242951424
>>    drwxrwxr-x 10 evansl evansl  4096 Jul 10 11:07 .
>>    drwxrwxr-x  4 evansl evansl  4096 Jul  8 13:14 ..
>>    -rw-rw-r--  1 evansl evansl    76 Jul  8 13:14 .arcconfig
>>    drwxrwxr-x  8 evansl evansl  4096 Jul 10 11:13 build
>>    drwxrwxr-x  3 evansl evansl  4096 Jul  8 13:14 cmake
>>    -rw-rw-r--  1 evansl evansl 10316 Jul  8 13:14 CMakeLists.txt
>>    -rw-rw-r--  1 evansl evansl   363 Jul  8 13:34 cmake.sh
> [snip]
>> std::__1::char_traits<char>; _Allocator = std::__1::allocator<char>]’:
>> function body not available
>>   basic_string<_CharT, _Traits, _Allocator>::basic_string()
>>   ^
>> /home/evansl/dwnlds/llvm/svn/libcxx/src/locale.cpp:4173:27: error:
>> called from here
>>         __thousands_sep_(',')
>>                             ^
>> [ 73%] Building CXX object lib/CMakeFiles/cxx.dir/__/src/hash.cpp.o
>> make[2]: *** [lib/CMakeFiles/cxx.dir/__/src/locale.cpp.o] Error 1
>> make[2]: *** Waiting for unfinished jobs....
>> make[1]: *** [lib/CMakeFiles/cxx.dir/all] Error 2
>> make: *** [all] Error 2
>> ~/dwnlds/llvm/svn/libcxx/build $
>>
>>
>> Any ideas how to resolve this issue?
>>
> [snip]
> Then, based on Marshall's suggestion, specified CXX, and it worked:
>
> Welcome to the Emacs shell
>
> ~/dwnlds/llvm/svn/libcxx/build $ ls
> logs
> ~/dwnlds/llvm/svn/libcxx/build $ CXX=clang++ cmake
> -DCMAKE_BUILD_TYPE=Release ..
> -- The CXX compiler identification is Clang 3.5.0
> -- The C compiler identification is GNU 4.9.0
[snip]
> -- Configuring done
> -- Generating done
> -- Build files have been written to:
> /home/evansl/dwnlds/llvm/svn/libcxx/build
> ~/dwnlds/llvm/svn/libcxx/build $ ls
> CMakeCache.txt  CMakeFiles  Makefile  cmake_install.cmake  include  lib
>   logs  test
> ~/dwnlds/llvm/svn/libcxx/build $ make -j 4
> Scanning dependencies of target cxx
> [  7%] [  7%] [ 11%] [ 15%] Building CXX object
> lib/CMakeFiles/cxx.dir/__/src/stdexcept.cpp.o
> Building CXX object lib/CMakeFiles/cxx.dir/__/src/mutex.cpp.o
> Building CXX object lib/CMakeFiles/cxx.dir/__/src/thread.cpp.o
> Building CXX object lib/CMakeFiles/cxx.dir/__/src/strstream.cpp.o
> [ 19%] [ 23%] [ 26%] Building CXX object
> lib/CMakeFiles/cxx.dir/__/src/debug.cpp.o
> Building CXX object lib/CMakeFiles/cxx.dir/__/src/regex.cpp.o
> Building CXX object lib/CMakeFiles/cxx.dir/__/src/utility.cpp.o
> [ 30%] Building CXX object lib/CMakeFiles/cxx.dir/__/src/exception.cpp.o
> [ 34%] Building CXX object lib/CMakeFiles/cxx.dir/__/src/locale.cpp.o
> /home/evansl/dwnlds/llvm/svn/libcxx/src/exception.cpp:118:9: warning:
> #warning is a language extension [-Wpedantic]
> #       warning uncaught_exception not yet implemented
>          ^
[snip]
> Linking CXX shared library libc++.so
> clang: warning: argument unused during compilation: '-nostdinc++'
> [100%] Built target cxx
> ~/dwnlds/llvm/svn/libcxx/build $
>
> Thanks Marshall :(
>
> -regards,
> Larry
Unfortunately, when using libcxx with a hello_world.cpp, get missing files:

make
ls -ld /usr/local/lib/libc++*
lrwxrwxrwx 1 root root      11 Jul 10 12:45 /usr/local/lib/libc++.so -> 
libc++.so.1
lrwxrwxrwx 1 root root      13 Jul 10 12:45 /usr/local/lib/libc++.so.1 
-> libc++.so.1.0
-rw-r--r-- 1 root root 1054759 Jul 10 11:53 /usr/local/lib/libc++.so.1.0
ls -ld /usr/local/include/c++/v1/../*
drwxr-xr-x 19 root root 4096 Jul  7 12:11 /usr/local/include/c++/v1/../4.9.0
drwxr-xr-x  5 root root 4096 Jul 10 12:45 /usr/local/include/c++/v1/../v1
/usr/local/bin/clang++ -std=c++11 -stdlib=libc++ -nostdinc 
-I/usr/local/include/c++/v1 -I/usr/local/include/c++/v1/../4.9.0 
-L/usr/local/lib hello_world.cpp -o hello_world.exe
In file included from hello_world.cpp:1:
/usr/local/include/c++/v1/../4.9.0/iostream:38:10: fatal error: 
'bits/c++config.h' file not found
#include <bits/c++config.h>
          ^
1 error generated.
make: *** [run] Error 1

Anyone have any ideas how to get libcxx to work on ubuntu?

uname -a
Linux lje-OptiPlex-9020 3.13.0-30-generic #55-Ubuntu SMP Fri Jul 4 
21:40:53 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

TIA

-regards,
Larry






More information about the cfe-users mailing list