[R-SIG-Mac] FLIBS for binary R installations (was library 'quadmath' not found)
This is only about use of CRAN binary installations of R, and specifically the arm64 build of R 4.4.0. It is rather technical ... but with a simple take-home message at the end. Because CRAN binary distributions contain copies of the Fortran runtime libraries there are a number of other possibilities. The distributed etc/Makeconf contains FLIBS = -L/opt/gfortran/lib/gcc/aarch64-apple-darwin20.0/12.2.0 -L/opt/gfortran/lib -lgfortran -lemutls_w -lquadmath (Only the arm64 version contains -lemutls_w: it is a static library so only needed when compiling Fortran code, and probably only Fortran code using OpenMP and that has to be linked by gfortran and so does not use FLIBS.) https://cran.r-project.org/doc/manuals/r-devel/R-admin.html#macOS-packages and https://cran.r-project.org/doc/manuals/r-devel/R-admin.html#macOS-packages describe how to override this, either personally (via ~/.R/Makevars) or for all users (set R_MAKEVARS_SITE). FLIBS is used when installing a package that contains Fortran source code or links to Fortran libraries, most prominently BLAS and LAPACK libraries. The way linking works is rather different on macOS from other platforms. Scenarios = a) If you want to compile a package from sources containing Fortran code, you will need the recommended Fortran compiler and installing that will match the FLIBS in the distribution. It will also work to use FLIBS = -L/Library/Frameworks/R.framework/Resources/lib -lgfortran -lquadmath NB: a large majority of the Fortran-using packages do not make any calls to the Fortran runtime libraries, so any setting of FLIBS including empty will work provided it does not refer to non-existent paths. If you use a different compiler (such as those for gfortran 13 or 14 mentioned in the manual), you will need to set FLIBS appropriately but the above will probably do. b) Compiling a package from source which calls BLAS or LAPACK but not Fortran will need to find the Fortran runtime libraries. As the distributed BLAS and LAPACK libraries are already built against those included with R and hardcode their paths, you could also use FLIBS = c) Installing a CRAN binary package that uses Fortran source code. This will have a .so linked against the Fortran libraries from the CRAN binary R, e.g. auk2% otool -L Hmisc/libs/Hmisc.so Hmisc/libs/Hmisc.so: Hmisc.so (compatibility version 0.0.0, current version 0.0.0) /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libgfortran.5.dylib (compatibility version 6.0.0, current version 6.0.0) /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libquadmath.0.dylib (compatibility version 1.0.0, current version 1.0.0) /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libR.dylib (compatibility version 4.4.0, current version 4.4.0) So FLIBS is not used. (Actually Hmisc is one of the many packages with no calls to the Fortran runtime libraries.) Ditto for a binary package which calls BLAS or LAPACK. This may not be the case for binary packages from other repositories. d) A very few packages compile a Fortran executable (cepreader, x13binary, INLA). As these are linked by gfortran, FLIBS is not used, but the CRAN binary package for cepreader is linked against the paths in the gfortran distribution so that is required. For x13binary the R-provided libs are used whereas INLA ships its own copies (but has missed one). It seems that life for those using binary builds would be simpler if their etc/Makeconf contained FLIBS = -L/Library/Frameworks/R.framework/Resources/lib -lgfortran -lquadmath Until that is done, I recommend creating a ~/.R/Makevars file containing that line. On 23/05/2024 17:03, Prof Brian Ripley via R-SIG-Mac wrote: On 23/05/2024 16:00, Petar Milin wrote: I have recently updated my R (4.4.0) and all the packages running on Sonoma (14.5) with Intel. When I try to install from GitHub with: install_github("zdk123/SpiecEasi") I get the error message: ld: warning: search path '/opt/gfortran/lib/gcc/x86_64-apple-darwin20.0/12.2.0' not found ld: warning: search path '/opt/gfortran/lib' not found is the important message. ld: library 'quadmath' not found clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [SpiecEasi.so] Error 1 ERROR: compilation failed for package ‘SpiecEasi’ I did xcode-select –install but that was done already. I also installed gfortran-4.2.3.pkg but that did not help either. Please remove it via pkgutils: it is way too old. Can anyone advise, please? Please read the R-admin manual. To install a package using Fortran from sources you need to install https://mac.r-project.org/tools/gfortran-12.2-universal.pkg, also indicated via the tools page linked from https://cran.r-project.org/bin/macosx/ -- Brian D. Ripley, rip...@stats.ox.ac.uk Emeritus Professor
Re: [R-SIG-Mac] library 'quadmath' not found
On 23/05/2024 16:00, Petar Milin wrote: I have recently updated my R (4.4.0) and all the packages running on Sonoma (14.5) with Intel. When I try to install from GitHub with: install_github("zdk123/SpiecEasi") I get the error message: ld: warning: search path '/opt/gfortran/lib/gcc/x86_64-apple-darwin20.0/12.2.0' not found ld: warning: search path '/opt/gfortran/lib' not found is the important message. ld: library 'quadmath' not found clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [SpiecEasi.so] Error 1 ERROR: compilation failed for package ‘SpiecEasi’ I did xcode-select –install but that was done already. I also installed gfortran-4.2.3.pkg but that did not help either. Please remove it via pkgutils: it is way too old. Can anyone advise, please? Please read the R-admin manual. To install a package using Fortran from sources you need to install https://mac.r-project.org/tools/gfortran-12.2-universal.pkg, also indicated via the tools page linked from https://cran.r-project.org/bin/macosx/ -- Brian D. Ripley, rip...@stats.ox.ac.uk Emeritus Professor of Applied Statistics, University of Oxford ___ R-SIG-Mac mailing list R-SIG-Mac@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Re: [R-SIG-Mac] How to correct tcltk path?
On 04/04/2024 17:46, Kasper Daniel Hansen wrote: You need to install XQuartz. This is IMO stated somewhat clearly at https://cran.r-project.org/bin/macosx/ ("somewhat", because - as always - it seems pretty clear when you know what its trying to say) And definitely clear in the R-admin manual: "Various parts of the build require XQuartz to be installed: see https://www.xquartz.org/releases/.20 These include the tcltk package and the X11 graphics device: attempting to use these without XQuartz will remind you." Without the actual messages, I cannot check if that corresponds to what the OP saw. But it probably was from message("tcltk DLL is linked to ", shQuote(this)) stop("X11 library is missing: install XQuartz from www.xquartz.org", and he omitted the second line Kasper On Thu, Apr 4, 2024 at 9:13 AM Gregory via R-SIG-Mac < r-sig-mac@r-project.org> wrote: Hello, I'm having an issue with R looking for tcltk in the wrong place. Whenever I start R, I get a message: tcltk DLL is linked to '/opt/X11/lib/libX11.6.dylib'. However, there is no /opt/X11 on my system and tcltk is really in /opt/R/arm64, where the R binary installer put it. Where is R getting the /opt/X11 path and how do I correct that? So far I've tried exporting DYLD_LIBRARY_PATH=opt/R/arm64:$DYLD_LIBRARY_PATH to my environment in my zprofile, but that hasn't worked. Possibly relevant details: M2 MacBook Pro, MacOS Sonoma 14.4.1 R.version 4.3.3 installed with binary installer from CRAN. Thanks in advance, Gregory Sent with [Proton Mail](https://proton.me/) secure email. [[alternative HTML version deleted]] ___ R-SIG-Mac mailing list R-SIG-Mac@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-mac -- Brian D. Ripley, rip...@stats.ox.ac.uk Emeritus Professor of Applied Statistics, University of Oxford ___ R-SIG-Mac mailing list R-SIG-Mac@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Re: [R-SIG-Mac] Graphics in R, version 4.3.2, does not work well in MacOS
You need to make clear what graphics device and R build you used: the default on a CRAN build of macOS is quartz(), which has nothing to do with XQuartz. But is this a CRAN build? AFAIK quartz() is not the default device in RStudio. And also give the information (sessionInfo()) requested in the posting guide. As Christophe Dutang has posted, this works for him on arm64 macOS (and also for me). CRAN provides both Intel and arm64 builds As the posting guide also asks, you should try R-patched: binary installers are available at https://mac.r-project.org/ for both architectures. The macOS GUI is usually called R.app (see e.g. the R-admin manual). RGUI is for Windows. On 16/02/2024 09:25, María de los Ángeles Casares de Cal via R-SIG-Mac wrote: Dear Simon and anyone else who might be interested in this: I have studied in more detail the problem referred to in the message below, and can confirm that R does not work well on macOS when I do graphics (plots). I have only tested with the "abline” command, using the examples that are in R’s help. And it does not work. I have tested it on several computers, in Terminal and with RGUI. I have also checked it in RStudio in macOS (it does work) and with R in Windows (it does work). What I have done is the following: In the "abline" command help, the first example is: ## Setup up coordinate system (with x == y aspect ratio): plot(c(-2,3), c(-1,5), type = "n", xlab = "x", ylab = "y", asp = 1) ## the x- and y-axis, and an integer grid abline(h = 0, v = 0, col = "gray60") text(1,0, "abline( h = 0 )", col = "gray60", adj = c(0, -.1)) abline(h = -1:5, v = -2:3, col = "lightgray", lty = 3) abline(a = 1, b = 2, col = 2) text(1,3, "abline( 1, 2 )", col = 2, adj = c(-.1, -.1)) if I run line by line, R does not do the plots (only open the Quartz window). If I run all together, R does the plots sometimes yes and sometimes no. I have the latest stable version of XQuartz (2.8.5) What could be the problem? Thank you in advance. Best regards. María-Ángeles Casares-de-Cal Inicio del mensaje reenviado: De: María de los Ángeles Casares de Cal Asunto: Spanish version of R, version 4.3.2, does not work Fecha: 14 de febrero de 2024, 20:29:09 CET Para: r-sig-mac@r-project.org Hi everyone, I have a problem since I have installed the last version of R 4.3.2 (spanish version) R does not work! For example: x <- 1:20#this is ok y <- 10 + rnorm(n=20,mean=0,sd=1)#this is ok plot(x,y,pch=20,col="red")#this is ok, but I have to run some times this model <- lm(y~x)#this is ok summary(model) #this is ok abline(model) #R does not plot the regression line in the window where I have the points. (And this code in RStudio works well). (I have installed the last version of XQuartz.) I do not know what is the problem. Perhaps, because is the Spanish version? How can I install the English version? Any help? Thank you in advance. Best regards. María-Ángeles Casares-de-Cal [[alternative HTML version deleted]] ___ R-SIG-Mac mailing list R-SIG-Mac@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-mac -- Brian D. Ripley, rip...@stats.ox.ac.uk Emeritus Professor of Applied Statistics, University of Oxford ___ R-SIG-Mac mailing list R-SIG-Mac@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-mac