Opened 2 years ago
Closed 2 years ago
#66332 closed defect (fixed)
R @4.2.2_1: error when trying to install.packages possibly due to port/rpath configuration
Reported by: | MarcKaufmann (Marc Kaufmann) | Owned by: | i0ntempest |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | kjellpk (Kjell Konis), i0ntempest | |
Port: | R |
Description
I installed the R port, where I had to follow instructions in ticket #66095, after which it worked. The first thing I did was try to install the tidyverse package, which failed due to the package fs not installing. Here is the part of the logs where it hits the error, full logs are attached:
CC src/unix/libuv_la-random-getentropy.lo CCLD libuv.la ld: warning: argument missing after -rpath ld: can't map file, errno=22 file '/opt/local/lib/libgcc' for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [libuv.la] Error 1 make: *** [libuv-1.38.1/.libs/libuv.a] Error 2 ERROR: compilation failed for package ‘fs’
I talked with someone on the R irc who said that this looked like an issue they hit (some years ago, I think) with MacPorts installation of R. They pointed me at the following Stackoverflow question: https://stackoverflow.com/questions/26783833/rstudio-server-doesnt-find-libraries-for-macports-r-when-building
I tried to export the environment variables for CPATH and CPLUS_INCLUDE_PATH, then run an interactive R session and install the package, but nothing changed. I do not know where to set the other variables mentioned in that StackOverflow post, nor if that's what's going on.
I understand that this may not be an issue with MacPorts, but it seems to be a configuration issue with paths, so it may be. Even if not, I'd appreciate some help on where to look next or whom to ask.
Attachments (1)
Change History (7)
Changed 2 years ago by MarcKaufmann (Marc Kaufmann)
Attachment: | R-failed-fs-installation.log added |
---|
comment:1 Changed 2 years ago by kencu (Ken)
mine works fine to install "fs", but if you notice, my -Wl,-rpath entry looks slightly different than yours, and yours seems to be missing a comma:
mine:
CC="/opt/local/bin/clang-mp-14" CFLAGS="-pipe -Os -arch x86_64 -I/opt/local/include -fPIC " AR="ar" RANLIB="ranlib" LDFLAGS="-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath,/opt/local/lib/libgcc -arch x86_64" ./configure --quiet)
yours
CC="/opt/local/bin/clang-mp-14" CFLAGS="-pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -fPIC " AR="ar" RANLIB="ranlib" LDFLAGS="-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath /opt/local/lib/libgcc -Wl,-rpath,/opt/local/lib/libgcc -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch arm64" ./configure --quiet)
I'm on High Sierra today.
comment:2 Changed 2 years ago by kencu (Ken)
CCLD libuv.la /opt/local/bin/clang++-mp-14 -std=gnu++14 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/opt/local/Library/Frameworks/R.framework/Resources/lib -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath,/opt/local/lib/libgcc -arch x86_64 -o fs.so dir.o error.o file.o fs.o getmode.o id.o init.o link.o path.o utils.o unix/getmode.o ./libuv-1.38.1/.libs/libuv.a -pthread -F/opt/local/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking. installing to /Users/cunningh/Library/R/x86_64/4.2/library/00LOCK-fs/00new/fs/libs ** R ** inst ** byte-compile and prepare package for lazy loading ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded from temporary location ** checking absolute paths in shared objects and dynamic libraries ** testing if installed package can be loaded from final location ** testing if installed package keeps a record of temporary installation path * DONE (fs)
comment:3 Changed 2 years ago by kencu (Ken)
now why you are missing the comma I am not currently sure about, but it appears to be in this file:
$ cat /opt/local/lib/pkgconfig/libR.pc rhome=/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources rlibdir=${rhome}/lib rincludedir=/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/include Name: libR Description: R as a library Version: 4.2.2 Libs: -fopenmp -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath,/opt/local/lib/libgcc -arch x86_64 -L${rlibdir} -lR Cflags: -I${rincludedir} -I${rincludedir} Libs.private:
so for a "right now" solution you might add it back there, if yours is missing it, while someone sorts out where it went.
comment:4 Changed 2 years ago by kencu (Ken)
Oh, I see it. It is here in the Portfile... this is wrong:
# See https://trac.macports.org/ticket/64204 for more info # Remove after gcc has been fixed for arm if {${os.arch} eq "arm"} { configure.ldflags-append -Wl,-rpath ${prefix}/lib/libgcc }
and it needs to be this (or maybe removed completely):
# See https://trac.macports.org/ticket/64204 for more info # Remove after gcc has been fixed for arm if {${os.arch} eq "arm"} { configure.ldflags-append -Wl,-rpath,${prefix}/lib/libgcc }
comment:5 Changed 2 years ago by MarcKaufmann (Marc Kaufmann)
Yes, that did the trick it seems. Although I had to edit the port file, and synching them removed the addition for issue #66095. Will I have to do that every time upon updating the package/port or will it be fixed in the next update?
Also for next time: is there something else I could have done to pinpoint the issue further? I guess you spotted it because you had a working version and could compare side by side.
Thanks for solving it so quickly, I really appreciate it.
comment:6 Changed 2 years ago by i0ntempest
Owner: | set to i0ntempest |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Logs of running install.packages("fs") in an interactive R session