libint2/generate-sources.sh
2016-07-11 22:02:34 +02:00

71 lines
2 KiB
Bash

# Generate libint2 source tarball.
# 2016-07-09 Susi Lehtola
# Before running this script, make sure that you have all the
# buildrequires for building libint2 w/ bootstrapping
sudo dnf install boost-devel gmp-devel mpfr-devel autoconf automake "tex(latex)" "tex(appendix.sty)" "tex(framed.sty)" "tex(mathcomp.sty)" "tex(subfigure.sty)" "tex(wrapfig.sty)" "tex-bibtex" "tex(bbding.sty)" "tex(braket.sty)" "tex(sfmath.sty)"
# Read the version from the spec file
ver=`grep "Version" libint2.spec|awk '{print $2}'`
echo "Using version $ver."
# Get the sources
if [ ! -f v${ver}.tar.gz ]; then
wget https://github.com/evaleev/libint/archive/v${ver}.tar.gz
fi
# Unzip tarball
if [ ! -d libint-${ver} ]; then
tar zxf v${ver}.tar.gz
fi
# Go into the directory
cd libint-${ver}
# Run autoconf
aclocal -I lib/autoconf
autoconf
# Object directory
if [ ! -d objdir ]; then
mkdir objdir
fi
cd objdir
# Configure the options for the target library
if [ ! -f libint-${ver}-stable.tgz ]; then
echo "libint-${ver}-stable.tgz does not exist, generating."
export CXX=g++
# Optimization flags to use for the compiler (just speeds up the generation)
export OPTFLAGS=`rpm --eval %{optflags}`
../configure --enable-shared --disable-static \
--enable-eri=2 --enable-eri3=2 --enable-eri2=2 \
--with-eri-max-am=7,5,4 --with-eri-opt-am=3 \
--with-eri3-max-am=7 --with-eri2-max-am=7 \
--with-g12-max-am=5 --with-g12-opt-am=3 \
--with-g12dkh-max-am=5 --with-g12dkh-opt-am=3 \
--disable-unrolling --enable-generic-code --enable-contracted-ints \
--with-cxx-optflags="$OPTFLAGS" \
| tee configure.log
# Generate the library sources
echo "Running make export, follow progress in export.log"
make export > export.log
else
echo "Found previously generated tarball."
fi
# Generate documentation
make -C doc
# Copy the generated source tarball
cp libint-${ver}-stable.tgz ../..
# Copy the programmer's manual
cp -p doc/progman/progman.pdf ../..
# and compress the html sources
cd doc/classdoc
tar jcf ../../../../libint-${ver}-classdoc.tar.bz2 html/