About PARI / GP
https://pari.math.u-bordeaux.fr/pub/pari/manuals/2.3.5/users.pdf
`1.1 Introduction`
of is helpful.
Here, I will write about how to use PARI / GP with Docker.
You can enter the container with the option -it.
By adding gp
as shown below, PARI / GP will be started immediately after the container is started.
docker run -it pascalmolin/parigp-small gp
There is also `pascalmolin / parigp-full```, but this time it is
`small```.
PARI / GP starts as follows.
I'm trying to calculate 1 + 1.
GP/PARI CALCULATOR Version 2.11.4 (released)
amd64 running linux (x86-64/GMP-6.2.0 kernel) 64-bit version
compiled: Jul 8 2020, gcc version 9.3.0 (Alpine 9.3.0)
threading engine: single
(readline v8.0 enabled, extended help not enabled)
Copyright (C) 2000-2018 The PARI Group
PARI/GP is free software, covered by the GNU General Public License, and comes
WITHOUT ANY WARRANTY WHATSOEVER.
Type ? for help, \q to quit.
Type ?17 for how to get moral (and possibly technical) support.
parisize = 8000000, primelimit = 500000
? 1 + 1
%1 = 2
If you want to stop it, enter the \ q
command.
? 1 + 1
%1 = 2
? \q
Goodbye!
To re-enter the container, first find the CONTAINER ID you want to boot.
docker ps -a
Displays a list, including containers that are stopped.
docker ps -a
The list is displayed as shown below.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1831fe3cb55f pascalmolin/parigp-small "gp" 3 minutes ago Exited (0) About a minute ago
Restart the container.
docker restart 1831fe3cb55f
Enter the container.
docker exec -it 1831fe3cb55f sh
Go to the tmp directory and try creating a file there.
/ # cd tmp
I created the following test.gp
.
/tmp # cat test.gp
forprime(p = 1, 20, write("output.txt", p))
Start PARI / GP with the gp
command as shown below.
/tmp # gp
Run the file.
? \r test.gp
Stop PARI / GP and take a look at the created output.txt
.
/tmp # cat output.txt
2
3
5
7
11
13
17
19
Recommended Posts