Commit 1bb6e43a authored by agebhard's avatar agebhard

..

parent 467b9900
......@@ -7,27 +7,27 @@ AC_DEFUN([CHECK_SUN_COMPILER_OPTIMIZATION],[
AC_CACHE_CHECK([for correct optimization with SUN compilers],
r_cv_sun_opt5_$1,[
if test -z "${R_HOME}" ; then
R_HOME=`R RHOME`
R_HOME=`R RHOME`
fi
if test -z "${R_HOME}" ; then
echo "Cannot find the R distribution!"
exit 1
fi
CC=`"${R_HOME}/bin/R" CMD config CC`
F77=`"${R_HOME}/bin/R" CMD config F77`
PKG_CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS`
PKG_FFLAGS=`"${R_HOME}/bin/R" CMD config FFLAGS`
<<<<<<< acinclude.m4
case "${host_cpu}-${host_os}" in
x86*-solaris*)
=======
case "${host}" in
x*-sun-solaris*)
>>>>>>> 1.2
dnl use a hard coded call to src/tripack.f through R
dnl to determine wether it returns all NA.
dnl then retry with -xO5
dnl
cat >conftest.R <<EOT
dnl
dnl skip gcc:
if test "${ac_cv_fc_compiler_gnu}" != yes; then
cat >conftest.R <<EOT
check <- function(){
dyn.load("src/tripack.so")
x1 <- c(-1.17182301840432, -0.738152338408028, 0.0724389527039489, 0.605106093471307, -2.16072259908434)
......@@ -53,26 +53,26 @@ check <- function(){
check()
EOT
rm -f src/tripack.o
rm -f src/tripack.so
$R_HOME/bin/R CMD SHLIB src/tripack.f
echo "source(\"conftest.R\")" | $R_HOME/bin/R --vanilla >/dev/null
rm -f conftest.R
rm -f src/tripack.o
rm -f src/tripack.so
eval "`cat ./conftest.out`"
rm -f ./conftest.out
if test -z "${ALL_NAS}" ; then
echo "Failed to check for NAs in return values."
exit 1;
else
if test "${ALL_NAS}" = "yes"; then
echo "NAs produced, default compiler optimization too high, trying to relax to -xO5"
cat >conftest.R <<EOT
rm -f src/tripack.o
rm -f src/tripack.so
$R_HOME/bin/R CMD SHLIB src/tripack.f
echo "source(\"conftest.R\")" | $R_HOME/bin/R --vanilla >/dev/null
rm -f conftest.R
rm -f src/tripack.o
rm -f src/tripack.so
eval "`cat ./conftest.out`"
rm -f ./conftest.out
if test -z "${ALL_NAS}" ; then
echo "Failed to check for NAs in return values."
exit 1;
else
if test "${ALL_NAS}" = "yes"; then
echo "NAs produced, default compiler optimization too high, trying to relax to -xO5"
cat >conftest.R <<EOT
check <- function(){
dyn.load("src/tripack.so")
x1 <- c(-1.17182301840432, -0.738152338408028, 0.0724389527039489, 0.605106093471307, -2.16072259908434)
......@@ -98,55 +98,57 @@ check <- function(){
check()
EOT
rm -f src/tripack.o
rm -f src/tripack.so
MAKEFLAGS='CFLAGS=-xO5 FFLAGS=-O0' $R_HOME/bin/R CMD SHLIB src/tripack.f
echo "source(\"conftest.R\")" | $R_HOME/bin/R --vanilla >/dev/null
rm -f conftest.R
rm -f src/tripack.o
rm -f src/tripack.so
eval "`cat ./conftest.out`"
rm -f ./conftest.out
if test "${ALL_NAS}" = "yes"; then
echo "still NAs produced, giving up"
exit 1
else
echo -n "will use -xO5 to avoid problems with NAs"
rm -f src/tripack.o
rm -f src/tripack.so
MAKEFLAGS='CFLAGS=-xO5 FFLAGS=-O0' $R_HOME/bin/R CMD SHLIB src/tripack.f
echo "source(\"conftest.R\")" | $R_HOME/bin/R --vanilla >/dev/null
rm -f conftest.R
rm -f src/tripack.o
rm -f src/tripack.so
eval "`cat ./conftest.out`"
rm -f ./conftest.out
if test "${ALL_NAS}" = "yes"; then
echo "still NAs produced, giving up"
exit 1
else
echo -n "will use -xO5 to avoid problems with NAs"
dnl strip out all -xO[1234] flags, add one -xO5 flag instead
NEW_PKG_CFLAGS="-xO5 "
for f in ${PKG_CFLAGS}; do
case $f in
-xO[[1234]])
break
;;
*)
NEW_PKG_CFLAGS="${NEW_PKG_CFLAGS} $f"
;;
esac
done
NEW_PKG_FFLAGS="-O0 "
for f in ${PKG_FFLAGS}; do
case $f in
-xO[[1234]])
break
;;
*)
NEW_PKG_FFLAGS="${NEW_PKG_FFLAGS} $f"
;;
esac
done
PKG_CFLAGS=${NEW_PKG_CFLAGS}
PKG_FFLAGS=${NEW_PKG_FFLAGS}
NEW_PKG_CFLAGS="-xO5 "
for f in ${PKG_CFLAGS}; do
case $f in
-xO[[1234]])
break
;;
*)
NEW_PKG_CFLAGS="${NEW_PKG_CFLAGS} $f"
;;
esac
done
NEW_PKG_FFLAGS="-O0 "
for f in ${PKG_FFLAGS}; do
case $f in
-xO[[1234]])
break
;;
*)
NEW_PKG_FFLAGS="${NEW_PKG_FFLAGS} $f"
;;
esac
done
PKG_CFLAGS=${NEW_PKG_CFLAGS}
PKG_FFLAGS=${NEW_PKG_FFLAGS}
fi
fi
fi
fi
fi
;;
;;
*)
echo -n "not running on x*-solaris*"
echo -n "not running on x86*-solaris*"
;;
esac
]) # AC_CACHE_CHECK
]) # AC_CACHE_CHECK
]) # AC_DEFUN
This diff is collapsed.
# package/configure.in
AC_PREREQ(2.50)
AM_INIT_AUTOMAKE("akima",0.5-5)
AC_INIT(src/tripack.f)
AC_INIT([akima],[0.5-5])
AC_CONFIG_SRCDIR(src/tripack.f)
#if you want to use more macros
#AC_CONFIG_MACRO_DIR([m4])
......
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