mersenneforum.org Pari/GP in Linux
 Register FAQ Search Today's Posts Mark Forums Read

 2009-03-20, 00:31 #1 CRGreathouse     Aug 2006 2×29×103 Posts Pari/GP in Linux I've recently moved from Windows to Linux (XP and Xubuntu, respectively). I'm looking for replacements for all the things I had in Windows, most of which were fairly easy to find. One that I haven't found is a good shell (terminology?) for Pari. The Windows binary had color coding, QuickEdit (highlight + Enter to copy, right-click to paste), advanced line editing* (up arrow to duplicate past lines, left arrow to move into and edit text), and high-resolution graphics (ploth). How do I get these under Linux? I've managed to compile Pari here, so if I just need to recompile with different options that would be fine. If I need an program on top of Pari that would be fine as well. (I've had no luck with pari-emacs, but since I'm not familiar with emacs that's probably not the best way to go anyway.) * The Windows binary wouldn't allow Home and End to move to the start and end of a line -- I'd like this feature as well.
2009-03-20, 01:09   #2
mdettweiler
A Sunny Moo

Aug 2007
USA (GMT-5)

186916 Posts

Quote:
 Originally Posted by CRGreathouse I've recently moved from Windows to Linux (XP and Xubuntu, respectively). I'm looking for replacements for all the things I had in Windows, most of which were fairly easy to find. One that I haven't found is a good shell (terminology?) for Pari. The Windows binary had color coding, QuickEdit (highlight + Enter to copy, right-click to paste), advanced line editing* (up arrow to duplicate past lines, left arrow to move into and edit text), and high-resolution graphics (ploth). How do I get these under Linux? I've managed to compile Pari here, so if I just need to recompile with different options that would be fine. If I need an program on top of Pari that would be fine as well. (I've had no luck with pari-emacs, but since I'm not familiar with emacs that's probably not the best way to go anyway.) * The Windows binary wouldn't allow Home and End to move to the start and end of a line -- I'd like this feature as well.
I got my PARI/GP binary through the package manager (also running Ubuntu), and I get all of those features just fine.

Oh, wait--I just got an idea about that. What terminal program are you using? I'm using gnome-terminal, which is reasonably well full-featured, but if memory serves I think Xubuntu uses a more barebones terminal emulator by default. It may not support all of the features you described, which though inherent to PARI would definitely require the shell to at least have basic support for them.

I think Xubuntu comes with gnome-terminal, too, as an alternate terminal emulator, so you may want to try that and see if it fixes things.

 2009-03-20, 01:36 #3 akruppa     "Nancy" Aug 2002 Alexandria 9A316 Posts When you compile Pari/GP, make sure you have the "readline" library (and development package, i.e. the .h header files etc) installed. Pari's configure script should mention finding readline. Then you have pretty flexible command line editing. Alex
 2009-03-20, 02:33 #4 CRGreathouse     Aug 2006 2·29·103 Posts Got it. I didn't install it with readline, let me try that now. Edit: does Pari+readline do tab completion as well? Say, what text editors are good in Linux? I don't want to restart the vi/emacs wars -- I just want a customizable editor with syntax highlighting, nothing special. (Paren matching and find/replace regexes would be nice, too.) Last fiddled with by CRGreathouse on 2009-03-20 at 02:34
2009-03-20, 04:00   #5
mdettweiler
A Sunny Moo

Aug 2007
USA (GMT-5)

3·2,083 Posts

Quote:
 Originally Posted by CRGreathouse Say, what text editors are good in Linux? I don't want to restart the vi/emacs wars -- I just want a customizable editor with syntax highlighting, nothing special. (Paren matching and find/replace regexes would be nice, too.)
gedit is generally my favorite GUI-based text editor. It's got syntax highlighting, find/replace (not sure if it does regexes...but it does support wildcards, etc.), can display line numbers, has an editable tab width, and even has a sort function. It doesn't have auto-indent, but other than that it's a decent programmer's text editor.

Whenever I have a command-line-only environment I mostly use nano/pico. I've never gotten around to learning vi, or even becoming reasonably comfortable with emacs, so I can't truly compare them as far as power and breadth of features goes. However, it is (at least as far as I can tell) the easiest of the command-line-based Linux text editors to learn and use (especially if you're already familar with the DOS edit.com).

Hope this helps!

2009-03-20, 04:40   #6
CRGreathouse

Aug 2006

2×29×103 Posts

OK, I've downloaded gedit and edited one of the .lang files to suit my needs. If I stick to this I'm going to have to learn the syntax well enough to create a gp.lang file.

Quote:
 Originally Posted by mdettweiler Whenever I have a command-line-only environment I mostly use nano/pico. I've never gotten around to learning vi, or even becoming reasonably comfortable with emacs, so I can't truly compare them as far as power and breadth of features goes. However, it is (at least as far as I can tell) the easiest of the command-line-based Linux text editors to learn and use (especially if you're already familar with the DOS edit.com).
Yes, I cut my teeth on edit.com twenty years ago.

Last fiddled with by CRGreathouse on 2009-03-20 at 04:40

2009-03-20, 06:49   #7
CRGreathouse

Aug 2006

2·29·103 Posts

Quote:
 Originally Posted by akruppa When you compile Pari/GP, make sure you have the "readline" library (and development package, i.e. the .h header files etc) installed. Pari's configure script should mention finding readline. Then you have pretty flexible command line editing.
OK, this isn't nearly as trivial as I expected. I've installed (via Synaptic) the following packages:
libedit2
libjline-java

(of which only the last two should matter) in hopes of finding the readline that Pari wants. But it fails to find readline when given
Code:
./Configure --tune --with-gmp --with-qt --with-readline
Tracking this down, it compiles a sample file
Code:
#ifdef READLINE_LIBRARY
#else
#endif
main() { char *s = readline("?"); }
which fails because readline.h isn't in an appropriate path. But in fact, despite all the installs above, it's not anywhere:
Code:
locate readline.h
comes up empty. What do I need to do?

 2009-03-20, 09:35 #8 akruppa     "Nancy" Aug 2002 Alexandria 2,467 Posts Is there a "readline-devel" package you can install? It should have the headers. And yes, readline does tab-completions, on function names anyway. It also has searchable history, yank buffer, etc... it's a bit like emacs for command lines. For a text-mode editor, I like "joe," mostly because it uses more-or-less the same command sequences as the Turbo Pascal IDE did, which I used a lot before switching to Linux. Alex
2009-03-20, 10:22   #9
KriZp

Feb 2007

100001112 Posts

Quote:
 Originally Posted by mdettweiler gedit is generally my favorite GUI-based text editor. It doesn't have auto-indent, but other than that it's a decent programmer's text editor.
It does have auto-indent, if you enable it in the preferences Also the tab width can be specified, and you can have it output a number of spaces in stead of tabs.

2009-03-20, 16:31   #10
mdettweiler
A Sunny Moo

Aug 2007
USA (GMT-5)

3×2,083 Posts

Quote:
 Originally Posted by KriZp It does have auto-indent, if you enable it in the preferences Also the tab width can be specified, and you can have it output a number of spaces in stead of tabs.
Sweet! I'll have to try playing around with the auto-indent sometime...that could come in really handy.

2009-03-20, 22:11   #11
CRGreathouse

Aug 2006

175616 Posts

Quote:
 Originally Posted by akruppa Is there a "readline-devel" package you can install? It should have the headers.
No, there isn't. I tried libreadline5-dev, but that also didn't work.

I Googled for the source and found
which I was able to install (shockingly*) with the completely standard ./configure / make / make install. This did actually produce the desired readline.h; I'm installing now, so I'll know soon if it worked.

* Of the ~10 or so math programs I've recently made from source, this is the first that didn't take any special tricks like
./configure --with-stuff --tune --melt-computer=no

 Similar Threads Thread Thread Starter Forum Replies Last Post JM Montolio A Lounge 11 2018-03-08 06:26 paul0 Programming 2 2015-11-17 13:04 skan Miscellaneous Math 0 2012-12-16 00:13 devarajkandadai Programming 21 2012-08-31 18:08 CRGreathouse Software 2 2009-03-13 04:22

All times are UTC. The time now is 19:23.

Thu Mar 4 19:23:08 UTC 2021 up 91 days, 15:34, 0 users, load averages: 0.67, 1.20, 1.30