# MPFI
# ====
# Below are two different ways of doing it. Downloading a tarball of
# tag 1.5.4 and getting it directly with git from 'master'.
#
# As I write this, the most recent tag is 1.5.4 from 5 years ago and the
# latest commits to 'master' were ~ 15 days ago.
# If you ever want to uninstall MPFI, run 'make uninstall' as root from the
# configured source directory
# Get the source tarball
cd
test -f installed/mpfi-1.5.4.tar.bz2 &&
mv -f installed/mpfi-1.5.4.tar.bz2 .
test ! -f mpfi-1.5.4.tar.bz2 &&
wget https://gitlab.inria.fr/mpfi/mpfi/-/archive/1.5.4/mpfi-1.5.4.tar.bz2
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
test -d ./mpfi && rm -r ./mpfi
find -maxdepth 1 -type d -name "mpfi-*" -exec rm -r {} \;
tar xjvf ~/mpfi-1.5.4.tar.bz2
cd mpfi-1.5.4
test $UID = 0 && chown -R root:root .
cd mpfi
# Generate a configure script, etc.
test ! -f configure && ./autogen.sh
# If previously configured, clean it up
test -f Makefile && make distclean
# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --disable-static \
--docdir=/usr/local/doc/mpfi \
--infodir=/usr/local/info \
--libdir=/usr/local/lib64 \
--mandir=/usr/local/man
# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
./configure --disable-static \
--docdir=/usr/local/doc/mpfi \
--infodir=/usr/local/info \
--mandir=/usr/local/man
# Build it
make
# Check the build
make check
# Become root to install it
su
# Install it
make install
ldconfig
# Make sure your non-root user can remove the source for later
chown -R $(logname) .
chmod -R u+w .
# Become your non-root user again
exit
# Save the tarball for later
cd
mkdir -p -m 0700 installed
rm -f installed/mpfi-*.tar.* installed/mpfi.README
mv mpfi-1.5.4.tar.bz2 installed/
# MPFI from Git master
# ====================
# Get the source from the Git repository
# If you already had it, update it
cd ~/src
find -maxdepth 1 -type d -name "mpfi-*" -exec rm -r {} \;
test -d mpfi && ( cd mpfi ; git pull )
test ! -d mpfi &&
git clone https://gitlab.inria.fr/mpfi/mpfi.git
cd mpfi
# Generate a configure script, etc.
test ! -f configure && ./autogen.sh
# If previously configured, clean it up
test -f Makefile && make distclean
# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --disable-static \
--docdir=/usr/local/doc/mpfi \
--infodir=/usr/local/info \
--libdir=/usr/local/lib64 \
--mandir=/usr/local/man
# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
./configure --disable-static \
--docdir=/usr/local/doc/mpfi \
--infodir=/usr/local/info \
--mandir=/usr/local/man
# Build it
make
# Check the build
make check
# Become root to install it
su
# Remove old docs from previous source-installed versions
test -d /usr/local/doc/mpfi && rm -r /usr/local/doc/mpfi
find /usr/local/doc -maxdepth 1 -type d -name "mpfi-*" -exec rm -r {} \;
# Install it
make install
ldconfig
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become your non-root user again
exit
# Save the tarball for later
rm -f ~/installed/mpfi-*.tar.*
echo "MPFI source is in ~/src/mpfi" > ~/installed/mpfi.README