[cfe-dev] [libc++] testing and installing libc++ into a non-standard location

Ovanes Markaryan om_clang at keywallet.com
Sun Apr 22 07:33:37 PDT 2012


Hi again!

On Sun, Apr 22, 2012 at 1:14 PM, Ovanes Markaryan <om_clang at keywallet.com>wrote:

> Hello *,
>
> would like to build a CMake toolset using clang and libc++. This means
> that the toolset is not going to be installed on the hosted OS. I have
> already clang 3.0 which is deployed to some path in my home directory on
> Linux and now tried to build the libc++. I checked out the tag libcpp-31
> from the subversion and now used the cmake command to build it:
>
>
> $ CXX="${HOME}/toolsets/clang_3.0/bin/clang++"
> CC="${HOME}/toolsets/clang_3.0/bin/clang"
> CMAKE_INSTALL_PREFIX="${HOME}/toolsets/clang_3.0" cmake
> ../clang-libcxx-tag_libcpp-31/
>

> This configures the build and generates the make file.
>
> Running make also compiles the lib without errors.
>
> Now running:
> $ make install
>
> results in errors, since the make file still tries to copy the library
> to: /usr/local/lib/libc++.so.1.0
>
> I was expecting it to copy the lib to: ${HOME}/toolsets/clang_3.0
>

I fixed this issue bei reading:
http://www.llvm.org/docs/CMake.html#freccmake

The command line looks now as:
$ CXX="${HOME}/toolsets/clang_3.0/bin/clang++"
CC="${HOME}/toolsets/clang_3.0/bin/clang" cmake
 -DCMAKE_INSTALL_PREFIX:PATH="${HOME}/toolsets/clang_3.0"
-DCMAKE_BUILD_TYPE:STRING=Release ../clang-libcxx-tag_libcpp-31/

now the installation goes to the right directory when calling make install.


>
>
> The next question is: How can I run tests to ensure that the libc++ build
> was fine? Clang is not installed on the host OS, and IMO should not, to
> avoid version clashing through automatic updates etc. Going to the libcxx
> directory and running:
>
> CXX=${HOME}/toolsets/clang_3.0/bin/clang++
> CC=${HOME}/toolsets/clang_3.0/bin/clang
> ../clang-libcxx-tag_libcpp-31/test/testit
>
> Result in:
> ****************************************************
> Results for /media/home_data/.../build_clang-libcxx-tag_libcpp-31:
> using clang version 3.0 (tags/RELEASE_30/final)
> Target: x86_64-unknown-linux-gnu
> Thread model: posix
> with -std=c++0x -stdlib=libc++
> ----------------------------------------------------
> sections without tests   : 1
> sections with failures   : 0
> sections without failures: 0
>                        +   ----
> total number of sections : 1
> ----------------------------------------------------
> number of tests failed   : 0
> number of tests passed   : 0
>                        +   ----
> total number of tests    : 0
> ****************************************************
>
> Does not seem to run any tests.
>
>
> Many thanks for your help,
> Ovanes
>

I saw in the same page there should be a "check" target. So I assumed
running:
$ make check

should runt the tests, but I got errors, that some clean-up failed.


Regards,
Ovanes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120422/9ee3af65/attachment.html>


More information about the cfe-dev mailing list