PREFIX="/usr/local"
OPT_FLAGS="-O3 -march=core2 -mtune=intel -fomit-frame-pointer"
OS_ARCH="`uname -m`" OS_REV="`uname -r | cut -d. -f1`"
TRIPLE="${OS_ARCH}-apple-darwin${OS_REV}"
export CXXFLAGS="${OPT_FLAGS} -pipe -Wall -fno-common -DPIC"
export CFLAGS="${OPT_FLAGS} -pipe -Wall -fno-common -DPIC"
export LDFLAGS="-Wl,-no_pie"
export CXX=g++
export CC=gcc
# MPN_64="x86_64/coreibwl x86_64/coreihwl x86_64/coreisbr x86_64/coreinhm x86_64/fastsse x86_64/core2 x86_64 generic"
MPN_64="x86_64/coreihwl x86_64/coreisbr x86_64/coreinhm x86_64/fastsse x86_64/core2 x86_64 generic"
# Replace two options with --disable-static --enable-shared for shared libraries
MPN_PATH="${MPN_64}" \
./configure \
--build="${TRIPLE}" --prefix="${PREFIX}" --disable-shared --enable-static \
--enable-cxx --enable-assembly --enable-fft
####
cd gmp-6.1.2
sh /path/to/configure-gmp.sh
make -j 4
make check # <-- important, do not skip
sudo make install-strip
##
##
PREFIX="/usr/local"
OPT_FLAGS="-O3 -march=core2 -mtune=intel -fomit-frame-pointer"
OS_ARCH="`uname -m`" OS_REV="`uname -r | cut -d. -f1`"
TRIPLE="${OS_ARCH}-apple-darwin${OS_REV}"
export CXXFLAGS="${OPT_FLAGS} -pipe -Wall -fno-common -DPIC"
export CFLAGS="${OPT_FLAGS} -pipe -Wall -fno-common -DPIC"
export LDFLAGS="-Wl,-no_pie"
export CXX=g++
export CC=gcc
# Replace two options with --disable-static --enable-shared for shared libraries
./configure \
--build="${TRIPLE}" --prefix="${PREFIX}" --disable-shared --enable-static \
--disable-dependency-tracking --disable-assert --enable-thread-safe \
--with-gmp="${PREFIX}"
##
##
cd mpfr-3.1.2
patch -N -Z -p1 < /path/to/allpatches.txt
sh /path/to/configure-mpfr.sh
make -j 4
make check # <-- important, do not skip
sudo make install-strip
##
##
$ time /opt/perl-5.26.1/bin/perl -Mntheory=:all -E 'say Pi(1e6)' | wc -c
1000002
real 0m1.428s
user 0m1.408s
sys 0m0.017s