Ask Your Question
1

%cython in notebook doesn’t work anymore

asked 2014-11-16 11:49:45 -0500

Fabrice gravatar image

updated 2015-01-13 13:51:43 -0500

FrédéricC gravatar image

hello,
running sage-6.3.app on macosx 10.9.5, i can’t use %cython in the notebook anymore (it used to work some time ago though, with older sage and system versions);
i get the following: error: command 'gcc' failed with exit status 1
more precisely, gcc doesn’t find a certain file limits.h (see details below) that, however, exists at the given address - i checked it;
how can i make it work again?

PS: same gcc error when loading a .spyx file in the command line
PS2: same errors with the 6.4 version (sage-6.4-x86_64-Darwin-OSX_10.9_x86_64.dmg)

gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Sage-6.3.app/Contents/Resources/sage/local/include/csage -I/Applications/Sage-6.3.app/Contents/Resources/sage/local/include -I/Applications/Sage-6.3.app/Contents/Resources/sage/local/include/python2.7 -I/Applications/Sage-6.3.app/Contents/Resources/sage/local/lib/python/site-packages/numpy/core/include -I/Applications/Sage-6.3.app/Contents/Resources/sage/src/sage/ext -I/Applications/Sage-6.3.app/Contents/Resources/sage/src -I/Applications/Sage-6.3.app/Contents/Resources/sage/src/sage/gsl -I/Users/fabrice/.sage/sage_notebook.sagenb/home/admin/123/code -I/Applications/Sage-6.3.app/Contents/Resources/sage/local/include/python2.7 -c _Users_fabrice__sage_sage_notebook_sagenb_home_admin_123_code_sage2_spyx_0.c -o build/temp.macosx-10.9-x86_64-2.7/_Users_fabrice__sage_sage_notebook_sagenb_home_admin_123_code_sage2_spyx_0.o -w -O2
In file included from /Applications/Sage-6.3.app/Contents/Resources/sage/local/bin/../lib/gcc/x86_64-apple-darwin13.3.0/4.7.3/include-fixed/syslimits.h:7:0,
                 from /Applications/Sage-6.3.app/Contents/Resources/sage/local/bin/../lib/gcc/x86_64-apple-darwin13.3.0/4.7.3/include-fixed/limits.h:34,
                 from /Applications/Sage-6.3.app/Contents/Resources/sage/local/include/python2.7/Python.h:19,
                 from _Users_fabrice__sage_sage_notebook_sagenb_home_admin_123_code_sage2_spyx_0.c:16:
/Applications/Sage-6.3.app/Contents/Resources/sage/local/bin/../lib/gcc/x86_64-apple-darwin13.3.0/4.7.3/include-fixed/limits.h:169:61: fatal error: limits.h: No such file or directory
compilation terminated.
edit retag flag offensive close merge delete

Comments

Does it work in the command line? (I mean does Cython at all work?) Since you have 6.3, https://github.com/sagemath/sagenb/issues/260 should not be relevant to you. It's also possible that there is some incompleteness from the compiled binary to your specific platform.

kcrisman gravatar imagekcrisman ( 2014-11-17 09:27:33 -0500 )edit

In the command line, i can load a .sage file but not a .spyx file, for the very same reason as above (same gcc failed error message)

Fabrice gravatar imageFabrice ( 2014-11-20 05:58:50 -0500 )edit

3 answers

Sort by » oldest newest most voted
0

answered 2014-11-20 07:28:06 -0500

kcrisman gravatar image

Okay, so there is something wrong with your Sage, not the notebook per se. You could download a more recent Sage, compile from scratch, or even try to recompile the Sage in your app (it turns out you can swap out different Sage versions in the app, in fact there is even a preferences item for this). I'm not sure of the exact cause, however, if that file really does exist.

edit flag offensive delete link more

Comments

thanks for the answer kcrisman;

i just downloaded the 6.4 version (not the .app this time, in order to eliminate a doubt); exactly the same problem, both with the notebook and the command line;

recompiling sage? i fear i'll have some problems with xcode anyway... but i'll try;

now, with which compiler? any gcc would do the job?

ps: useless to say i'd prefer it would work directly from the downloaded binaries! :))

Fabrice gravatar imageFabrice ( 2014-11-20 08:25:45 -0500 )edit
1

answered 2014-11-21 11:11:36 -0500

Fabrice gravatar image

How the problem was fixed (magic algorithm):

  • i installed the command line tools of xcode (seemingly not included under osx 10.9)
  • started to compile sage-6.4 from source
  • stopped the compilation after around 1h and deleted the whole sage-6.4 folder

    After that, sage-6.3.app recovered its usual %cython behavior in the notebook.

    Could be that only the first step was useful, but no way checking it now.

  • edit flag offensive delete link more
    0

    answered 2014-11-20 09:35:04 -0500

    Under Mac OS X 10.8, you should use the binaries for OS X 10.7 rather than those for OS X 10.9.

    If you want to build from source, I would recommend to:

    • apply system updates to run the latest version of OS X 10.8,
    • update XCode to the latest version compatible with OS X 10.8,
    • install command-line tools,
    • start XCode once and quit it.

    Then you can build from source and all should go well. If there are any problems, report them here or on sage-release.

    edit flag offensive delete link more

    Comments

    thanks, and right: so sorry, i run 10.9 not 8 (updated the question); with the 6.1 version of xcode;

    half good news:

    • i started to build sage 6.4 from source but had to interrupt the compilation - so i trashed the 6.4 folder before leaving here; just in case, i tried sage-6.3.app... now it works fine, %cython in notebook has its usual behavior (isn't that magic?)

    • now i have to find some log of the interrupted make (if any) in order to see what could have changed, i guess this might be a compiler problem

    to be followed

    Fabrice gravatar imageFabrice ( 2014-11-20 10:57:17 -0500 )edit

    the original log is lost; all i can say is what happened between the dates "6.3.app doesn't run cython" and "6.3.app does run cython":

  • i installed the command line tools of xcode (seemingly not included under osx 10.9)
  • started to compile sage-6.4 from source
  • stopped the compilation after around 1h and deleted the whole sage-6.4 folder

    this doesn't help me to figure out what the bug is, only greatly restricts the possibilities; thanks for your help!

  • Fabrice gravatar imageFabrice ( 2014-11-21 11:03:34 -0500 )edit

    I'm pretty sure it was installing Xcode that solved it, because probably now somewhere in your path there were appropriate headers etc. Cython won't work on a binary, probably, without a compiler, I seem to remember a ticket about making that more obvious - even if gcc is installed in Sage I'm not sure it's easy to use it properly in a binary. Wish I could remember more offhand.

    kcrisman gravatar imagekcrisman ( 2014-11-22 20:38:46 -0500 )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

    1 follower

    Stats

    Asked: 2014-11-16 11:49:45 -0500

    Seen: 317 times

    Last updated: Nov 21 '14