#!/bin/sh

NUM_DIGITS="100000 1000000 10000000 100000000 1000000000"

echo "*** system info ***"
uname -a
oslevel
lsattr -El proc0

echo "*** gmp info ***"
rpm -q gmp gmp-devel


optim="-O3 -qarch=auto -qtune=auto"
mediumpages="-Wl,-bdatapsize:64k,-bstackpsize:64k,-btextpsize:64k"
xlc $optim $mediumpages -o gmp-chudnovsky gmp-chudnovsky.c -lgmp -lm

echo "*** gmp pi bench ***"
for n in $NUM_DIGITS; do
  echo "$n digits:"
  ./gmp-chudnovsky $n
done
