<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
On 04/19/2011 05:38 AM, Jean-Daniel Dupas wrote:
<blockquote
cite="mid:3B0CDDA9-3739-43B3-B3C0-93293E29AF56@shadowlab.org"
type="cite">
<pre wrap="">
Le 18 avr. 2011 à 23:06, Howard Hinnant a écrit :
</pre>
<blockquote type="cite">
<pre wrap="">On Apr 18, 2011, at 4:46 PM, Jon Kalb wrote:
</pre>
<blockquote type="cite">
<pre wrap="">On 4/16/11 12:34 AM, "Jean-Daniel Dupas" <a class="moz-txt-link-rfc2396E" href="mailto:devlists@shadowlab.org"><devlists@shadowlab.org></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Le 15 avr. 2011 à 18:58, Howard Hinnant a écrit :
</pre>
<blockquote type="cite">
<pre wrap="">On Apr 15, 2011, at 12:10 PM, Jon Kalb wrote:
</pre>
<blockquote type="cite">
<pre wrap="">
Howard, et. all,
Following the steps here: <a class="moz-txt-link-freetext" href="http://libcxx.llvm.org/">http://libcxx.llvm.org/</a>
I’m stuck here:
Where it says: “That should result in a libc++.1.dylib. To install it I like
to use links instead of copying, but either should work:”
Instead I get:
</pre>
<blockquote type="cite">
<pre wrap="">Jon-Kalbs-MacBook-Pro:lib jonkalb$ sudo ./buildit
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/algorithm.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/bind.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/chrono.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include
../src/condition_variable.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/exception.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/future.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/hash.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/ios.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/iostream.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/locale.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/memory.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/mutex.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/new.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/random.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/regex.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/stdexcept.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/string.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/strstream.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/system_error.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/thread.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/typeinfo.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/utility.cpp
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -fPIC -nostdinc++ -I../include ../src/valarray.cpp
+ cc algorithm.o bind.o chrono.o condition_variable.o exception.o future.o
hash.o ios.o iostream.o locale.o memory.o mutex.o new.o random.o regex.o
stdexcept.o string.o strstream.o system_error.o thread.o typeinfo.o
utility.o valarray.o -fPIC -o libc++.so.1.0 -shared -nodefaultlibs
-Wl,-soname,libc++.so.1 -lpthread -lrt -lc
ld: unknown option: -soname
collect2: ld returned 1 exit status
</pre>
</blockquote>
<pre wrap="">Any idea what I’m doing wrong?
Jon
</pre>
</blockquote>
<pre wrap="">
Hi Jon,
It looks like for some reason the following step:
$ export TRIPLE=-apple-
didn't take. You can confirm whether or not this happened with:
$ printenv
which should list:
TRIPLE=-apple-
</pre>
</blockquote>
<pre wrap="">
There is no reason you have to use sudo to build the library.
For security reason, sudo cleanup the environment by default. So the "buildit"
script is executed in a clean env without TRIPLE exported.
-- Jean-Daniel
</pre>
</blockquote>
<pre wrap="">
If I don't use sudo I get this:
Jon-Kalbs-MacBook-Pro:lib jonkalb$ ./buildit
+ for FILE in '../src/*.cpp'
+ clang++ -c -g -Os -arch i386 -arch x86_64 -std=c++0x -U__STRICT_ANSI__
-nostdinc++ -I../include ../src/algorithm.cpp
/usr/bin/lipo: can't create output file: algorithm.o (Permission denied)
clang: error: unable to remove file: algorithm.o: can't destroy file:
Permission denied
clang: error: lipo command failed with exit code 1 (use -v to see
invocation)
</pre>
</blockquote>
<pre wrap="">
It looks like you don't have write permission in the directory where you've checked out libc++. You should check out into some place where you would normally do development work.
Let us know if I've guessed wrong.
</pre>
</blockquote>
<pre wrap="">
The first build using sudo create the object file with owner "root", and so prevent execution of the builtit command as normal user. Restart from a fresh check out.
-- Jean-Daniel
_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a>
</pre>
</blockquote>
<br>
<b>Fix Your Permission:</b><br>
<br>
<b>// On Debian Sid Linux with /usr/local/bin/clang++ and
/usr/local/bin/clang from daily rebuilds:</b><br>
<br>
// assuming your group is the same as your username, therefore $sudo
chown owner:group -R ./ would be $sudo chown owner:owner -R ./.<br>
<br>
$ sudo chown username:username -R ./ inside the /buildTopLevel Path<br>
<br>
<br>
<b>CMake Option:</b><br>
<br>
I do a CMake build outside of /libc++ parallel to /libc++ as
/cmake-libc++<br>
<br>
<b>username@host:/path-To/cmake-libc++/$</b> cmake ../libc++
&& make -j3<br>
<br>
Of course inside CMakeCache.txt I can set the CXX and CC compilers
to /usr/local/bin/clang++ and /usr/local/bin/clang to use the latest
trunk <br>
Clang builds I build prior to rebuild libc++.<br>
<br>
username@host:/path-To/cmake-libc++/$ <font color="#000000">cmake <b>-DCMAKE_CXX_COMPILER=/usr/local/bin/clang++</b>
<b>-DCMAKE_CXX_COMPILER=/usr/local/bin/clang</b> <b>../libcxx/</b>
<b>&&</b> make -j3</font> <br>
<br>
//make -j<b>3</b> (<b>N</b>=3: <b>N-1</b>= actual number of cores.)
If I had 12 cores I'd really be thrilled at how quickly it builds.<br>
<br>
Or you can just vim your CMakeCache.txt file and update those paths
yourself by hand.<br>
<br>
$vim CMakeCache.txt and edit the
CMAKE_CXX_COMPILER=/usr/local/bin/clang++ by hand.<br>
<br>
<b>Second Option:</b><br>
<br>
Doing a straight ./buildit inside the /libc++ would have me do the
following: <br>
<br>
<b>username@host:/path-To/libc++$</b> sudo chown username:username
-R ./<br>
<br>
<b>username@host:/path-To/libc++/lib/$</b> ./buildit<br>
<br>
the buildit script defaults to GCC but you can change that to Clang
as well:<br>
<br>
Line 17: CXX=/usr/local/bin/clang++<br>
<br>
Obviously, this approach is not pleasing as $CXX will change as your
system updates. Debian has g++ -> g++-4.6 and just modifying the
buildit <br>
file each it ever gets updated by LLVM source is less than optimal,
or having it look for clang++ in your local or system path [lots of
devs don't like <br>
installing into their /usr/local path for ``pollution reasons''] nor
is resetting your CXX path. Cmake makes it convenient, besides
allowing an install <br>
path option whose prefix I set to /usr/local.<br>
<br>
Of course, the <b>testit</b> tests don't pass as I have yet to
figure out how to set them in the CMakeCache.txt file seeing as the
tests aren't locally <br>
installable under /usr/local that I've found, and thus the header
files to import aren't imported correctly when compiling the source
and thus leaving <br>
it to fail the tests.<br>
<br>
<br>
<b>username@host:/path-To/libc++/tests/$</b> ./testit<br>
<br>
Excerpt:<br>
^<br>
1 error
generated.
<br>
piecewise.pass.cpp failed to compile<br>
rv_pair_U_V.pass.cpp:16:10: fatal error: 'utility' file not found<br>
#include <utility><br>
^<br>
1 error
generated.
<br>
rv_pair_U_V.pass.cpp failed to compile<br>
swap.pass.cpp:16:10: fatal error: 'utility' file not found<br>
#include <utility><br>
^<br>
1 error
generated.
<br>
swap.pass.cpp failed to compile<br>
types.pass.cpp:18:10: fatal error: 'utility' file not found<br>
#include <utility><br>
^<br>
1 error
generated.
<br>
types.pass.cpp failed to compile<br>
U_V.pass.cpp:16:10: fatal error: 'utility' file not found<br>
#include <utility><br>
^<br>
1 error
generated.
<br>
U_V.pass.cpp failed to compile<br>
failed 12 tests in
/home/mdriftmeyer/DeveloperProjects/LLVMProject/libcxx/test/utilities/utility/pairs/pairs.pair<br>
comparison.pass.cpp:21:10: fatal error: 'utility' file not found<br>
#include <utility><br>
^<br>
1 error
generated.
<br>
comparison.pass.cpp failed to compile<br>
make_pair.pass.cpp:14:10: fatal error: 'utility' file not found<br>
#include <utility><br>
^<br>
1 error
generated.
<br>
make_pair.pass.cpp failed to compile<br>
non_member_swap.pass.cpp:16:10: fatal error: 'utility' file not
found<br>
#include <utility><br>
^<br>
1 error
generated.
<br>
non_member_swap.pass.cpp failed to compile<br>
failed 3 tests in
/home/mdriftmeyer/DeveloperProjects/LLVMProject/libcxx/test/utilities/utility/pairs/pairs.spec<br>
swap_array.pass.cpp:17:10: fatal error: 'utility' file not found<br>
#include <utility><br>
^<br>
1 error
generated.
<br>
swap_array.pass.cpp failed to compile<br>
swap.pass.cpp:17:10: fatal error: 'utility' file not found<br>
#include <utility><br>
<br>
****************************************************<br>
Results for
/home/mdriftmeyer/DeveloperProjects/LLVMProject/libcxx/test:<br>
using clang version 3.0 (trunk 129756)<br>
Target: x86_64-unknown-linux-gnu<br>
Thread model: posix<br>
with -std=c++0x -stdlib=libc++ <br>
----------------------------------------------------<br>
sections without tests : 1<br>
sections with failures : 828<br>
sections without failures: 235<br>
+ ----<br>
total number of sections : 1064<br>
----------------------------------------------------<br>
number of tests failed : 3795<br>
number of tests passed : 445<br>
+ ----<br>
total number of tests : 4240<br>
****************************************************<br>
<br>
<br>
I can only assume they would all pass if I knew a bit more of the
intricacies of CMake allowing the actual tests to install into the
/usr/local/ path for me to get their proper headers loaded.<br>
<br>
- Marc<br>
<br>
<div class="moz-signature">-- <br>
Marc J. Driftmeyer<br>
Email :: <a href="mailto:mjd@reanimality.com">mjd@reanimality.com</a><br>
Web :: <a href="http://www.reanimality.com">http://www.reanimality.com</a><br>
Cell :: (509) 435-5212
</div>
</body>
</html>