jacques G on Mon, 17 Oct 2011 05:40:06 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Report on the Experimental PARI/GP 2.6 Windows installer binary


0. A REQUEST
In a pari-dev message dated from 2 Oct 2001, "Experimental PARI/GP Windows installer binary", Bill Allombert announced a Windows port of GP/PARI 2.6 <http://pari.math.u-bordeaux.fr/~bill/mingw/PARI-2-6.exe> (Thanks!!) and added "All this is mostly tested under wine, so please report success, failure and problems with real Windows systems." Since this reply is user oriented and does not contain definitive solutions to known problems, it is sent to pari-users, and Unix users should just ignore it.

1. AN INSTALLATION
Let me first of all report immediate, effortless success in installing PARI/GP on a small portable computer running Windows Vista, in the directory "C:\Pub\PARI-2-6" which will be denoted by VISTAGP hereafter. This being done as a normal user, a confirmation screen appeared as it should to request elevated privileges, and the existing link to GP 2.4.1 on my desktop was modified to point to the new version, which loaded promptly.
After double clicking on VISTAGP\Unistall, another confirmation window popped up and the newly installed files, desktop link and registry keys were deleted, leaving just two modified files (gprc.txt and gp_history.txt) in the VISTAGP directory. 
Installation, removal or updating of this PARI/GP Windows binary is thus trivial. You can do it too.

2. A SECURE REINSTALLATION
Another double click on PARI-2-6.exe (37872 Kb), choosing no links as an option, worked as before, leaving gp_history.txt and the desktop intact, while replacing VISTAGP\gprc.txt by the distributed version. Using the Windows editor Wordpad, this renamed configuration file was modified as follows (from my C:\Pub\PARI-2-4\.GPRC file):__________________________________prompt="GP# "realprecision=50format="g1.5"path="C:/Pub/PARI-2-6;C:/Pub/PARI-2-6/examples;C:/Pub/PARI-2-6/doc"datadir="C:/Pub/PARI-2-6"help="C:/pub/PARI-2-6/perl gphelp"\\ # default(secure,0) to enable system()secure=1
\\lines  = 40\\colors = "brightfg"\\prompt = "(%H:%M) gp > "\\histfile = "gp_history.txt"breakloop = 0__________________________________
Note that the secure line had to come after the help line to allow the modification of the default help. So far all looked perfect, and double clicking on VISTAGP\gp.exe produced:__________________________________Reading GPRC: gprc.txt ...Done.
          GP/PARI CALCULATOR Version 2.6.0 (development git-5a4ca5d)           i686 running mingw (ix86/GMP-5.0.1 kernel) 32-bit version     compiled: Oct  2 2011, gcc version 4.6.1 20110604 (prerelease) (GCC)                (readline v6.2 enabled, extended help enabled)..........................................GP# ?systemsystem(str): str being a string, execute the system command str.
GP# ??systemCan't open perl script "gphelp": No such file or directory__________________________________


3. EXTENDED HELP INSTALLATION
While VISTAGP\doc already contains four very complete documentation files in PDF format (Thanks!), the useful "extended help" is not working in this binary distribution. The following four steps were needed, after downloading and extracting the source from     <http://pari.math.u-bordeaux.fr/pub/pari/snapshots/pari-2.6-362-g84d4114.tar.gz> (2.6Mb):A) copy all the files from the source pari-2.6-362-g84d4114\doc to VISTAGP\docB) add to VISTAGP\doc the following executable from an earlier Windows distribution of PARI/GP:      acro.exe (Aug 12  2006)C) add to VISTAGP the following executables and dynamic libraries from an earlier distribution:      cygcrypt-0.dll    cygintl-8.dll     cygreadline6.dll      cygfltknox-0.dll  cygncurses-8.dll  cygwin1.dll      cygiconv-2.dll    cygperl5_8.dll    libpari-gmp-2.4.dll      perl.exe (5.8.7 Dec 30  2005)       sh.exe (3.2.9 Dec 20  2006)D) copy the VISTADIR\doc\gphelp.in to VISTADIR\gphelp and modify 4 lines with Wordpad as indicated:============================================================= start of diff log# diff -w doc/gphelp.in gphelp1c1< #!@perl@---> #!C:/pub/PARI/perl45,46c45,46< $version= "@version@";< $datadir= "@datadir@";---> $version= "2.6.0";> $datadir= "C:/Pub/PARI";56c56< $docdir = &get_docdir();---> $docdir =  "$datadir/doc";170c170<   if (-r $docfile) { $pipe = ""; }--->   if (-r $docfile||$^O =~ /(cyg|ms)win/) { $pipe = ""; }============================================================= end of diff log
Now the extended help works more as designed.__________________________________GP# ??systemsystem(str):   str is a string representing a system command. This command is executed, itsoutput written to the standard output  (this won't get into your logfile),  andcontrol returns to the PARI system. This simply calls the C system command.__________________________________


4. DEBUGGING THE EXTENDED HELP INSTALLATION
___________________________________GP# ??tutorialdisplaying '"tutorial.pdf"'.GP#  ..... and nothing more happens .....___________________________________
VISTAGP\doc\acro.exe finds the Acrobat reader path from its registry key and prints the command needed to open the PDF file, according to its C source acro.c distributed in the Odos directory of pari-2.4.3; however as in earlier versions, the Perl command executed by the gphelp script for "??tutorial", 
    system( "C:/Program Files/Adobe/Reader 9.0/Reader/AcroRd32.exe" "tutorial.pdf" )
then fails silently, perhaps due to the spaces in the path names or a disabled system() command in the cygwin DLL, although as seen below it is correct in a bash or a cmd.exe shell.
___________________________________GP# ???thetaellheight$(E,x,\{\fl=2\})$ellsigma$(E,z,\{\fl=0\})$nfinit$(\var{pol},\{\fl=0\})$rnfequation$(\var{nf},\var{pol},\{\fl=0\})$theta$(q,z)$thetanullk$(q,k)$___________________________________
The ??? apropos output differs from earlier versions of gphelp which only display the names of the related commands in aligned columns.
To investigate, just double click on sh.exe to get a bash shell window, complete with full help and all internal commands that can be supplemented by Windows shell commands:
      sh-3.2$ alias diff="cmd /C fc"      sh-3.2$ ./gphelp -k zeta      sh-3.2$ "C:/Program Files/Adobe/Reader 9.0/Reader/AcroRd32.exe" "doc/tutorial.pdf"
In fact a cmd.exe window works for debugging purposes, with the same default syntactic coloring of the output of gphelp. Surprisingly, the Acrobat command exactly as typed above also works, forward slashes and spaces and all -- so why does'nt the system() call work in the gphelp script on Windows as in many other systems ?
In addition, another Perl script, tex2mail, is needed for TeX output, and has to be treated in the same way as the gphelp script for Windows. However this one needs an outdated Perl module to start, <http://cpansearch.perl.org/src/ZEFRAM/perl-5.13.8/lib/newgetopt.pl>, and thus some Perl expert is needed to get it working without importing a whole Perl installation.
For now, I simply reverted to an earlier gphelp script compatible with this old perl.exe and left the tex2mail script untouched. 


5. CONCLUSION
The installation of GP/PARI 2.6 on Windows Vista is easy and the extended help can be made to work. 

6. A TRIBUTE
Finally, allow me to add this citation as a tribute to the work done by the PARI group members, which could have saved years of labour in a previous century { factor(2^64+1) }:
__________________________________"M. Landry, agé de 82 ans, et bien connu pour de nombreux mémoires sur la théorie des nombres, vient, après un grand labeur, d'arriver au résultat suivant:                2^64 + 1 = 274 177 x 67 280 421 310 721. Ainsi, contrairement à l'hypothèse de Fermat, le nombre 2^64 + 1 n'est pas premier."Nouvelle Correspondance Mathématique de M. E. Catalan 6 (1880) p. 417.____________________________________

Jacques Gélinas, Ottawa, Canada
(This is a firt post to this list for me)