simple desolve_tides_mpfr crash, even for SageMath Cell Server

56 views
Skip to first unread message

Toan T Nguyen

unread,
Apr 16, 2020, 3:15:04 PM4/16/20
to sage-support
Hi all,

I'm trying to solve a system of 1st order ODE using desolve_tides_mpfr() arbitrary precision module. My script crashes at the external gcc call.
So I try this very simple example I found from a tutorial in a website. It also crashes at the same gcc call. I test it in the SageMath online cell server, it crashes as well, so it's not just my code or my setup.
Could somebody help with this example? Is this a bug, or the script is wrong?

Thank you

Toan

var('t,x,y,z')
s = 10
r = 28
b = 8/3
f(t,x,y,z)= [s*(y-x),x*(r-z)-y,x*y-b*z]
x0 = -13.7636106821342005250144010543616538641008648540923684535378642921202827747268115852940239346395038284
y0 = -19.5787519424517955388380414460095588661142400534276438649791334295426354746147526415973165506704676171
z0 = 27
T = 15.586522107161747275678702092126960705284805489972439358895215783190198756258880854355851082660142374
sol = desolve_tides_mpfr(f, [x0, y0, z0],0 , T, T, 1e-100, 1e-100, 100) # optional - tides
print(sol)

Vincent Delecroix

unread,
Apr 16, 2020, 3:17:47 PM4/16/20
to sage-s...@googlegroups.com
Hi,

What do you mean by crash? Could you copy paste the *full* traceback
that you obtain?

Toan T Nguyen

unread,
Apr 16, 2020, 3:54:37 PM4/16/20
to sage-support
Thank you. It's an easy problem to reproduce. You can cut-paste that code into the official online Sage Cell Server


and see for yourself what I meant.

Best regards

Toan

slelievre

unread,
Apr 16, 2020, 4:26:21 PM4/16/20
to sage-support
Here is the error after executing the original poster's code in SageCell.

---------------------------------------------------------------------------
CalledProcessError                        Traceback (most recent call last)
<ipython-input-1-6fda4f94ff14> in <module>()
      8 z0 = Integer(27)
      9 T = RealNumber('15.586522107161747275678702092126960705284805489972439358895215783190198756258880854355851082660142374')
---> 10 sol = desolve_tides_mpfr(f, [x0, y0, z0],Integer(0) , T, T, RealNumber('1e-100'), RealNumber('1e-100'), Integer(100)) # optional - tides
     11 print(sol)

/home/sc_serv/sage/local/lib/python3.7/site-packages/sage/calculus/desolvers.py in desolve_tides_mpfr(f, ics, initial, final, delta, tolrel, tolabs, digits)
   1887                           + os.path.join('-L$SAGE_LOCAL','lib ') + '-lmpfr -lgmp -lm  -O2 -w ' +
   1888                           os.path.join('-I$SAGE_LOCAL','include ') ,
-> 1889                           shell=True,  stdout=subprocess.PIPE, stderr=subprocess.PIPE)
   1890     subprocess.check_call(os.path.join(tempdir, 'runme'), shell=True,  stdout=subprocess.PIPE, stderr=subprocess.PIPE)
   1891     outfile = open(fileoutput)

/home/sc_serv/sage/local/lib/python3.7/subprocess.py in check_call(*popenargs, **kwargs)
    345         if cmd is None:
    346             cmd = popenargs[0]
--> 347         raise CalledProcessError(retcode, cmd)
    348     return 0
    349 

CalledProcessError: Command 'gcc -o /home/sc_work/.sage/temp/sc-2B/23183/dir_rwnrlkk7/runme /home/sc_work/.sage/temp/sc-2B/23183/dir_rwnrlkk7/*.c $SAGE_LOCAL/lib/libTIDES.a $LDFLAGS -L$SAGE_LOCAL/lib -lmpfr -lgmp -lm  -O2 -w -I$SAGE_LOCAL/include ' returned non-zero exit status 1.
 

John H Palmieri

unread,
Apr 16, 2020, 5:05:42 PM4/16/20
to sage-support
Maybe SageCell doesn't have the optional package "tides" installed. This is the same error I see on my own computer without "tides".

slelievre

unread,
Apr 16, 2020, 5:39:20 PM4/16/20
to sage-support
Thu 2020-04-16 17:05:42 UTC, John H Palmieri:
>
> Maybe SageCell doesn't have the optional package "tides" installed.
> This is the same error I see on my own computer without "tides".

I was thinking that too. I asked Andrey if it can be installed on SageCell:

https://groups.google.com/d/topic/sage-cell/kR4R_HJDrms/discussion


@[Toan T Nguyen]

To run this command on your own Sage, you first need to install
the optional package 'tides', which, depending on the OS and on
how Sage was installed, might be achieved by running:

    sage -i tides

Running it on SageCell would require 'tides' to be installed there,
let's wait for Andrey's answer.

I tried installing on Ubuntu with Sage 9.1.rc0, it worked.

$ sage
Forcing sage-location, probably because a new package was installed.
Cleaning up, do not interrupt this.
Done cleaning.
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.1.rc0, Release Date: 2020-04-12                 │
│ Using Python 3.7.3. Type "help()" for help.                        │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable.     ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
sage: t, x, y, z = SR.var('t, x, y, z')
sage: s = 10
sage: r = 28
sage: b = 8/3
sage: f(t,x,y,z)= [s*(y-x),x*(r-z)-y,x*y-b*z]
sage: x0 = -13.7636106821342005250144010543616538641008648540923684535378642921202827747268115852940239346395038284
sage: y0 = -19.5787519424517955388380414460095588661142400534276438649791334295426354746147526415973165506704676171
sage: z0 = 27
sage: T = 15.586522107161747275678702092126960705284805489972439358895215783190198756258880854355851082660142374
sage: sol = desolve_tides_mpfr(f, [x0, y0, z0],0 , T, T, 1e-100, 1e-100, 100) # optional - tides
sage: print(sol)
[[0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, -13.7636106821342005250144010543616538641008648540923684535378642921202827747268115852940239346395038, -19.5787519424517955388380414460095588661142400534276438649791334295426354746147526415973165506704676, 27.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000], [15.5865221071617472756787020921269607052848054899724393588952157831901987562588808543558510826601424, -13.7636106821342005250144010543616538641008648540923684535378642921202827747268115852940239346470530, -19.5787519424517955388380414460095588661142400534276438649791334295426354746147526415973165506634524, 27.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000345574]]

Toan T Nguyen

unread,
Apr 16, 2020, 5:48:41 PM4/16/20
to sage-support
@slelievre

Thank you very much. I'm running in Windows using the binary installer (my Linux box uses CentOS which seems complicated to compile SageMath with all these dependencies that I need to compile manually as well).
The Sage shell in Windows state that I should not use sage -i ... to install. How do I do this in Windows?

Best regards
Toan
Message has been deleted

Andrey Novoseltsev

unread,
Apr 17, 2020, 7:35:24 PM4/17/20
to sage-support
tides is now available on SageMathCell as well!

Reply all
Reply to author
Forward
0 new messages