Ask Your Question
1

can't create Sage clone

asked 2011-01-09 21:37:00 +0100

araichev gravatar image

updated 2015-01-13 22:43:19 +0100

FrédéricC gravatar image

Hi all:

I just tried to create a Sage 4.6 sandbox to start writing patches with but got some apparently fatal errors running Mac OS 10.6 with the latest version of Xcode installed. Any suggestions?

Alex

raichev@wujarch-l/Applications/sage> ./sage -clone dabble
Now cloning the current Sage library branch...
hg clone  sage sage-dabble 
updating working directory
2339 files updated, 0 files merged, 0 files removed, 0 files unresolved
Copying over all Cython auto-generated .c, .cpp and .h files...
Copying over build directory...
Copying over all auto-generated reference manual .rst files...
Copying over documentation output...
Building sage-dabble...
sage -b dabble

----------------------------------------------------------
sage: Building and installing modified Sage library files.


Installing c_lib
gcc -o src/convert.os -c -fPIC -I/Applications/sage/local/include -I/Applications/sage/local/include/python2.6 -I/Applications/sage/local/include/NTL -Iinclude src/convert.c
In file included from include/convert.h:12:0,
                 from src/convert.c:14:
/Applications/sage/local/include/pari/pari.h:20:47: fatal error: stdlib.h: No such file or directory
compilation terminated.
scons: *** [src/convert.os] Error 1
ERROR: There was an error building c_lib.


real    0m0.848s
user    0m0.281s
sys 0m0.224s
Error building Sage

After cloning, if you change any Sage library files and want to rebuild
the html version of the reference manual, use the command
    sage -docbuild reference html
(after running 'sage -b').

Note: if *before* cloning, you have changed any Sage library files
without rebuilding the reference manual, then after cloning, you
will need to touch those files again if you want the changes
to be incorporated into the reference manual.

Updating modification times for the documentation...
sage -docbuild --update-mtimes reference html
Warning: Could not import sage.combinat.words.morphism dlopen(/Applications/sage/local/lib/python2.6/site-packages/sage/rings/memory.so, 2): Library not loaded: libcsage.dylib
  Referenced from: /Applications/sage/local/lib/python2.6/site-packages/sage/rings/memory.so
  Reason: image not found
Warning: Could not import sage.crypto.block_cipher.miniaes dlopen(/Applications/sage/local/lib/python2.6/site-packages/sage/rings/memory.so, 2): Library not loaded: libcsage.dylib
  Referenced from: /Applications/sage/local/lib/python2.6/site-packages/sage/rings/memory.so
  Reason: image not found

[lots of the same and then...]

sphinx-build -b html -d /Applications/sage/devel/sage/doc/output/doctrees/en/reference    /Applications/sage/devel/sage/doc/en/reference /Applications/sage/devel/sage/doc/output/html/en/reference
Traceback (most recent call last):
  File "/Applications/sage/local/bin/sphinx-build", line 6, in <module>
    import sage.all
  File "/Applications/sage/local/lib/python2.6/site-packages/sage/all.py", line 56, in <module>
    from sage.rings.memory import pmem_malloc
ImportError: dlopen(/Applications/sage/local/lib/python2.6/site-packages/sage/rings/memory.so, 2): Library not loaded: libcsage.dylib
  Referenced from: /Applications/sage/local/lib/python2.6/site-packages/sage/rings/memory.so
  Reason: image not found
Build finished.  The built documents can be found in /Applications/sage/devel/sage/doc/output/html/en/reference
*** WARNING ***
If you are cloning ...
(more)
edit retag flag offensive close merge delete

4 Answers

Sort by » oldest newest most voted
2

answered 2011-01-10 21:16:56 +0100

DSM gravatar image

updated 2011-01-10 21:26:50 +0100

Okay, this is progress. I've seen this ___emutls_get_address problem myself before. It's picking up a library that it shouldn't, namely /usr/local/lib/libstdc++.6.dylib: I don't have any such library there, and I compile in both C and C++ all the time; those libraries live in /usr/lib. It's quite likely it's picking up an incompatible version and not finding the functions, because of a library path ordering issue so that /usr/local/lib is dominating /usr/lib (which is often what you want).

First, for information purposes: could you confirm that you have libstdc++ in /usr/lib via ls -la /usr/lib/libstdc*? You should have the library itself (6.0.9, I think) and an unversioned symbolic link pointing to it. Then use "file /usr/local/lib/libstdc++.6.dylib" (or whatever the name is: I don't have the file so it's easy for me to have typos!) to look at the architecture for that one.

Second, for an attempt at an actual solution: try moving /usr/local to /usr/local_tmp and recompiling. There's nothing in /usr/local that you should need to compile Sage -- and I think the existence of this alternate library from one of the SDK packages is causing the problems.

(BTW, I don't think there's anyone here called Miles. There's Niles, and there's me, who wrote the reply, but that's it. :^)

edit flag offensive delete link more
1

answered 2011-01-10 04:14:07 +0100

DSM gravatar image

I'm running OS X 10.6.5 and Xcode 3.2.5 (1760). I just downloaded a fresh install [sage-4.6-OSX-64bit-10.6-i386-Darwin.dmg], copied the volume into /Applications in the usual way, and installed sage-mode. Cloning worked for me:

localhost:sage mcneil$ ./sage -clone local_mod
Now cloning the current Sage library branch...
hg clone  sage sage-local_mod 
updating working directory
2339 files updated, 0 files merged, 0 files removed, 0 files unresolved
Copying over all Cython auto-generated .c, .cpp and .h files...
Copying over build directory...
Copying over all auto-generated reference manual .rst files...
Copying over documentation output...
Building sage-local_mod...
sage -b local_mod

----------------------------------------------------------
sage: Building and installing modified Sage library files.


Installing c_lib
gcc -o src/convert.os -c -fPIC -I/Applications/sage/local/include -I/Applications/sage/local/include/python2.6 -I/Applications/sage/local/include/NTL -Iinclude src/convert.c

[etc]

I think the key is figuring out why it can't find your stdlib.h. The corresponding line in pari.h is #include <stdlib.h>, so it should pick up from the environment. By inserting garbage into /usr/include/stdlib.h and forcing a rebuild I confirmed that's the one it's using for me (and not one of the SDK versions it noticed). Could you check the existence and permissions of /usr/include/stdlib.h as well as your environment variables? What include paths does your gcc use?

edit flag offensive delete link more
0

answered 2011-01-10 20:43:32 +0100

araichev gravatar image

Too much text to post as a comment and so i'm posting as an answer, which it is not.

Thanks for your reply, Miles. I reinstalled Xcode 3.2.5 and Sage 4.6 and tried again. I got farther this time but ran into import errors again. Before i show them to you, here are my stdlib.h permissions and environment variables after i ran './sage -clone dabble'.

raichev@wujarch-l/Applications/sage> ls -l /usr/include/stdlib.h -r--r--r-- 1 root wheel 11765 8 Apr 2010 /usr/include/stdlib.h

raichev@wujarch-l/Applications/sage> env MANPATH=/opt/local/share/man: TERM_PROGRAM=Apple_Terminal TERM=xterm-color SHELL=/bin/bash TMPDIR=/var/folders/2e/2evYyNsKFPGu2rQe+hRQrE+++TI/-Tmp-/ Apple_PubSub_Socket_Render=/tmp/launch-KOQaxa/Render TERM_PROGRAM_VERSION=273 USER=raichev LD_LIBRARY_PATH=:/Users/raichev/usr/lib COMMAND_MODE=unix2003 SSH_AUTH_SOCK=/tmp/launch-lgNZeN/Listeners __CF_USER_TEXT_ENCODING=0x1F5:0:0 PATH=/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin:/Users/raichev/usr/bin LD_RUN_PATH=:/Users/raichev/usr/lib PWD=/Applications/sage EDITOR=/usr/bin/vim LANG=en_NZ.UTF-8 HISTIGNORE=&:ls:[bf]g:exit:logout:cd HISTCONTROL=ignoreboth SHLVL=1 HOME=/Users/raichev PYTHONPATH=:/Users/raichev/slippenspythonlib:/Users/raichev/usr/lib/python2.5/site-packages LOGNAME=raichev CLASSPATH=:/Users/raichev/foo/bar.jar PKG_CONFIG_PATH=:/Users/raichev/usr/lib/pkgconfig DISPLAY=:0.0 _=/usr/bin/env OLDPWD=/Applications/sage/devel/sage-dabble

Now for the clone attempt.

raichev@wujarch-l/Applications/sage> ./sage -clone dabble

Now cloning the current Sage library branch... hg clone sage sage-dabble updating working directory 2339 files updated, 0 files merged, 0 files removed, 0 files unresolved Copying over all Cython auto-generated .c, .cpp and .h files... Copying over build directory... Copying over all auto-generated reference manual .rst files... Copying over documentation output... Building sage-dabble... sage -b dabble


sage: Building and installing modified Sage library files.

Installing c_lib gcc -o src/convert.os -c -fPIC -I/Applications/sage/local/include -I/Applications/sage/local/include/python2.6 -I/Applications/sage/local/include/NTL -Iinclude src/convert.c gcc -o src/interrupt.os -c -fPIC -I/Applications/sage/local/include -I/Applications/sage/local/include/python2.6 -I/Applications/sage/local/include/NTL -Iinclude src/interrupt.c gcc -o src/mpn_pylong.os -c -fPIC -I/Applications/sage/local/include -I/Applications/sage/local/include/python2.6 -I/Applications/sage/local/include/NTL -Iinclude src/mpn_pylong.c gcc -o src/mpz_pylong.os -c -fPIC -I/Applications/sage/local/include -I/Applications/sage/local/include/python2.6 -I/Applications/sage/local/include/NTL -Iinclude src/mpz_pylong.c gcc -o src/mpz_longlong.os -c -fPIC -I/Applications/sage/local/include -I/Applications/sage/local/include/python2.6 -I/Applications/sage/local/include/NTL -Iinclude src/mpz_longlong.c gcc -o src/stdsage.os -c -fPIC -I/Applications/sage/local/include -I/Applications/sage/local/include/python2.6 -I/Applications/sage/local/include/NTL -Iinclude src/stdsage.c gcc -o src/gmp_globals.os -c -fPIC -I/Applications/sage/local/include -I ...

(more)
edit flag offensive delete link more
0

answered 2011-01-10 21:57:13 +0100

araichev gravatar image

Woops, sorry Niles. And thanks DSM for your quick reply. Following your instructions i get the following.

raichev@wujarch-l~> ls -la /usr/lib/libstdc* -rw-r--r-- 1 root wheel 15400372 25 Jun 2010 /usr/lib/libstdc++-static.a -rwxr-xr-x 1 root wheel 2439888 19 May 2009 /usr/lib/libstdc++.6.0.9.dylib* lrwxr-xr-x 1 root wheel 21 4 Sep 2009 /usr/lib/libstdc++.6.dylib@ -> libstdc++.6.0.9.dylib

raichev@wujarch-l~> file /usr/local/lib/libstdc++.6.dylib /usr/local/lib/libstdc++.6.dylib: Mach-O 64-bit dynamically linked shared library x86_64

I moved /usr/local to /usr/local_temp, tried cloning again, and 22m22.782s later... It works! Hooray! Thanks Niles and DSM. Now i can get back to contributing code to Sage.

Oh, when can i or should i move /usr/local_temp back to /usr/local?

edit flag offensive delete link more

Comments

Okay, glad it worked! As for restoring /usr/local, that's up to you, but it's quite possible it'll cause trouble for something else (google for ___emutls_get_address to see lots of non-Sage related build problems it causes). Now that it's pretty clear what the problem is, you might consider just removing/renaming the incorrect libraries. And don't forget to accept the answer that works [i.e. the answer recommending renaming /usr/local], er.. so that future people can find it easier, yeah, that's it. ;^)

DSM gravatar imageDSM ( 2011-01-10 22:08:48 +0100 )edit

I'm glad it's working too; thanks @DSM :) And Alex, don't forget to mark that answer "accepted" (the little check mark).

niles gravatar imageniles ( 2011-01-11 04:05:12 +0100 )edit

Thanks again, folks. This site is great! DSM, are you saying that i can probably move /usr/local_temp back to /usr/local without problems if i rename or remove /usr/local/lib/libstdc++.6.dylib?

araichev gravatar imagearaichev ( 2011-01-11 15:26:58 +0100 )edit

Yep. For example, I have a /usr/local directory with various bits. But although that library is clearly causing issues, I don't know if there's an incompatible something else (whether in /usr/local/lib or in /usr/local/include) which may cause problems, so while I figure it's probably necessary I don't know if it's enough. Shouldn't take too long to test, though.

DSM gravatar imageDSM ( 2011-01-11 18:46:45 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-01-09 21:37:00 +0100

Seen: 1,121 times

Last updated: Jan 10 '11