https://github.com/cran/RcppArmadillo
Raw File
Tip revision: c0bd0abd4a6998283e29fa0eabc8b2bdeafc7220 authored by Dirk Eddelbuettel on 04 August 2015, 06:49:47 UTC
version 0.5.300.4
Tip revision: c0bd0ab
configure
#!/bin/bash
#
# Copyright 2013 - 2014  Dirk Eddelbuettel
#
# Licensed under GPL 2 or later

# This file uses bash.
#
# If this file is not suitable for your system for lack of bash or
# another suitable /bin/sh implementation, I recommend deletion of the file
# along with *manual* adjustment to RcppArmadilloLapack.h as per the
# test below. 
#
# In most case you can just copy RcppArmadilloLapack.h.in over to
# RcppArmadilloLapack.h -- and in aggregate it is not worth rewriting this.
# At some point in the future we will be able to just rely on recent enough R
# with good enough embeded Lapack, or use of external Lapack.

if [ "${R_HOME}" == "" ]; then
   R_HOME=$(R RHOME)
fi

echo -n "* checking LAPACK_LIBS: "

## external LAPACK has the required function
lapack=$(${R_HOME}/bin/R CMD config LAPACK_LIBS)
hasRlapack=$(echo ${lapack} | grep lRlapack)

## internal Rlapack has the required function if "new enoug:
newR=$(${R_HOME}/bin/R --slave -q -e 'cat(ifelse(getRversion() >= "3.0.3","yes","no"))')

if [ "${hasRlapack}" == "" ]; then
    ## We are using a full Lapack and can use zgesdd -- so #undef remains
    echo "divide-and-conquer complex SVD available via system LAPACK"
    cp inst/include/RcppArmadilloLapack.h.in inst/include/RcppArmadilloLapack.h 
elif [ "$newR" == "yes" ]; then
    ## The R version is recent enough and has an augmented internal Rlapack
    echo "divide-and-conquer complex SVD available via R-supplied LAPACK"
    cp inst/include/RcppArmadilloLapack.h.in inst/include/RcppArmadilloLapack.h 
else
    ## We are using a R's subset of Lapack and CANNOT use zgesdd -- so mark ARMA_DONT_USE_CX_GESDD as 1
    echo " divide-and-conquer complex SVD unavailable via R-supplied LAPACK"
    echo "* divide-and-conquer algorithm for complex SVD will be redirected to default"
    sed -e 's/\/\/ \#undef ARMA_DONT_USE_CX_GESDD/\#define ARMA_DONT_USE_CX_GESDD/' \
        inst/include/RcppArmadilloLapack.h.in > inst/include/RcppArmadilloLapack.h 
fi


back to top