Re: [R-SIG-Mac] building R with external Lapack

2016-03-05 Thread Baptiste Auguie
Hi again,

Following my previous message, I've made some progress after finding hints
on the list archives that the flag CPPFLAGS="-D__ACCELERATE__"  should help
direct R to use the Accelerate framework. It does help in this regard, as
./configure now confirms,

  External libraries:readline, BLAS(Accelerate), LAPACK(in blas),
zlib, bzlib, PCRE, curl

Unfortunately, make fails because of a missing lzma.h, even though it
exists and lives in /usr/local/include/lzma.h. I have xz installed via brew.

Ideally I would like to be able to build R from source on my mac, but that
has proved harder than I anticipated. Alternatively,

- is there a way to redirect R's Lapack after installation, the same way as
for BLAS?
( as in
cd /Library/Frameworks/R.framework/Resources/lib
ln -sf
/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Versions/Current/libBLAS.dylib
libRblas.dylib)

- could I somehow silence RcppArmadillo's solve() warning? (this is more of
a Rcpp-dev question, I'll ask there if it comes to that)

Thanks,

baptiste


On 5 March 2016 at 18:24, Baptiste Auguie  wrote:

> Dear list,
>
> I have a package using RcppArmadillo for linear algebra; at some point in
> the calculation it solves a linear system. I understand the c++ Armadillo
> library hands this operation over to Lapack  Unfortunately, somewhere in my
> toolchain Armadillo has been configured to use R's internal subset
> of Lapack, which triggers the following warning every time I call the R
> function,
>
> warning: solve(): refinement and/or equilibration not done due to crippled
> LAPACK
>
> This doesn't sound very good, and is also a real nuisance in the terminal
> as I'm calling the function hundreds of times in a loop. I've installed the
> latest build from https://r.research.att.com, built and installed the
> latest version of RcppArmadillo, but the problem persists.
>
> I'm not sure if it's relevant to this question, but I've had some success
> with the related issue of switching from R's internal BLAS to the vecLib
> one,
>
> cd /Library/Frameworks/R.framework/Resources/lib
> ln -sf
> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Versions/Current/libBLAS.dylib
> libRblas.dylib
>
> giving me a considerable boost in performance. I'm not sure if something
> similar can be done for Lapack.
>
> The next step I've taken was to try and build R myself, with explicit
> flags telling R to use an external Lapack from Apple's Accelerate (vecLib?)
> framework. I have not had any luck with that, every time some kind of error
> appears, and I could not find a recent tutorial with step-by-step
> instructions to build R on a Mac.
>
> I've downloaded the R source, followed by
>
> ./configure SHELL='/bin/bash' r_arch=x86_64 CC="gcc -arch x86_64
> -std=gnu99" CXX="g++ -arch x86_64" OBJC="gcc -arch x86_64" F77="gfortran
> -arch x86_64" FC="gfortran -arch x86_64" --with-system-zlib
> --with-blas='-framework vecLib' --with-lapack
>
> with this summary at the end:
>
> R is now configured for x86_64-apple-darwin15.3.0
>
>   Source directory:  .
>   Installation directory:/Library/Frameworks
>
>   C compiler:gcc -arch x86_64 -std=gnu99
>  -I/usr/local/include
>   Fortran 77 compiler:   gfortran -arch x86_64  -g -O2
>
>   C++ compiler:  g++ -arch x86_64  -g -O2
>   C++ 11 compiler:   g++ -arch x86_64  -std=c++11 -g -O2
>   Fortran 90/95 compiler:gfortran -arch x86_64 -g -O2
>   Obj-C compiler: gcc -arch x86_64 -g -O2 -fobjc-exceptions
>
>   Interfaces supported:  X11, aqua, tcltk
>   External libraries:readline, zlib, bzlib, lzma, PCRE, curl
>   Additional capabilities:   NLS, ICU
>   Options enabled:   framework, shared BLAS, R profiling
>
>   Capabilities skipped:  PNG, JPEG, TIFF, cairo
>   Options not enabled:   memory profiling
>
>   Recommended packages:  yes
>
> make
>
> gives me this error:
>
> byte-compiling package 'grDevices'
> Warning in solve.default(rgb) :
>   unable to load shared object
> '/Users/baptiste/Downloads/R-rc/modules/x86_64/lapack.so':
>   dlopen(/Users/baptiste/Downloads/R-rc/modules/x86_64/lapack.so, 6):
> Symbol not found: __gfortran_compare_string
>
> I've tried quite a few variations, but I'm shooting in the dark since I
> don't understand the issue. If I've missed a standard tutorial, please let
> me know.
>
> Best regards,
>
> baptiste
>
> PS: my sessionInfo() using CRAN's R-devel
> R Under development (unstable) (2016-03-02 r70268)
> Platform: x86_64-apple-darwin13.4.0 (64-bit)
> Running under: OS X 10.11.3 (El Capitan)
> locale:
> [1] en_NZ.UTF-8/en_NZ.UTF-8/en_NZ.UTF-8/C/en_NZ.UTF-8/en_NZ.UTF-8
>
> gfortran -v
> gfortran: warning: couldn’t understand kern.osversion ‘15.3.0
> Using built-in specs.
> COLLECT_GCC=gfortran
>
> COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin13.0.0/4.8.2/lto-wrapper
> Target: x86_64-apple-darwin13.0.0
> 

Re: [R-SIG-Mac] R gui or Rstudio quits

2016-03-05 Thread David Winsemius

> On Mar 5, 2016, at 7:33 AM, peter dalgaard  wrote:
> 
> Hmm, there was _something_ at _some_ point, on El Cap, I seem to remember. 
> 
> Have you tried the daily versions at http://r.research.att.com ?
> 
> -pd
> 
>> On 05 Mar 2016, at 15:22 , Paul Schlesinger  wrote:
>> 
>> On a Macbookpro and MacAir 2012-13 vintage running Osx 10.11.3. R installed
>> by standard package options the first time R is started The application
>> quits and I can send information to Apple.  Now if I restart from this
>> message or just restart R appears to run fine. This could be related to os
>> update but it was first noted a month after the upgrade. I have reinstalled
>> R several times without changing this behavior.  Other non-apple software,
>> Emacs and latex are running on these machines without a similar problem. Is
>> this a know problem and is there a correction.
>> 

Have you made sure that there is no hidden corrupt .Rdata  or .Rapp.history 
file? One way to do this is running R from a Terminal session with:

R --vanilla

I'm not a regular RStudio user, so If R is stable in that situation then your 
first act should be deleting those (invisible-by-default) files. It's fairly 
easy to find advice about how to make invisible files visible on OSX using a 
Google search. I'm not a regular RStudio user, so I don't know if finding such 
files in that environment is any more difficult. I suspect there would be such 
a file for every project.

--

David Winsemius
Alameda, CA, USA

___
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac


Re: [R-SIG-Mac] R gui or Rstudio quits

2016-03-05 Thread peter dalgaard
Hmm, there was _something_ at _some_ point, on El Cap, I seem to remember. 

Have you tried the daily versions at http://r.research.att.com ?

-pd

> On 05 Mar 2016, at 15:22 , Paul Schlesinger  wrote:
> 
> On a Macbookpro and MacAir 2012-13 vintage running Osx 10.11.3. R installed
> by standard package options the first time R is started The application
> quits and I can send information to Apple.  Now if I restart from this
> message or just restart R appears to run fine. This could be related to os
> update but it was first noted a month after the upgrade. I have reinstalled
> R several times without changing this behavior.  Other non-apple software,
> Emacs and latex are running on these machines without a similar problem. Is
> this a know problem and is there a correction.
> 
> Thank you
> 
> -- 
> Paul H. Schlesinger MD, PhD
> Washington University School of Medicine
> 
>   [[alternative HTML version deleted]]
> 
> ___
> R-SIG-Mac mailing list
> R-SIG-Mac@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

___
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac


[R-SIG-Mac] R gui or Rstudio quits

2016-03-05 Thread Paul Schlesinger
On a Macbookpro and MacAir 2012-13 vintage running Osx 10.11.3. R installed
by standard package options the first time R is started The application
quits and I can send information to Apple.  Now if I restart from this
message or just restart R appears to run fine. This could be related to os
update but it was first noted a month after the upgrade. I have reinstalled
R several times without changing this behavior.  Other non-apple software,
Emacs and latex are running on these machines without a similar problem. Is
this a know problem and is there a correction.

Thank you

-- 
Paul H. Schlesinger MD, PhD
Washington University School of Medicine

[[alternative HTML version deleted]]

___
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac