Commit 7c9d6ade authored by ulrich_y's avatar ulrich_y

Added --quad to configure

parent 7170d56e
......@@ -32,6 +32,9 @@ for instance \`--prefix=\$HOME'.
For better control, use the options below.
--moduledir=DIR Fortran module files (compiler specific)
--quad uses quadruple precision (128 bit) as the
working precision. This is not compatible with
the GiNaC interface.
Fine tuning of the installation directories:
......@@ -74,6 +77,7 @@ HAVE_GINAC=false
HAVE_MCC=false
CONF_BITS=
CONF_QUAD=false
CONF_FFLAGS=$FFLAGS
CONF_CFLAGS=$CFLAGS
CONF_CXXFLAGS=$CXXFLAGS
......@@ -116,6 +120,8 @@ for arg in "$@" ; do
CONF_BITS="-m32" ;;
--64)
CONF_BITS="-m64" ;;
--quad)
CONF_QUAD=true ;;
--coverage)
COVERAGE=true ;;
--help )
......@@ -491,6 +497,39 @@ fi
CONF_LD=${LD:-$CONF_FC}
if $CONF_QUAD ; then
if $HAVE_GINAC ; then
echo "GiNaC testing is not supported for quad-precision!" 1>&3
exit 1
fi
echo -n "does $CONF_FC support quad-precision... " 1>&3
rm -fr $test*
tee $test.f90 << _EOF_ 1>&2
program test
real(selected_real_kind(30,32)) a, b
a = 2D0**(52/2+2)
b = a + 1/a
if( a .eq. b ) stop 1
end
_EOF_
$CONF_FC $CONF_FFLAGS -o $test $test.f90 1>&2
./$test 1>&2 && {
echo "yes" 1>&3
eval addflag FFLAGS -DKINDREAL=16 -DKINDINT=8
} || {
echo "no" 1>&3
exit 1
}
fi
if $HAVE_GINAC ; then
eval addflag CXXFLAGS "-std=c++11"
if [[ ! -z "$CONF_PKGCONFIG" ]]; then
......
......@@ -2,9 +2,15 @@
MODULE globals
implicit none
#ifndef KINDREAL
#define KINDREAL selected_real_kind(15,32)
#endif
#ifndef KINDINT
#define KINDINT 4
#endif
integer, parameter :: prec = selected_real_kind(15,32)
integer, parameter :: ikin = 4
integer, parameter :: prec = KINDREAL
integer, parameter :: ikin = KINDINT
real(kind=prec), parameter :: zero = 10._prec**(-precision(1._prec)) ! values smaller than this count as zero
real(kind=prec), parameter :: pi = 3.1415926535897932384626433832795028841971693993751_prec
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment