Commit 1bb6e43a authored by agebhard's avatar agebhard
Browse files

..

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