\documentclass{beamer}

\mode<presentation> {
  \usetheme{Montpellier}
  \setbeamercovered{transparent}
}

\usepackage[utf8x]{inputenc}
\usepackage{times}
\usepackage[T1]{fontenc}

\def\BPROG{\par\begingroup\tt}
\def\bprog{\BPROG\color{red}}
\def\eprog{\endgroup\par}
\def\INDENT{\hbox{}\qquad}  
\def\com#1{\hbox{}\qquad{\textcolor{black}{#1}}}  
\def\note#1{{\gray\small#1}}
\def\kbd#1{{\tt\textcolor{blue}{#1}}}
\def\typ#1{{\tt t\_#1}}
\def\cmd#1{{\tt\string#1}}
\def\gpurl#1{\textcolor{red}{\url{#1}}}
\def\misctitle#1{\smallskip\par\noindent{\bf#1~:}}
\def\pow{\^{}\hskip0pt}
\def\bs{{\char'134}}

\def\GP{{\sc\blue GP}\xspace}
\def\gptoc{\kbd{\blue gp2c}\xspace}
\def\gp{\kbd{\blue gp}\xspace}
\def\PARI{{\sc\blue  Pari}\xspace}
\def\GPpari{{\sc\blue  Pari/GP}\xspace}

\title{Compiling PARI from the GIT repository}
\author{B.~Allombert and K.~Belabas}
\institute
{
  IMB \\
  CNRS/Université de Bordeaux
}

\date{20/01/2020}

\subject{Exposé}
\AtBeginSubsection[] {
  \begin{frame}<beamer>{Lignes directrices}
    \tableofcontents[currentsection,currentsubsection]
  \end{frame}
}

%\beamerdefaultoverlayspecification{<+->}

\begin{document}
\begin{frame}
  \titlepage
\input ../opendreamkit.tex
\end{frame}

\begin{frame}[fragile]{Introduction}
This talk focuses on the current development version of the PARI library
({\textcolor{blue}{2.12.*}}), available from our GIT repository, see
\begin{center}
\gpurl{http://pari.math.u-bordeaux.fr/anongit.html}
\end{center}
The text of this talk is available in the files \kbd{sources.*} in
\begin{center}
\gpurl{http://pari.math.u-bordeaux.fr/Events/PARI2020/talks/}
\end{center}
\end{frame}

\begin{frame}[fragile]{Windows users}
Download a precompiled 64bit installer \kbd{Pari64-2-12-1.A2020.exe} or
32bit binary \kbd{Pari32-2-12-1.A2020.exe} from
\begin{center}
\gpurl{http://pari.math.u-bordeaux.fr/pub/pari/windows/snapshots/}
\end{center}
Also available are precompiled 64bit binary \kbd{gp64-gmp-git*.exe} or
32bit binary \kbd{gp32-gmp-git*.exe}.
\end{frame}

\begin{frame}[fragile]{Mac OS users}
Download a precompiled DMG \kbd{PariGP-full-2.12.1.A2020.dmg} or
\kbd{PariGP-full-2.12.1.A2020-pthread.dmg} from
\begin{center}
\gpurl{http://pari.math.u-bordeaux.fr/pub/pari/mac/snapshots/}
\end{center}
on some system, you need to right-click on the icon and select open,
so that you can bypass the security check.

Also are precompiled binary \kbd{gp-git*-osx}.
\end{frame}

\begin{frame}[fragile]{Linux}
To install all the packages required to build pari from source:

Debian/Ubuntu
\begin{verbatim}
sudo apt-get build-dep pari
sudo apt-get install libreadline-dev libgmp-dev
\end{verbatim}
Fedora
\begin{verbatim}
sudo dnf install readline-devel gmp-devel
\end{verbatim}

If you want to use git, also do

Debian/Ubuntu
\begin{verbatim}
sudo apt-get install git bison automake autoconf
\end{verbatim}

Fedora
\begin{verbatim}
sudo dnf install git bison automake autoconf
\end{verbatim}
\end{frame}

\begin{frame}[fragile]{From source with GIT}
Clone the PARI repository with GIT ($\sim150$MB).
\small
\begin{verbatim}
git clone http://pari.math.u-bordeaux.fr/git/pari.git
cd pari
\end{verbatim}
\end{frame}

\begin{frame}[fragile]{From source without GIT}
Download \kbd{pari-2.12.1.A2020.tar.gz} from
\begin{center}
\gpurl{http://pari.math.u-bordeaux.fr/pub/pari/snapshots/}
\end{center}
and unpack it
\begin{verbatim}
tar xf pari-2.12*.tar.gz
cd pari-2.12*
\end{verbatim}
\end{frame}

\begin{frame}[fragile]{PARI compilation}
\begin{verbatim}
./Configure --prefix=GPDIR --mt=pthread 
make -j4 gp
make doc
make statest-all
make install
make install-bin-sta
./Configure --prefix=GPDIR.dbg -g
make -j4 gp.dbg
make install -C Olinux-x86_64.dbg
GPDIR/bin/gp
\end{verbatim}
\end{frame}

\begin{frame}[fragile]{Optional PARI packages}
To install optional PARI packages from
\url{https://pari.math.u-bordeaux.fr/packages.html}
\begin{verbatim}
wget https://pari.math.u-bordeaux.fr/\
pub/pari/packages/galdata.tgz
tar xf galdata.tgz
wget https://pari.math.u-bordeaux.fr/\
pub/pari/packages/elldata.tgz
tar xf elldata.tgz
wget https://pari.math.u-bordeaux.fr/\
pub/pari/packages/galpol.tgz
tar xf galpol.tgz
wget https://pari.math.u-bordeaux.fr/\
pub/pari/packages/seadata.tgz
tar xf seadata.tgz
make install-data
\end{verbatim}
\end{frame}

\begin{frame}[fragile]{GP configuration}
Create and customize \verb!~/.gprc!.  Add
\begin{verbatim}
histfile = "~/.gp_history"
colors = "lightbg" \\ or "darkbg"
lines = 40
parisizemax = 4G \\ or the maximum amount of memory 
                 \\ GP can use (important)
threadsizemax = 1G
read "~/.gprc.gp"
\end{verbatim}
Create an empty file \verb!~/.gprc.gp!
\end{frame}

\begin{frame}[fragile]{GP2C compilation}
With GIT (and automake, autoconf):
{\small
\begin{verbatim}
git clone http://pari.math.u-bordeaux.fr/git/gp2c.git
cd gp2c
./autogen.sh
\end{verbatim}
}
Without GIT: download GP2C from
\gpurl{http://pari.math.u-bordeaux.fr/download.html\#gp2c}
\begin{verbatim}
tar xf gp2c-0.0.11pl2.tar.gz
cd gp2c-0.0.11pl2
\end{verbatim}
\end{frame}
\begin{frame}[fragile]{GP2C compilation}
\small
\begin{verbatim}
./configure --prefix=$PWD/../GPDIR \
     --with-paricfg=../GPDIR/lib/pari/pari.cfg \
     --with-paricfg.dbg=../GPDIR.dbg/lib/pari/pari.cfg
make check
make install
cd ..
GPDIR/bin/gp2c -v
\end{verbatim}
\end{frame}

\begin{frame}[fragile]{Updating GIT}
To update GIT to the most recent revision:
\begin{verbatim}
git fetch
git rebase origin/master
./Configure -l
make install
\end{verbatim}
\end{frame}

\begin{frame}[fragile]{Changelog}
You can see the latest commits with
\begin{verbatim}
git log
\end{verbatim}
\end{frame}
\end{document}
