#11614: Make Cython libcpp usable
------------------------------+---------------------------------------------
Reporter: vbraun | Owner: jason
Type: defect | Status: needs_review
Priority: major | Milestone: sage-4.8
Component: misc | Keywords:
Work_issues: | Upstream: N/A
Reviewer: Jeroen Demeyer | Author: Volker Braun
Merged: | Dependencies:
------------------------------+---------------------------------------------
Comment(by john_perry):
> Did you forget to rebuild the Sage library (sage -b)?
C'mon, I'm not ''that'' dumb! `X-D` But just to be sure, I tried building
& testing again, and I encountered the same errors.
I do think the following output from building is pertinent (slightly
edited for readability):
{{{
setup.py:693: UserWarning: could not find dependency <string> included in
/Applications/sage-4.8.alpha4/local/lib/python/site-
packages/Cython/Includes/libcpp/string.pxd.
I will assume it is a system C/C++ header.
warnings.warn(msg+' I will assume it is a system C/C++ header.')
setup.py:693: UserWarning: could not find dependency <vector> included in
/Applications/sage-4.8.alpha4/local/lib/python/site-
packages/Cython/Includes/libcpp/vector.pxd.
I will assume it is a system C/C++ header.
warnings.warn(msg+' I will assume it is a system C/C++ header.')
}}}
The file referenced is definitely there, and includes a declaration of C
headers. If I inspect the file, I see a declaration of a `cppclass` from
`<string>` that should cover it. Yet, when I run the doctests, I get
boatloads of errors of this sort:
{{{
Detected SAGE64 flag
Building Sage on OS X in 64-bit mode
sage -t "sage/tests/stl_vector.pyx"
Traceback (most recent call last):
File "/Users/user/.sage//tmp/stl_vector.py", line 18, in <module>
cython(open('sage/tests/stl_vector.pyx').read())
File "cython_c.pyx", line 32, in sage.misc.cython_c.cython
(sage/misc/cython_c.c:645)
File "/Applications/Sage-4.6.2-OSX-
64bit-10.6.app/Contents/Resources/sage/local
/lib/python/site-packages/sage/server/support.py", line 469, in
cython_import_all
create_local_c_file=create_local_c_file)
File "/Applications/Sage-4.6.2-OSX-
64bit-10.6.app/Contents/Resources/sage/local
/lib/python/site-packages/sage/server/support.py", line 446, in
cython_import
create_local_c_file=create_local_c_file)
File "/Applications/Sage-4.6.2-OSX-
64bit-10.6.app/Contents/Resources/sage/local
/lib/python/site-packages/sage/misc/cython.py", line 367, in cython
raise RuntimeError, "Error converting %s to C:\n%s\n%s"%(filename,
log, err)
RuntimeError: Error converting
/Users/user/.sage//temp/Users_MacBook_Pro.local/
9281//tmp_0.spyx to C:
Error converting Pyrex file to C:
------------------------------------------------------------
...
from sage.structure.sage_object cimport SageObject
from sage.rings.integer cimport Integer
from sage.libs.gmp.mpz cimport mpz_add_ui
from libcpp.vector cimport vector
from libcpp.string cimport string
^
------------------------------------------------------------
/Users/user/.sage/temp/Users_MacBook_Pro.local/9281/spyx
/_Users_user__sage_temp_Users_MacBook_Pro_local_9281_tmp_0_spyx
/_Users_user__sage_temp_Users_MacBook_Pro_local_9281_tmp_0_spyx_0.pyx:37:0:
'libcpp.string.pxd' not found
Error converting Pyrex file to C:
------------------------------------------------------------
...
from sage.structure.sage_object cimport SageObject
from sage.rings.integer cimport Integer
from sage.libs.gmp.mpz cimport mpz_add_ui
from libcpp.vector cimport vector
from libcpp.string cimport string
^
------------------------------------------------------------
/Users/user/.sage/temp/Users_MacBook_Pro.local/9281/spyx
/_Users_user__sage_temp_Users_MacBook_Pro_local_9281_tmp_0_spyx
/_Users_user__sage_temp_Users_MacBook_Pro_local_9281_tmp_0_spyx_0.pyx:37:0:
'string.pxd' not found
Error converting Pyrex file to C:
------------------------------------------------------------
...
from sage.structure.sage_object cimport SageObject
from sage.rings.integer cimport Integer
from sage.libs.gmp.mpz cimport mpz_add_ui
from libcpp.vector cimport vector
from libcpp.string cimport string
^
------------------------------------------------------------
/Users/user/.sage/temp/Users_MacBook_Pro.local/9281/spyx
/_Users_user__sage_temp_Users_MacBook_Pro_local_9281_tmp_0_spyx
/_Users_user__sage_temp_Users_MacBook_Pro_local_9281_tmp_0_spyx_0.pyx:37:27:
Name
'string' not declared in module 'libcpp.string'
Error converting Pyrex file to C:
------------------------------------------------------------
...
sage: from sage.tests.stl_vector import stl_int_vector
sage: v = stl_int_vector()
"""
cdef vector[int] *data
cdef string *name
^
------------------------------------------------------------
/Users/user/.sage/temp/Users_MacBook_Pro.local/9281/spyx
/_Users_user__sage_temp_Users_MacBook_Pro_local_9281_tmp_0_spyx
/_Users_user__sage_temp_Users_MacBook_Pro_local_9281_tmp_0_spyx_0.pyx:50:9:
'string'
is not a type identifier
Error converting Pyrex file to C:
------------------------------------------------------------
...
Test suite for A vector of integers
vector<int>:
data[0] = 123
data[1] = 456
"""
self.data = new vector[int]()
^
------------------------------------------------------------
/Users/user/.sage/temp/Users_MacBook_Pro.local/9281/spyx
/_Users_user__sage_temp_Users_MacBook_Pro_local_9281_tmp_0_spyx
/_Users_user__sage_temp_Users_MacBook_Pro_local_9281_tmp_0_spyx_0.pyx:66:24:
Operation
only allowed in c++
}}}
and more just like it.
I suppose it's possible that this installation of sage is simply pooched,
though that would seem very, very weird; other patches go in without a
problem. It's a MacBook Pro running 10.6.8. On my Ubuntu box running sage
4.8.rc0, the installation passes.
I will run the full battery of doctests on the Ubuntu box, and also try a
fresh install of 4.8.rc0 on the MacBook Pro. If it all works out, I'll
give it a positive review.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11614#comment:10>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.