[DOCKER] I tried using Pari gp container

Introduction

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.

Launch Docker container

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 -aDisplays 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

File reading and writing

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

Reference article

Recommended Posts

I tried using Pari gp container
I tried using Gson
I tried using TestNG
I tried using Galasa
I tried using azure cloud-init
I tried using Apache Wicket
I tried using Java REPL
I tried using anakia + Jing now
I tried using JOOQ with Gradle
I tried using Java8 Stream API
I tried using WebAssembly Stadio (2018/4/17 version)
I tried using Java memo LocalDate
I tried using GoogleHttpClient of Java
I tried using the cache function of Application Container Cloud Service
I tried using Elasticsearch API in Java
I tried using Realm with Swift UI
I tried using Java's diagnostic tool Arthas
I tried using UICollectionViewListCell added from Xcode12.
I tried using Scalar DL with Docker
I tried using OnlineConverter with SpringBoot + JODConverter
It's new, but I tried using Groonga
I tried using OpenCV with Java + Tomcat
I tried Spring.
I tried tomcat
I tried youtubeDataApi.
I tried refactoring ①
I tried FizzBuzz.
I tried JHipster 5.1
I tried using Docker for the first time
I tried using Junit on Mac VScode Maven
[For beginners] I tried using DBUnit in Eclipse
I tried barcode scanning using Rails + React + QuaggaJS
[For beginners] I tried using JUnit 5 in Eclipse
[Android] I quit SQLite and tried using Realm
I made blackjack with Ruby (I tried using minitest)
[API] I tried using the zip code search API
I tried running Ansible on a Docker container
I tried to implement a server using Netty
I tried using the profiler of IntelliJ IDEA
AWS Lambda supports container images so I tried Puppeteer
[I tried] Spring tutorial
I tried using the Server Push function of Servlet 4.0
I tried running Autoware
I tried using Alibaba Cloud's KMS (Key Management Service) service
I tried using Google Cloud Vision API in Java
I tried to operate SQS using AWS Java SDK
I tried QUARKUS immediately
I tried using the Migration Toolkit for Application Binaries
I tried using Log4j2 on a Java EE server
I tried Spring Batch
I tried using YOLO v4 on Ubuntu and ROS
I tried using Docker Desktop for Windows on Windows 10 Home
I tried node-jt400 (Programs)
I tried using an extended for statement in Java
I tried node-jt400 (execute)
I tried scraping a stock chart using Java (Jsoup)
I tried node-jt400 (Transactions)
I tried to build an environment using Docker (beginner)
I tried unit testing Rails app using RSpec and FactoryBot
I tried using the GitHub repository as a library server
[Rails] I tried using the button_to method for the first time