Trouble with .gaprc file when compiling from source

7 views
Skip to first unread message

Matthias Meulien

unread,
Oct 11, 2008, 9:54:08 AM10/11/08
to sage-devel
Hi,

I successfully compiled Sage 3.1.2 from source. But I had troubles
with many commands... I finaly realized that all functions using a GAP
subprocess where buggy, which was related to a corrupted prompt; see:

sage: gap._eval_line('1+3;')
'4\n\x1b[1m\x1b[34mgap> \x1b[0m'

Removing $HOME/.gaprc (in my case it turn color prompt on, using the
command "ColorPrompt(true);") doesn't help... To fix the problem I had
to remove $HOME/.gaprc AND compile the GAP component again. Now it
works well, even with $HOME/.gaprc back.

May be one should change the compilation process so that it ignore
$HOME/.gaprc during build time?



mabshoff

unread,
Oct 11, 2008, 9:58:51 AM10/11/08
to sage-devel


On Oct 11, 6:54 am, Matthias Meulien <oron...@gmail.com> wrote:
> Hi,

Hi Matthias,
Hmm, it sounds like we should ignore the global .gaprc and use one in
$SAGE_DOT instead. I am no GAP expert, so if anyone knows how to
accomplish this please let us know so we can open a ticket to fix
this.

Cheers,

Michael

David Joyner

unread,
Oct 11, 2008, 10:23:27 AM10/11/08
to sage-...@googlegroups.com, Steve Linton


According to the reference manual
http://www.gap-system.org/Manuals/doc/htm/ref/CHAP003.htm#SECT004
GAP will look for .gaprc in the home directory. I don't know how to change this
(or if it can be changed) but Steve Linton does.

I also don't quite understand the original poster's issue. Did he try to
create a color prompt using a modified .gaprc? If so, I think that can
be tricky.


>
> Cheers,
>
> Michael
> >
>

William Stein

unread,
Oct 11, 2008, 10:26:19 AM10/11/08
to sage-...@googlegroups.com
On Sat, Oct 11, 2008 at 7:23 AM, David Joyner <wdjo...@gmail.com> wrote:
>
> On Sat, Oct 11, 2008 at 9:58 AM, mabshoff <mabs...@googlemail.com> wrote:
>>
>>
>>
>> On Oct 11, 6:54 am, Matthias Meulien <oron...@gmail.com> wrote:
>>> Hi,
>>
>> Hi Matthias,
>>
>>> I successfully compiled Sage 3.1.2 from source. But I had troubles
>>> with many commands... I finaly realized that all functions using a GAP
>>> subprocess where buggy, which was related to a corrupted prompt; see:
>>>
>>> sage: gap._eval_line('1+3;')
>>> '4\n\x1b[1m\x1b[34mgap> \x1b[0m'
>>>
>>> Removing $HOME/.gaprc (in my case it turn color prompt on, using the
>>> command "ColorPrompt(true);") doesn't help... To fix the problem I had
>>> to remove $HOME/.gaprc AND compile the GAP component again. Now it
>>> works well, even with $HOME/.gaprc back.
>>>
>>> May be one should change the compilation process so that it ignore
>>> $HOME/.gaprc during build time?
>>
>> Hmm, it sounds like we should ignore the global .gaprc and use one in
>> $SAGE_DOT instead. I am no GAP expert, so if anyone knows how to
>> accomplish this please let us know so we can open a ticket to fix
>> this.
>
>
> According to the reference manual
> http://www.gap-system.org/Manuals/doc/htm/ref/CHAP003.htm#SECT004
> GAP will look for .gaprc in the home directory. I don't know how to change this
> (or if it can be changed) but Steve Linton does.

David,

Can you ask on the Gap devel list and get back to us?
We could change gap if necessary.

William


>
>
>
>
>>
>> Cheers,
>>
>> Michael
>> >
>>
>
> >
>

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

Matthias Meulien

unread,
Oct 11, 2008, 11:10:13 AM10/11/08
to sage-...@googlegroups.com

> GAP will look for .gaprc in the home directory. I don't know how to
> change this (or if it can be changed) but Steve Linton does.

There's a command line option for this; From GAP man page:

-r disable/enable reading of the '.gaprc' file

> I also don't quite understand the original poster's issue. Did he try to
> create a color prompt using a modified .gaprc? If so, I think that can
> be tricky.

I have a modified .gaprc to have a color prompt when using standalone
GAP in a terminal, this GAP (4.4.10) I've installed from a binary Debian
package before I got Sage.

Thanks for reading
--
Matthias

William Stein

unread,
Oct 11, 2008, 11:17:47 AM10/11/08
to sage-...@googlegroups.com
On Sat, Oct 11, 2008 at 8:10 AM, Matthias Meulien <oro...@gmail.com> wrote:
>
>
>> GAP will look for .gaprc in the home directory. I don't know how to
>> change this (or if it can be changed) but Steve Linton does.
>
> There's a command line option for this; From GAP man page:
>
> -r disable/enable reading of the '.gaprc' file

Could you try changing line 169 of gap.py from

gap_cmd = "gap"

to

gap_cmd = "gap -r"

then restart sage typing at the command line

sage -br

and see if that works. If so, open a trac ticket and post
this one-line change as a patch.

William

>
>> I also don't quite understand the original poster's issue. Did he try to
>> create a color prompt using a modified .gaprc? If so, I think that can
>> be tricky.
>
> I have a modified .gaprc to have a color prompt when using standalone
> GAP in a terminal, this GAP (4.4.10) I've installed from a binary Debian
> package before I got Sage.
>
> Thanks for reading
> --
> Matthias
>
>
> >
>

--

Matthias Meulien

unread,
Oct 11, 2008, 12:31:05 PM10/11/08
to sage-...@googlegroups.com

> Could you try changing line (...)

I've added the -r option to gap_cmd, and run sage with -br options; The
problem is still there.

To get rid of the problem I have to remove the file .gaprc, then rebuild
the GAP spkg. Finaly I can get my .gaprc back, everything will work
fine:
- Sage won't be confused by garbage in GAP output ;
- a standalone GAP will have a colored prompt.
--
Matthias

William Stein

unread,
Oct 11, 2008, 12:37:16 PM10/11/08
to sage-...@googlegroups.com

Actually that one line patch above probably did fix things, but it
didn't reset the cached gap workspace. All the stuff you did
above just had the impact of reseting the cached gap workspace.
You could also do this by deleting $HOME/.sage/gap

William

Matthias Meulien

unread,
Oct 11, 2008, 12:48:41 PM10/11/08
to sage-...@googlegroups.com
> (...) but it didn't reset the cached gap workspace.

I see. I was not aware of this. After removing $HOME/.sage/gap it works!!
Thanks a lot!
--
Matthias

Reply all
Reply to author
Forward
0 new messages