Magma on a mac

165 views
Skip to first unread message

VictorMiller

unread,
May 28, 2010, 2:03:38 PM5/28/10
to sage-support
I have magma and sage 4.4.1 installed on my macbook pro. I've made
sure that the magma command is on my PATH. Yet when I run sage, and I
try and call to magma.eval, it says that it can't find magma. This
has worked without problem on my linux workstation at work. So what
needs to be done to have sage find my installation of magma? The page
http://www.sagemath.org/doc/reference/sage/interfaces/magma.html
doesn't say anything about this.

Victor

William Stein

unread,
May 28, 2010, 2:11:08 PM5/28/10
to sage-s...@googlegroups.com

Start sage and type

sage: !magma

What happens?

>
> --
> To post to this group, send email to sage-s...@googlegroups.com
> To unsubscribe from this group, send email to sage-support...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>

--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

VictorMiller

unread,
May 28, 2010, 6:33:29 PM5/28/10
to sage-support
More data: If I start sage and then type

!magma

it starts up Magma. I then exit from it (by typing "exit;") and start
the notebook.

However, if I try to run magma from the notebook, I get the message

"Type Error: unable to start magma"

What's going on?

Victor

On May 28, 2:11 pm, William Stein <wst...@gmail.com> wrote:
> On Fri, May 28, 2010 at 11:03 AM, VictorMiller <victorsmil...@gmail.com> wrote:
> > I have magma and sage 4.4.1 installed on my macbook pro.  I've made
> > sure that the magma command is on my PATH.  Yet when I run sage, and I
> > try and call to magma.eval, it says that it can't find magma.  This
> > has worked without problem on my linux workstation at work.  So what
> > needs to be done to have sage find my installation of magma?  The page
> >http://www.sagemath.org/doc/reference/sage/interfaces/magma.html
> > doesn't say anything about this.
>
> > Victor
>
> Start sage and type
>
>    sage: !magma
>
> What happens?
>
>
>
> > --
> > To post to this group, send email to sage-s...@googlegroups.com
> > To unsubscribe from this group, send email to sage-support...@googlegroups.com
> > For more options, visit this group athttp://groups.google.com/group/sage-support

William Stein

unread,
May 28, 2010, 6:55:27 PM5/28/10
to sage-s...@googlegroups.com
On Fri, May 28, 2010 at 3:33 PM, VictorMiller <victor...@gmail.com> wrote:
> More data:  If I start sage and then type
>
> !magma
>
> it starts up Magma.  I then exit from it (by typing "exit;") and start
> the notebook.
>
> However, if I try to run magma from the notebook, I get the message
>
> "Type Error: unable to start magma"
>
> What's going on?

What happens if you do this on the command line:

sage: magma.eval('2+2')

What happens if you type this in a notebook cell:

sage: os.system('magma')

William

> For more options, visit this group at http://groups.google.com/group/sage-support

VictorMiller

unread,
May 28, 2010, 7:15:48 PM5/28/10
to sage-support
I'm in the notebook and I typed

os.system('magma')

It's now over 5 minutes, and it still hasn't come back! While I was
waiting I went a terminal and typed magma and it started within less
than a second.
Something weird.

Victor

On May 28, 6:55 pm, William Stein <wst...@gmail.com> wrote:

Jason Grout

unread,
May 28, 2010, 7:25:09 PM5/28/10
to sage-s...@googlegroups.com
On 5/28/10 6:15 PM, VictorMiller wrote:
> I'm in the notebook and I typed
>
> os.system('magma')
>
> It's now over 5 minutes, and it still hasn't come back! While I was
> waiting I went a terminal and typed magma and it started within less
> than a second.
> Something weird.
>

Does it say anything in the notebook log (i.e., the screen you
originally launched the notebook from)?

Jason

William Stein

unread,
May 28, 2010, 7:27:03 PM5/28/10
to sage-s...@googlegroups.com
On Fri, May 28, 2010 at 4:15 PM, VictorMiller <victor...@gmail.com> wrote:
> I'm in the notebook and I typed
>
> os.system('magma')
>
> It's now over 5 minutes, and it still hasn't come back!  While I was
> waiting I went a terminal and typed magma and it started within less
> than a second.
> Something weird.

What about

os.system('magma < /dev/null')

William

> For more options, visit this group at http://groups.google.com/group/sage-support

VictorMiller

unread,
May 28, 2010, 8:07:02 PM5/28/10
to sage-support
After 1/2 hour (!) I decided to interrupt the worksheet, quite the
notebook, quite sage, and then restart sage. Now when I try

os.system('mamga') it comes back right away with

Can't open Magma password file
.magmapass

256

However, I have no trouble starting magma from a terminal or from sage
in command line mode.

Victor

On May 28, 7:27 pm, William Stein <wst...@gmail.com> wrote:

William Stein

unread,
May 28, 2010, 8:10:01 PM5/28/10
to sage-s...@googlegroups.com
On Fri, May 28, 2010 at 5:07 PM, VictorMiller <victor...@gmail.com> wrote:
> After 1/2 hour (!) I decided to interrupt the worksheet, quite the
> notebook, quite sage, and then restart sage.  Now when I try
>
> os.system('mamga') it comes back right away with
>
> Can't open Magma password file
> .magmapass
>
> 256

OK, then I'm stumped. I don't understand the mysteries of Magma's
proprietary copy protection.

William

> For more options, visit this group at http://groups.google.com/group/sage-support

Jason Grout

unread,
May 28, 2010, 8:46:23 PM5/28/10
to sage-s...@googlegroups.com
On 5/28/10 7:10 PM, William Stein wrote:
> On Fri, May 28, 2010 at 5:07 PM, VictorMiller<victor...@gmail.com> wrote:
>> After 1/2 hour (!) I decided to interrupt the worksheet, quite the
>> notebook, quite sage, and then restart sage. Now when I try
>>
>> os.system('mamga') it comes back right away with
>>
>> Can't open Magma password file
>> .magmapass
>>
>> 256
>

I wonder if it just can't find the magma password file. After skimming

http://magma.maths.usyd.edu.au/magma/prot/prot.html

it looks like you can (must?) set the MAGMAPASSFILE environment
variable. Can you try:

os.system('export MAGMAPASSFILE=<wherever this is> && magma')

or

import os
os.environ['MAGMAPASSFILE']

Jason

William Stein

unread,
May 28, 2010, 9:09:25 PM5/28/10
to sage-s...@googlegroups.com

No, do

os.system('export MAGMAPASSFILE=<wherever this is> && magma < /dev/null')

so you don't just hang things.

>
> or
>
> import os
> os.environ['MAGMAPASSFILE']
>
> Jason
>

VictorMiller

unread,
May 28, 2010, 9:24:20 PM5/28/10
to sage-support
Ah, that's it. I had put the .magmapass file in my home directory,
but never set up MAGMAPASSFILE as an environment variable. For some
reason when I started magma from the command line, or with !magma this
didn't bother it, but from the notebook it did. I added something to
set MAGMAPASSFILE in the magma script and now everything works ok.

Victor

On May 28, 9:09 pm, William Stein <wst...@gmail.com> wrote:
> On Fri, May 28, 2010 at 5:46 PM, Jason Grout
>
>
>
>
>
> <jason-s...@creativetrax.com> wrote:
> > On 5/28/10 7:10 PM, William Stein wrote:
>
> >> On Fri, May 28, 2010 at 5:07 PM, VictorMiller<victorsmil...@gmail.com>

VictorMiller

unread,
May 28, 2010, 9:35:27 PM5/28/10
to sage-support
Aha! I did some further investigation and found that I had the
following line in my ~/.bash_profile file

MAGMAPASSFILE=.magmapass

However, it should have been

MAGMAPASSFILE=~/.magmapass

so that's why it couldn't find it because it was running in a
directory not my home directory.

Victor
Reply all
Reply to author
Forward
0 new messages