Re: [sage-support] Cython fatal error: what to do?

2023-10-17 Thread Rolandb
Hi, My problem is solved! *Reinstalling Anaconda was the trick.* Thanks for all the support. Roland Op maandag 16 oktober 2023 om 20:53:39 UTC+2 schreef Jan Groenewald: > Hi > > Try > > sudo apt-get install python3-dev cython3 > > Regards, > Jan > > On Mon, 16 Oct 2023 at 20:48, Rolandb wrot

Re: [sage-support] Cython fatal error: what to do?

2023-10-16 Thread Jan Groenewald
Hi Try sudo apt-get install python3-dev cython3 Regards, Jan On Mon, 16 Oct 2023 at 20:48, Rolandb wrote: > Hi, > > Using Sagemath 9.8, and Ubuntu 22.04, I got the following error message > when I tried to use %%cython in a Jupiter notebook cell: > > In file included from /usr/include/python3

[sage-support] Cython fatal error: what to do?

2023-10-16 Thread Rolandb
Hi, Using Sagemath 9.8, and Ubuntu 22.04, I got the following error message when I tried to use %%cython in a Jupiter notebook cell: In file included from /usr/include/python3.10/Python.h:8, from /home/roland/.cache/ipython/cython/_cython_magic_a687e319b78554b58b88d328883ed96d.c:19: /usr/incl

[sage-support] Cython compilation fail after separating code

2022-11-16 Thread Alex
This is essentially the same as my post on ask.sagemath.org , but after a while with no comments, I figured it would be okay to get more eyes on it here. I also asked on Zulip, but no dice there either. It

Re: [sage-support] Cython in jupyter notebook

2018-04-16 Thread Jeroen Demeyer
On 2018-04-15 16:08, Simon King wrote: Hi! The following cython code compiles fine in SageMath command line version and it *used* to compile fine in the jupyter notebook one year ago: Fix at https://trac.sagemath.org/ticket/25177 -- You received this message because you are subscribed to the

[sage-support] Cython in jupyter notebook

2018-04-15 Thread Simon King
Hi! The following cython code compiles fine in SageMath command line version and it *used* to compile fine in the jupyter notebook one year ago: cython(""" def mantisse(): cdef double a = 1 cdef double b = 2 cdef int i = 0 while True: a += b**(-i) print("%2

Re: [sage-support] Cython problem

2017-01-27 Thread Jan Groenewald
Hi Vincent On 27 January 2017 at 16:39, Vincent Delecroix <20100.delecr...@gmail.com> wrote: > Hi Jan, > > Could the dependencies be part of the ppa metadata? That would be simpler > for users to have fully automated process. > I thought it was, but seems not to be (anymore), since the deb packa

Re: [sage-support] Cython problem

2017-01-27 Thread Vincent Delecroix
Hi Jan, Could the dependencies be part of the ppa metadata? That would be simpler for users to have fully automated process. Best, Vincent Le 27/01/2017 à 15:27, Jan Groenewald a écrit : Hi On 27 January 2017 at 16:15, wrote: I do have limits.h but not in this particular folder. I search

Re: [sage-support] Cython problem

2017-01-27 Thread jordan . h . emme
It worked right after installing build-essential, thank you very much! -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com.

Re: [sage-support] Cython problem

2017-01-27 Thread Dima Pasechnik
On Friday, January 27, 2017 at 2:15:54 PM UTC, jordan...@gmail.com wrote: > > I do have limits.h but not in this particular folder. I searched for it > and that is what I got: > > jordan@jordan-laptop ~ $ find /usr/include -name limits.h > /usr/include/linux/limits.h > this is something totally

Re: [sage-support] Cython problem

2017-01-27 Thread Jan Groenewald
Hi On 27 January 2017 at 16:15, wrote: > I do have limits.h but not in this particular folder. I searched for it > and that is what I got: > > jordan@jordan-laptop ~ $ find /usr/include -name limits.h > /usr/include/linux/limits.h > > Try sudo apt-get install -y build-essential Did you install

Re: [sage-support] Cython problem

2017-01-27 Thread jordan . h . emme
I do have limits.h but not in this particular folder. I searched for it and that is what I got: jordan@jordan-laptop ~ $ find /usr/include -name limits.h /usr/include/linux/limits.h -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscri

Re: [sage-support] Cython problem

2017-01-25 Thread Jeroen Demeyer
On 2017-01-25 17:07, jordan.h.e...@gmail.com wrote: Hello, I've been trying to use cython in Jupyter and it fails to compile. My version of Sage is 7.3. It was installe from the ppa. I run Linux Mint. I guess that you are missing a compiler toolchain. In your case, the system header files lik

[sage-support] Cython problem

2017-01-25 Thread jordan . h . emme
Hello, I've been trying to use cython in Jupyter and it fails to compile. My version of Sage is 7.3. It was installe from the ppa. I run Linux Mint. Here is the error message: RuntimeError: Error compiling /home/jordan/.sage/temp/jordan-laptop/5677/tmp_fun1sz.spyx: running build running build_

[sage-support] [Cython] Howto import pure c function versions of sagemath functions into cython

2016-05-01 Thread Max Külshammer
Hi there, I would like to use a sage function (is_power_of) in an cython program I am writing (via %cython in SMC). To speed things up I would like to import the c version of is_power_of which can be found in https://github.com/sagemath/sage/blob/master/src/sage/rings/integer.pyx#L4271 as h

Re: [sage-support] Cython spyx import problem

2016-02-22 Thread Daniel Krenn
On 2016-02-17 17:25, Dima Pasechnik wrote: > it's not related to RIF, it seems. Compilation ends with > > ImportError: cannot import name ZZ > > and even the following does not work: > > import sage.all > from sage.all import * > from sage.rings.integer_ring import ZZ > print ZZ(1000) > > -

Re: [sage-support] Cython spyx import problem

2016-02-17 Thread Dima Pasechnik
it's not related to RIF, it seems. Compilation ends with ImportError: cannot import name ZZ and even the following does not work: import sage.all from sage.all import * from sage.rings.integer_ring import ZZ print ZZ(1000) -- Broken spyx support, in general (on the l

Re: [sage-support] Cython spyx import problem

2016-02-17 Thread Daniel Krenn
On 2016-02-17 10:16, Dima Pasechnik wrote: > > > On Wednesday, February 17, 2016 at 7:26:18 AM UTC, Daniel Krenn wrote: > > On 2016-02-17 08:05, Jeroen Demeyer wrote: > > On 2016-02-17 07:33, Daniel Krenn wrote: > >> Calling this in my working directory with > >>sage problem.

Re: [sage-support] Cython spyx import problem

2016-02-17 Thread Dima Pasechnik
On Wednesday, February 17, 2016 at 7:26:18 AM UTC, Daniel Krenn wrote: > > On 2016-02-17 08:05, Jeroen Demeyer wrote: > > On 2016-02-17 07:33, Daniel Krenn wrote: > >> Calling this in my working directory with > >>sage problem.spyx > >> fails with > >>Traceback (most recent call last

Re: [sage-support] Cython spyx import problem

2016-02-16 Thread Daniel Krenn
On 2016-02-17 08:05, Jeroen Demeyer wrote: > On 2016-02-17 07:33, Daniel Krenn wrote: >> Calling this in my working directory with >>sage problem.spyx >> fails with >>Traceback (most recent call last): >>... >>ImportError: cannot import name ZZ >> >> What can I do to make it work? >

Re: [sage-support] Cython spyx import problem

2016-02-16 Thread Jeroen Demeyer
On 2016-02-17 07:33, Daniel Krenn wrote: My problem boils down to: problem.spyx from sage.rings.real_interval_field import RealIntervalField # fails RealIntervalField(100)(4.2) # not needed in minimal non-working example Calling this in my working directory with s

[sage-support] Cython spyx import problem

2016-02-16 Thread Daniel Krenn
My problem boils down to: problem.spyx from sage.rings.real_interval_field import RealIntervalField # fails RealIntervalField(100)(4.2) # not needed in minimal non-working example Calling this in my working directory with sage problem.spyx fails with Traceback (mos

[sage-support] Cython and PARI avma

2015-12-09 Thread Vincent Delecroix
Hello, I tried to use PARI inside some Cython code in Sage. Apparently, it is not happy with the declaration of avma from paridecl (which is as declared as "extern pari_sp avma"). The following compiles (with %runfile the_file.pyx) {{{ from sage.libs.pari.paridecl cimport * def test

Re: [sage-support] cython cimport of Expression

2015-06-30 Thread Jeroen Demeyer
This is a bug indeed: http://trac.sagemath.org/ticket/18825 -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to

[sage-support] cython cimport of Expression

2015-06-29 Thread Jon Silverberg
Hi, I saw previous posts about cimporting sage modules, and I can get some of those examples to work. However, in cython from the sage notebook I'm trying: %cython from sage.symbolic.expression cimport Expression What I get is: ..._notebook_sagenb_home_admin_169_code_sage8_spyx_0.c:255:24: fa

Re: [sage-support] Cython Error: Cannot call a static method on an instance variable.

2015-06-18 Thread Jeroen Demeyer
No idea, it looks like this is simply not supported: https://github.com/cython/cython/blob/master/Cython/Compiler/ExprNodes.py#L4659 -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from i

[sage-support] Cython Error: Cannot call a static method on an instance variable.

2015-06-18 Thread slabbe
I would like to do this in Cython: sage: class Fruit(object): : @staticmethod : def yo(a): : return a : def using_yo(self, a): : return self.yo(a) sage: f = Fruit() sage: f.using_yo(1) 1 But it does not work (why?

[sage-support] Cython, what to import

2013-10-01 Thread Jori Mantysalo
I would like to precalculate something and use cython for that. For example: N=7 L = [ P for P in Posets(N) if min([len(P.lower_covers(a)) for a in P.maximal_elements()]) >= 4 ] save(L, '/some/where/L') (Then later I can load 'L' and do some calculations with those posets --- no need to (re)c

[sage-support] Cython & time in html listing

2013-05-29 Thread Rolandb
Hi, Cython has a particular method to state the time. The first line of the html listing shows: Generated by Cython 0.19 on Wed May 29 12:00:31 2013 Actually it is exactly 6 hrs later (in Europe). Any explanation? Virtualbox Sage 5.9 Roland -- You received this message because you are subscr

[sage-support] %cython failing in notebook because of accessing the wrong directory

2012-03-28 Thread Maarten Derickx
Dear All, I've setup my own sage server (running sage 4.8 on debian) with two accounts. One called "sagerunner" wich actually runs the notebook and one called sageslave wich runs the calculations. To be more precise notebook is started with the argument server_pool=["sageslave@localhost"]. But

[sage-support] cython & cvxopt

2011-10-14 Thread john_perry_usm
hi I can't seem to get away with this: from cvxopt.base import matrix as opt_matrix cdef opt_matrix i_rock I can't cimport it, either; there is no cvxopt.pxd. (a) I think I understand why; cvxopt is a Python extension. Is that right? (b) Is there any way to get cython to recognize this

[sage-support] Cython

2011-10-06 Thread Marcin Kostur
Hi, Possibility of nice integration of fast compiled code is an excellent feature of sage. Suppose that I have a workflow: 1) derive some formulas with symbolics, arriving at expression of type sage.symbolic.expression.Expression 2) evaluate the resulting expression many times: e.g. plotting, i

Re: [sage-support] Cython programming with finite field computations

2011-07-30 Thread Alastair Irving
On 28/07/2011 22:34, VictorMiller wrote: I want to do a lot of finite field computations, and want to use Cython to speed things up. It's not clear to me what the details are that I need to adhere to. I noticed from the comments in element_givaro.pyx that the givaro library is fastest from fiel

[sage-support] Cython programming with finite field computations

2011-07-28 Thread VictorMiller
I want to do a lot of finite field computations, and want to use Cython to speed things up. It's not clear to me what the details are that I need to adhere to. I noticed from the comments in element_givaro.pyx that the givaro library is fastest from fields of size < 2^16. However, some of the fi

[sage-support] Cython Problem

2011-05-29 Thread Rolf
I tried to run cython from my notebook by typing these few lines adapted from from (http://docs.cython.org/src/quickstart/build.html) %cython cdef extern from "math.h": double sin(double) cdef double f(double x) except *: return sin(x**2) def integgratex(double a, double b, int N):

[sage-support] cython and wiki.sagemath.org/SageServer: Permission denied

2011-02-28 Thread Pedro Cruz
I have followed instructions on http://wiki.sagemath.org/SageServer and it seems that everything is ok: creating new user, doing cell computations. For cython I'm getting IOError: [Errno 13] Permission denied in a cell, of notebook sage 4.6.1, with: - %cython def f(doub

[sage-support] Cython and MPComplex in the notebook

2011-02-13 Thread MartinX
Trying to get to grips with MPComplex in cython with no success. I get a compile error on trying cimport. This simple script in the notebook: %cython import sage.rings.complex_mpc cimport sage.rings.complex_mpc cdef test(): pass Results in: creating build creating build/temp.linux-x86_64-2.

[sage-support] Cython problem when updating.

2011-02-08 Thread Ethan Van Andel
I recently tried to update sage from version 4.6 or 4.5.something, I forget which. When sage was rebuilding, however, I encountered the compile failure described here: http://trac.sagemath.org/sage_trac/ticket/9828#comment:2 This looks like an issue that was fixed in the past, what do I need to d

Re: [sage-support] Cython slow with symbolics?

2010-10-04 Thread Robert Bradshaw
On Mon, Oct 4, 2010 at 10:21 PM, Rolandb wrote: > Hi, > > I wonder why this (simple) example is still slow? > > %cython > from sage.all import QQ > > def ctel2(int diep): >    R = QQ['A, B'] >    (A, B) = R._first_ngens(2) >    cdef long tel=0 >    cdef int i,k0,k1,k2,k3,k4,k5 >    para=[1,A,B,A**

[sage-support] Cython slow with symbolics?

2010-10-04 Thread Rolandb
Hi, I wonder why this (simple) example is still slow? %cython from sage.all import QQ def ctel2(int diep): R = QQ['A, B'] (A, B) = R._first_ngens(2) cdef long tel=0 cdef int i,k0,k1,k2,k3,k4,k5 para=[1,A,B,A**2,A*B,B**2] ABC=A*B*(A+B) for k0 in xrange(-diep,diep+1):

Re: [sage-support] Cython: importing a cdef class

2010-07-30 Thread Robert Bradshaw
On Fri, Jul 30, 2010 at 2:39 PM, Jeroen Demeyer wrote: > Hello sage-support, > > I have been breaking my head all evening around the file organisation > and "import" model with Cython.  If there is any tutorial explaining > this, I will gladly read it. > > Anyway, here is a concrete question: > >

[sage-support] Cython: importing a cdef class

2010-07-30 Thread Jeroen Demeyer
Hello sage-support, I have been breaking my head all evening around the file organisation and "import" model with Cython. If there is any tutorial explaining this, I will gladly read it. Anyway, here is a concrete question: In file A.pyx, I have cdef MyClass myobj cdef class MyClass: [...]

Re: [sage-support] Cython and static data

2010-06-07 Thread Robert Bradshaw
On Jun 7, 2010, at 8:04 AM, Rolandb wrote: Hi, Using cython, I want to make optimal use of static data. The reason is that lookup is (often) much faster than recalulating. I now use: cdef list nice_list_name=[3 , 3 , 3 , 3 , 3 , 3 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , et cetera] B

[sage-support] Cython and static data

2010-06-07 Thread Rolandb
Hi, Using cython, I want to make optimal use of static data. The reason is that lookup is (often) much faster than recalulating. I now use: cdef list nice_list_name=[3 , 3 , 3 , 3 , 3 , 3 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , et cetera] But this didn't increase the speed. Suggestions

[sage-support] cython cimport problems

2010-03-21 Thread luisfe
Hi, I am trying to work with cython. I have the following code: from sage.libs.ntl.ntl_ZZ cimport ntl_ZZ cdef ntl_ZZ dummy(ntl_ZZ a, int b): return a If I compile it with sage -bI get the following error: building 'sage.rings.polynomial.polynomial_absolute_number_field_dense' extensi

Re: [sage-support] Cython Installation Problem with suse 10.1

2010-02-01 Thread Robert Bradshaw
On Jan 31, 2010, at 2:23 PM, ulrich.t...@hsnr.de wrote: Hi, I got a problem with the insatllation of sage-4.3.1. I am using Suse 10.1 on a Dell Latitude Laptop. Excerpt from the install.log: building 'Cython.Compiler.Parsing' extension gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict

[sage-support] Cython Installation Problem with suse 10.1

2010-01-31 Thread ulrich.t...@hsnr.de
Hi, I got a problem with the insatllation of sage-4.3.1. I am using Suse 10.1 on a Dell Latitude Laptop. Excerpt from the install.log: building 'Cython.Compiler.Parsing' extension gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/root/software/Mathematik/sage-4.3.1/loc

[sage-support] Cython Installation Problem with suse 10.1

2010-01-31 Thread ulrich.t...@hsnr.de
Hi, I got a problem with the insatllation of sage-4.3.1. I am using Suse 10.1 on a Dell Latitude Laptop. Excerpt from the install.log: building 'Cython.Compiler.Parsing' extension gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/root/software/Mathematik/sage-4.3.1/loc

[sage-support] Cython and SciPy special functions

2009-10-04 Thread mark mcclure
I'm investigating the complex dynamics of Airy functions with Python and I wonder if I can speed up the process significantly with Cython. I've successfully sped up the code by about 50% but I might expect much greater speed improvement. I'm guessing the problem is that Cython can't deal with Sc

[sage-support] Cython Modules

2009-07-15 Thread Ethan Van Andel
I want to include some of my cython code as a sage module. I followed the directions for adding the .pyx file to the sage library at http://www.sagemath.org/doc/developer/coding_in_other.html. However, when I run "sage -b" I get this: -- sag

[sage-support] Cython typedef not working

2009-07-14 Thread Ethan Van Andel
When I run this code: %cython %time import numpy as np cimport numpy as np COMPLEX = np.complex128 ctypedef np.complex128_t COMPLEX_t it gives me this error: "...code_sage30_spyx_0.pyx:10:9: 'complex128_t' is not a type identifier" As far as I can tell my code should work. At one point I thin

[sage-support] Cython help

2009-04-24 Thread drupel
Hi all, I am new to Sage and I don't quite understand how to convert my code to cython code to speed up my program. I am doing a lot of symbolic manipulations and using the PolynomialRing object. Below I have some of my code so that you can see the types of manipulations I hope to speed up: R

[sage-support] Cython and Matrices over Finite Fields

2009-04-01 Thread Tom
I want to write a Cython version of a Python function f(m) where the input is a sage matrix of the form m= matrix(GF(p), n, k) How can I pass m to the .spyx function? I couldn't find any examples online. My only idea is to convert m to a matrix over Z, and then to a list, but I'm assuming the

[sage-support] Cython editor

2008-10-08 Thread cesarnda
what do you usually use as a cython editor? I have a problem, if I have a very long function, and later I want this function in a class, I will have to indent every line, is there a way to avoid doing this? --~--~-~--~~~---~--~~ To post to this group, send email to

[sage-support] Cython Programming Guide

2008-07-22 Thread cesarnda
I have already written a script that works perfect in Sage (relaxation.py) but when I rename it (relaxation.spyx) to make it faster it doesn't work because I got a message: sage: attach relajacion.spyx Compiling /home/cesarnda/Documents/SageProg/ servicioSocialCienciaTusManos/relajacion.spyx... Er

[sage-support] Cython code in @interact

2008-05-02 Thread Marshall Hampton
Hi, I am trying to showcase both @interact and Cython in an article I am writing, and I can't get them to play well together. I've used a %cython cell to define some functions, and then tried to use @interact to change their arguments; nothing is displayed in the interact cell, although I also d

[sage-support] cython and filenames

2008-03-04 Thread Kate
Here is a snippet of code from cython.py in the main tree (SAGE_ROOT/devel/sage/sage/misc/cython.py) def cython(filename, verbose=False, compile_message=False, use_cache=False, create_local_c_file=False, annotate=True, sage_namespace=True): if not filename.endswith('pyx'):

[sage-support] cython problems

2007-10-18 Thread Marshall Hampton
Hi, In order to do some numerical ODE work quickly, I was defining all my functions with cython. The recent 2.8.7 upgrade seems to have broken several of these functions. As one example, the following definition attempt: %cython cdef Circ(t): return (cos((t/365.0)*2*RDF(pi)) + 1)/2 gives