Re: [R-SIG-Mac] [External] Rmpfr crashes on Mac

2021-11-28 Thread Erich Subscriptions
One more thing:
After compiling Rmpfr from source,
things worked.

> On 29.11.2021, at 00:30, Kevin Ushey  wrote:
> 
> I can reproduce something similar on my M1 macOS machine, when using the
> x86_64 build of R. I see:
> 
>> x1 <- mpfr(-50, 200)
> *** caught illegal operation ***
> address 0x10c5f623b, cause 'illegal opcode'
> 
> This is with the binary of Rmpfr 0.8-7 as from CRAN, with R 4.1.2. Here's
> what LLDB says:
> 
> * thread #1, queue = 'com.apple.main-thread', stop reason =
> EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
>frame #0: 0x00010f69c23b Rmpfr.so`mpfr_set_d + 43
> Rmpfr.so`mpfr_set_d:
> ->  0x10f69c23b <+43>: vucomisd %xmm0, %xmm0
>0x10f69c23f <+47>: jp 0x10f69c39a   ; <+394>
>0x10f69c245 <+53>: vpxor  %xmm1, %xmm1, %xmm1
>0x10f69c249 <+57>: vucomisd %xmm1, %xmm0
> 
> And the relevant part of the stack trace:
> 
> (lldb) bt
> * thread #1, queue = 'com.apple.main-thread', stop reason =
> EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
>  * frame #0: 0x00010f69c23b Rmpfr.so`mpfr_set_d + 43
>frame #1: 0x00010f6809d3 Rmpfr.so`d2mpfr1_(x=-50,
> i_prec=, rnd=MPFR_RNDN) at convert.c:129:5 [opt]
>frame #2: 0x00010f680eb0 Rmpfr.so`d2mpfr1_list(x=,
> prec=, rnd_mode=) at convert.c:186:29 [opt]
> 
> At least for my case, my guess is that the 'vucomisd' instruction isn't
> available via Apple's Rosetta emulation. It's possible users with older
> macOS machines not supporting AVX instructions could see this, as well?
> 
> Best,
> Kevin
> 
> On Sun, Nov 28, 2021 at 9:54 AM Richard M. Heiberger  wrote:
> 
>> Works normally in R-4.1.2 with Rmpfr_0.8-7 on Macintosh
>> aarch64-apple-darwin20
>> I am running inside Emacs using ESS
>> 
>>> packageVersion("Rmpfr")
>> [1] ‘0.8.7’
>>> library(Rmpfr)
>> Loading required package: gmp
>> 
>> Attaching package: ‘gmp’
>> 
>> The following objects are masked from ‘package:base’:
>> 
>>%*%, apply, crossprod, matrix, tcrossprod
>> 
>> C code of R package 'Rmpfr': GMP using 64 bits per limb
>> 
>> 
>> Attaching package: ‘Rmpfr’
>> 
>> The following object is masked from ‘package:gmp’:
>> 
>>outer
>> 
>> The following objects are masked from ‘package:stats’:
>> 
>>dbinom, dgamma, dnbinom, dnorm, dpois, dt, pnorm
>> 
>> The following objects are masked from ‘package:base’:
>> 
>>cbind, pmax, pmin, rbind
>> 
>>> x1 <- mpfr(-50, 200)
>>> x1
>> 1 'mpfr' number of precision  200   bits
>> [1] -50
>>> x2 <- mpfr(-50.1, 200)
>>> x2
>> 1 'mpfr' number of precision  200   bits
>> [1] -50.10142108547152020037174224853515625
>>> version
>>   _
>> platform   aarch64-apple-darwin20
>> arch   aarch64
>> os darwin20
>> system aarch64, darwin20
>> status
>> major  4
>> minor  1.2
>> year   2021
>> month  11
>> day01
>> svn rev81115
>> language   R
>> version.string R version 4.1.2 (2021-11-01)
>> nickname   Bird Hippie
>>> 
>> 
>>> On Nov 27, 2021, at 15:46, Dev Chakraborty  wrote:
>>> 
>>> I used package Rmpfr ca. 2017 and it worked fine. The latest version
>>> (0.8-7) causes R (running under RStudio) to crash. A simple example is:
>>> 
>>> library(Rmpfr)
>>> x1 <- mpfr(-50, 200)
>>> x2 <- mpfr(-50.1, 200)
>>> 
>>> Which gives the message:
>>> 
>>> R Session Aborted
>>> R encountered a fatal error
>>> The session was terminated
>>> Start New Session
>>> 
>>> I am using R version 4.1.1 on a Mac running MacOS 12.0.1. and an older
>> iMac
>>> running 10.15.7. The problem occurs with both machines.
>>> 
>>> When I install from the CRAN archive file  Rmpfr_0.6-1.tar.gz (the
>> version
>>> of the package around 2017, corresponding to the last time I used it) the
>>> problem goes away.
>>> 
>>>  [[alternative HTML version deleted]]
>>> 
>>> ___
>>> R-SIG-Mac mailing list
>>> R-SIG-Mac@r-project.org
>>> 
>> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-macdata=04%7C01%7Crmh%40temple.edu%7C3aabc743f322409d6fa308d9b259a7bb%7C716e81efb52244738e3110bd02ccf6e5%7C0%7C0%7C637736920545174898%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000sdata=pNPM8x8q1%2BQxq4QevSbfjlcO44vDVEyUvsRlfDBfgBo%3Dreserved=0
>> 
>> ___
>> R-SIG-Mac mailing list
>> R-SIG-Mac@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>> 
> 
>   [[alternative HTML version deleted]]
> 
> ___
> R-SIG-Mac mailing list
> R-SIG-Mac@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

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


[R-SIG-Mac] Strange library problem with 4.0

2020-04-25 Thread Erich Subscriptions
I installed R 4.0 on 2 machines, an iMac and a Macbook Pro.
Before that, I installed RSwitch and did what the site tells to do:
sudo pkgutil --forget org.r-project.R.el-capitan.fw.pkg \
 --forget org.r-project.x86_64.tcltk.x11 \
 --forget org.r-project.x86_64.texinfo \
 --forget org.r-project.R.el-capitan.GUI.pkg
so that the 3.6 and 4.0 can coexist.

I always keep the additionally installed packages in
~/Library/R

After installing R 4.0 I therefore have
~/Library/R/3.6/library and ~/Library/R/4.0/library

On the iMac, I can switch between the two versions and R will put the 
appropriate folder 
in .libPaths()

On the Macbook, however, when I run R 4.0
both these folders are in .libPaths().
This does not happen when I run R 3.6.

How can this problem be solved?

Erich

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


[R-SIG-Mac] My silliness

2019-10-10 Thread Erich Subscriptions
gfortran 6.1 from the tools directory (which I simply did not notice) did 
install.
But it also seems to be 32bi and therefore does not work on Catalina.



Sorry for bothering people here.

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


[R-SIG-Mac] Catalina and gfortran

2019-10-10 Thread Erich Subscriptions
I am trying to produce a n R environment on clean new Catalina installation (in 
a VM).
The R binary installer and RStudio work.
Then, I installed clang7, and that seems to work also.
gfortran, however, is a problem.
The 4.2.3 version (still in the tools folder on CRAN) is 32bit only,
so it does not work on Catalina.
6.1 from https://github.com/fxcoudert/gfortran-for-macOS/
cannot be installed, the installer tells that it is incompatible with this 
version of macOS.

Is there a workaround? Can I find a version of gfortran which will compile
packages containing Fortran code?
(I stumbled on classInt).

I also tried gcc@7 from homebrew, but could not get it to run either.

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