Skip to content

Problems with R and Big Sur

23 messages · Dr Eberhard W Lisse, Bob Rudis, Spencer Graves +7 more

#
To those in charge of R for Mac OS X: 

I have installed the new Big Sur operating system and now I always get a warning similar to: 

2020-12-02 09:52:00.647 R[703:11786] Warning: Expected min height of view: (<NSPopoverTouchBarItemButton: 0x7f9c6bb3df50>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.

and the computer becomes very slow. 

Can I do something to fix it, or will we have to wait for an R update?

Thank you very much for your attention.

Sincerely,

Mar?a-?ngeles Casares-de-Cal
#
I don't get this in 4.0.3 (using the command line version of R) and I
don't get this in RStudio 1.3.1093 either.  I use the homebrew versions
without the R GUI even installed.

I am sure more detail will be helpful to the developers.

el
On 02/12/2020 11:09, Maria-Angeles Casares-de-Cal via R-SIG-Mac wrote:
[...]
#
I didn't get this with R 4.0.3 under macOS Big Sur 11.0.1 with "time 
R CMD build" / check.  I have not tried it under RStudio.


	  sg
On 2020-12-02 05:01, Dr Eberhard W Lisse wrote:
#
After a bit of git and google poking it seems this is happening to users
of MacVim (https://github.com/macvim-dev/macvim/issues/1114) and a few
other FOSS projects.

In various GH issues (like that one) the issue claims to be resolved by
using the latest Xcode & SDK but that?s not likely to be a solution for R
GUI (which I?m assuming you're using and where this error is coming up).

Some of the threads I saw made it seem like it was happening especially on
Touch Bar-equipped MacBook Pros (but that?s not confirmed).

When I try R GUI on Big Sur (on the new M1 Mini) ? either just plain R
scripts or plotting ? I do not see this, nor do I see this on my Intel
MacBook Pro (both are on the latest Big Sur beta and R 4.0.3).

On Dec 2, 2020 at 7:53:26 AM, Spencer Graves <spencer.graves at prodsyse.com>
wrote:

  
  
#
Dear all,

I am running R 4.0.3 on BigSur without major performance issues. I am using RStudio instead of the R GUI. 

I had to build all spatial packages (rgdal, sf, terra and raster) from source using the Apple clang version 12.0.0 compiler. I also had to build GDAL from scratch, since neither the ?homebrew? version nor the ?kyngchaos? version work well with BigSur. 

If anyone is building packages from source, please make sure to have installed the latest version of Apple?s development environment, including version 12.0 of the compiler as earlier versions do not work well in BigSur.

Best
Gilberto
===========================
Prof Dr Gilberto Camara
Secretariat Director
GEO - Group on Earth Observations
#
What should I do to "make sure to have installed the latest version 
of Apple's development environment, including version 12.0 of the 
compiler"?


	  Thanks,
	  Spencer Graves
On 2020-12-02 07:36, GilbertoCamara wrote:
#
clang --version

el
On 02/12/2020 16:15, Spencer Graves wrote:
#
For me, it worked as follows

sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select ?install

Best 
Gilberto
#
$ clang --version
Apple clang version 11.0.3 (clang-1103.0.32.59)
Target: x86_64-apple-darwin20.1.0
Thread model: posix
InstalledDir: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin


	  ** "sudo rm -rf /Library/Developer/CommandLineTools" deleted 
"CommandLineTools".  Then "sudo xcode-select ?install" gave me "invalid 
argument '?install'".  "sudo xcode-select ?install" gave me the same.


	  ** Fortunately, I was able to update Xcode from App Store.  Now I get:


$ clang --version
Apple clang version 12.0.0 (clang-1200.0.32.27)
Target: x86_64-apple-darwin20.1.0
Thread model: posix
InstalledDir: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin


	  If you also have a problem with "sudo xcode-select ?install", you 
might try the App Store.


	  Thanks, Spencer
On 2020-12-02 08:18, Gilberto Camara wrote:
#
sudo xcode-select --install

el
On 2020-12-02 18:52 , Spencer Graves wrote:

  
    
#
Sorry:  Typo:  I tried "sudo xcode-select --install" and got the same 
error.  This was in Terminal where "The default interactive shell is now 
zsh."  It's not critical, because "I was able to update Xcode from App 
Store."


	  Thanks for the reply.  sg
On 2020-12-02 11:48, Dr Eberhard W Lisse wrote:
#
Are you chasing a red herring here? Switching tools won help you - in fact they cause more issues since you'd need R-devel version of R to avoid breakage with the most recent tools or extra flags. I'm not sure which issue you are trying to solve. For gdal et al - make sure you install the latest version for CRAN - it is compatible with BigSur, older versions (before BigSur) were not.

Please start a new thread about questions unrelated to the original post as it's unclear if there are any open questions in the thread. Also please only answer if your have anything useful to say - if someone asks a question about the GUI it's rather pointless to post when you say you don't use it ... And if you ask a question, please be specific so we can help.

There is a lot of misinformation around, so be careful with random suggestions, they are very often plain wrong.

Cheers,
Simon
#
Dear Simon 

Unfortunately, the problems reported are real. The rgdal version from CRAN fails to recognise images in JPEG2000 format used by Copernicus Sentinel-2 satellite. I have investigated the matter carefully with Roger Bivand. 

I tried many combinations on Mac OS Big Sur: 
(a) rgdal from CRAN (binary) + GDAL from homebrew.
(b) rgdal from CRAN (source) + GDAL from homebrew.
(c) rgdal from CRAN (binary) + GDAL Mac OS Frameworks from https://www.kyngchaos.com/software/frameworks/
(d) rgdal from CRAN (source) + GDAL from kyngchaos. 
(e) rgdal from CRAN (source) + GDAL/GEOS/etc (source) with Apple clang 11.0
(f) rgdal from CRAN (source) + GDAL/GEOS/etc (source) with Apple clang 12.0

Only option (f) works correctly. 

Best regards
Gilberto
#
Gilberto,

can you provide details, please? (code, file to test etc.) The claim was that this is specific to BigSur which I doubt from your description. Please start a new thread about that at it seem entirely unrelated to the discussion at hand. There was an incompatibility with BigSur, but that was addressed.

Thanks,
Simon
#
Dear Simon, 

To test the error, please do the following on a Mac with Big Sur:

1. Install GDAL
   The available binaries I could find out are Mac OS Frameworks from https://www.kyngchaos.com/software/frameworks/ and ?homebrew?.

2. Install rgdal binary from CRAN
I am using R version 4.0.3 Patched (2020-11-25 r79505) and the rgdal version is 1.5-18 (SVN revision 1082), the latest ones available on CRAN.

3. Do the following R commands:
character(0)

The response indicates that the JPEG2000 driver is not installed.

After installing both GDAL and rgdal from source with Apple clang 12.0, we get
?JP2OpenJPEG"

More details on the rgdal version compiled from source with the new GDAL:
Loading required package: sp
rgdal: version: 1.5-18, (SVN revision 1082)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 3.2.0, released 2020/10/26
Path to GDAL shared files: /Users/gilbertocamara/Library/R/4.0/library/sf/gdal
GDAL binary built with GEOS: TRUE 
Loaded PROJ runtime: Rel. 7.1.1, September 1st, 2020, [PJ_VERSION: 711]
Path to PROJ shared files: /Users/gilbertocamara/Library/Application Support/proj:/usr/local/share/proj:/usr/local/share/proj
PROJ CDN enabled: FALSE
Linking to sp version:1.4-4

Hope this helps
Gilberto
#
Thank you very much for the interest shown by everyone who has sent their answers.

I think I have not explained well the issue. Now, there it goes (I hope better explained!):

I have a 16-inch MacBook Pro (2019), I have installed the Big Sur 11.0.1 operating system, I have installed the R 4.0.3 and the R GUI 1.73.
The R works fine, I think it is a problem with the R GUI.
When I open a session in R, I get the following warning:

2020-12-03 11: 34: 43.708 R [2479: 145386] Warning: Expected min height of view: (<NSPopoverTouchBarItemButton: 0x7fb0d3e23aa0>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.

And from that moment, the management of the windows in R and the computer slows down.
Also, every time I open a new file in R (in the same session), the warning appears again.

One of the messages I received on this mailing list said that it could be a problem related to the TouchBar of the MacBook Pro.
I have tested the same R and R GUI on a MacBook Air (Retina, 13-inch, 2020) with Big Sur, and, indeed, that problem does not appear.

I know that in Terminal and RStudio there is no problem, but I would like to solve this issue, since I prefer to work with R and the R GUI in a Mac, instead of Terminal or RStudio.

Thank you very much for your attention.

Sincerely,
Mar?a-?ngeles Casares-de-Cal
#
I can confirm the warning message on a 2020 macbook-pro-13-inch with Big Sur.

I do not know about slowdowns, because I seldom work in R.app, and when I do, it?s just for a few moments at a time.  I do not see the warning when I run R in a terminal, in vim, or in RStudio, which makes sense because the warning seems to be related to the GUI that R.app is employing.
#
Gilberto,

well, that one is easy and has nothing to do with tools nor with BigSur - no one asked for OpenJPEG support so that's why OpenJPEG is not included on the build machine. There are several dozen of optional features in GDAL and I have no idea which are useful, which are not and which are legacy, so it's up to the rgdal maintainers or users to signal if there is anything useful missing. Given the complexity of GDAL dependencies and corresponding continuous build issues I'm relying on them to tell me when it's safe to update/change settings. Simply adding the OpenJPEG library seems sufficient:
[1] "JP2OpenJPEG"

so that is now available in the CRAN binary.

Cheers,
Simon
4 days later
#
Dear Simon 

Apologies for the late response. Thank you so much for including the OpenJPEG driver in rgdal. For your information, JPEG2000 is the data format chosen by the European Space Agency (ESA) to distribute the images of the Sentinel-2 and Sentinel-2A satellites. Data from these satellites is one of the major source of information about the Earth?s land surfaces.

Thanks and best regards
Gilberto
===========================
Prof Dr Gilberto Camara
Secretariat Director
GEO - Group on Earth Observations
www.earthobservations.org
5 days later
#
Aloha.

For the past few weeks, maybe 6 or more, I've been getting strange 
results from the summary() function for data.frames.? Has anyone else 
noticed something like this?? I don't think I've done anything to cause 
this but cannot find anything to attribute it to.? Example below.? It 
lists every row as a value in the data frame attribute DAUCO.? Similar 
behavior found with other read.table results using syntax below.


PRISM??????? = 
read.table(PRISM_INPUT,header=TRUE,stringsAsFactors=TRUE,sep=',',
colClasses=c('character','numeric','numeric','numeric','numeric','numeric'))

P2 is a subset of PRISM.



J.
#
please send to the list the output from both:

dput(head(P2))

utils::sessionInfo()

This is the Macintosh list.  Is this specifically a Macintosh problem?



On Sun, Dec 13, 2020 at 6:32 PM John Helly via R-SIG-Mac <
r-sig-mac at r-project.org> wrote:

            
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20201213/b164a3f0/attachment-0001.html>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fpnbnlakmnhmpblc.png
Type: image/png
Size: 37168 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20201213/b164a3f0/attachment-0001.png>
#
Aloha.

Don't know if this is uniquely a Mac issue or not.? I will try to test 
on a Linux distro later today.? \\\

In the meantime, here's the additional info.? Thanks for the responses.? 
I created a test subset of the input data so it is just the first DAUCO 
value subset (i.e., 00125).

In looking at the output of utils, perhaps there is some kind of 
inter-library conflict for summary? ? Don't know how to look for 
multiple function names (yet).

J.


* ====================================== R code and output 
================================

PRISM??????? = read.table(PRISM_INPUT,header=TRUE, sep=',',
colClasses=c('character','numeric','numeric','numeric','numeric','numeric'))
...

 > dput(head(PRISM))
structure(list(DAUCO = c("00125", "00125", "00125", "00125",
"00125", "00125"), Longitude = c(-121.416666667, -121.375, -121.333333333,
-121.291666667, -121.25, -121.208333333), Latitude = c(41.9583333334,
41.9583333334, 41.9583333334, 41.9583333334, 41.9583333334, 41.9583333334
), Precipitation = c(63.1469993591, 63.6969985962, 65.7460021973,
69.4150009155, 74.0780029297, 80.4290008545), Year = c(1895,
1895, 1895, 1895, 1895, 1895), Month = c(1, 1, 1, 1, 1, 1)), row.names = 
c(NA,
6L), class = "data.frame")
 >


 > utils::sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7

Matrix products: default
BLAS: 
/Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
LAPACK: 
/Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats???? graphics? grDevices utils???? datasets? methods base

other attached packages:
[1] reshape_0.8.8 plyr_1.8.6??? ggplot2_3.3.2

loaded via a namespace (and not attached):
 ?[1] Rcpp_1.0.4.6????????? pillar_1.4.4 DEoptimR_1.0-8??????? 
compiler_4.0.3??????? RColorBrewer_1.1-2
 ?[6] iterators_1.0.12????? digest_0.6.25 lifecycle_0.2.0?????? 
tibble_3.0.1????????? gtable_0.3.0
[11] nlme_3.1-149????????? lattice_0.20-41 pkgconfig_2.0.3?????? 
rlang_0.4.6?????????? foreach_1.5.0
[16] Matrix_1.2-18???????? parallel_4.0.3 ergm_3.10.4?????????? 
coda_0.19-3?????????? withr_2.2.0
[21] dplyr_1.0.0?????????? generics_0.0.2 vctrs_0.3.1?????????? 
networkDynamic_0.10.1 trust_0.1-8
[26] grid_4.0.3??????????? tidyselect_1.1.0 deSolve_1.28????????? 
robustbase_0.93-6???? glue_1.4.1
[31] R6_2.4.1????????????? farver_2.0.3 purrr_0.3.4?????????? 
magrittr_1.5????????? codetools_0.2-16
[36] scales_1.1.1????????? ellipsis_0.3.1 MASS_7.3-53?????????? 
lpSolve_5.6.15??????? colorspace_1.4-1
[41] ape_5.4?????????????? labeling_0.3 network_1.16.0??????? 
lazyeval_0.2.2??????? doParallel_1.0.15
[46] EpiModel_1.8.0??????? munsell_0.5.0 tergm_3.6.1?????????? 
statnet.common_4.3.0? crayon_1.3.4
 >
On 12/13/20 18:22, Richard M. Heiberger wrote:

  
    
#
Not likely Mac at all. In a reasonably clean session (on a Mac), I see
+ "00125", "00125"), Longitude = c(-121.416666667, -121.375, -121.333333333,
+ -121.291666667, -121.25, -121.208333333), Latitude = c(41.9583333334,
+ 41.9583333334, 41.9583333334, 41.9583333334, 41.9583333334, 41.9583333334
+ ), Precipitation = c(63.1469993591, 63.6969985962, 65.7460021973,
+ 69.4150009155, 74.0780029297, 80.4290008545), Year = c(1895,
+ 1895, 1895, 1895, 1895, 1895), Month = c(1, 1, 1, 1, 1, 1)), row.names = c(NA,
+ 6L), class = "data.frame")
DAUCO             Longitude         Latitude     Precipitation  
 Length:6           Min.   :-121.4   Min.   :41.96   Min.   :63.15  
 Class :character   1st Qu.:-121.4   1st Qu.:41.96   1st Qu.:64.21  
 Mode  :character   Median :-121.3   Median :41.96   Median :67.58  
                    Mean   :-121.3   Mean   :41.96   Mean   :69.42  
                    3rd Qu.:-121.3   3rd Qu.:41.96   3rd Qu.:72.91  
                    Max.   :-121.2   Max.   :41.96   Max.   :80.43  
      Year          Month  
 Min.   :1895   Min.   :1  
 1st Qu.:1895   1st Qu.:1  
 Median :1895   Median :1  
 Mean   :1895   Mean   :1  
 3rd Qu.:1895   3rd Qu.:1  
 Max.   :1895   Max.   :1  

So do check that summary.data.frame in your setup is the original in namespace:base, and also that you don't have something defining a summary method for character vectors e.g. a summary.character function, but I suppose there could be a S4 method as well. 

-pd