mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2009-03-20, 00:31   #1
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

2×29×103 Posts
Default 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.
CRGreathouse is offline   Reply With Quote
Old 2009-03-20, 01:09   #2
mdettweiler
A Sunny Moo
 
mdettweiler's Avatar
 
Aug 2007
USA (GMT-5)

186916 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
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.
mdettweiler is offline   Reply With Quote
Old 2009-03-20, 01:36   #3
akruppa
 
akruppa's Avatar
 
"Nancy"
Aug 2002
Alexandria

9A316 Posts
Default

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
akruppa is offline   Reply With Quote
Old 2009-03-20, 02:33   #4
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

2·29·103 Posts
Default

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
CRGreathouse is offline   Reply With Quote
Old 2009-03-20, 04:00   #5
mdettweiler
A Sunny Moo
 
mdettweiler's Avatar
 
Aug 2007
USA (GMT-5)

3·2,083 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
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!
mdettweiler is offline   Reply With Quote
Old 2009-03-20, 04:40   #6
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

2×29×103 Posts
Default

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 View Post
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
CRGreathouse is offline   Reply With Quote
Old 2009-03-20, 06:49   #7
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

2·29·103 Posts
Default

Quote:
Originally Posted by akruppa View Post
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:
lib64readline5
libedit2
libjline-java
libreadline5
readline-common

(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
#  include <readline.h>
#else
#  include <readline/readline.h>
#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?
CRGreathouse is offline   Reply With Quote
Old 2009-03-20, 09:35   #8
akruppa
 
akruppa's Avatar
 
"Nancy"
Aug 2002
Alexandria

2,467 Posts
Default

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
akruppa is offline   Reply With Quote
Old 2009-03-20, 10:22   #9
KriZp
 
KriZp's Avatar
 
Feb 2007

100001112 Posts
Default

Quote:
Originally Posted by mdettweiler View Post
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.
KriZp is offline   Reply With Quote
Old 2009-03-20, 16:31   #10
mdettweiler
A Sunny Moo
 
mdettweiler's Avatar
 
Aug 2007
USA (GMT-5)

3×2,083 Posts
Default

Quote:
Originally Posted by KriZp View Post
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.
mdettweiler is offline   Reply With Quote
Old 2009-03-20, 22:11   #11
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

175616 Posts
Default

Quote:
Originally Posted by akruppa View Post
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
http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html
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
CRGreathouse is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is best in life? Is it PARI/GP? JM Montolio A Lounge 11 2018-03-08 06:26
LLL in GP/Pari paul0 Programming 2 2015-11-17 13:04
PARI vs GAP skan Miscellaneous Math 0 2012-12-16 00:13
pari devarajkandadai Programming 21 2012-08-31 18:08
64-bit Pari? 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

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.