Closed mdg583 closed 1 year ago
Why are you using the R 3.6 package library for R 4.0.5? Packages installed for R 3.6 might not work on R 4.0.5. I am not saying that this matter here, but it does look weird....
Installing the latest processx on a clean Fedora 34, using the default R and gcc works for me. Did you customize your compiler, your R installation or your system?
I don't know when I set the "R_LIBS_USER" in the Rprofile, but I believe those packages were updated along with R. I just removed the Rprofile file so that it is installing the packages again, and have a very similar error:
> install.packages("processx")
Installing package into ‘/home/matt/R/x86_64-redhat-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependency ‘ps’
trying URL 'https://cran.rstudio.com/src/contrib/ps_1.7.5.tar.gz'
Content type 'application/x-gzip' length 129213 bytes (126 KB)
==================================================
downloaded 126 KB
trying URL 'https://cran.rstudio.com/src/contrib/processx_3.8.1.tar.gz'
Content type 'application/x-gzip' length 164170 bytes (160 KB)
==================================================
downloaded 160 KB
* installing *source* package ‘ps’ ...
** package ‘ps’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -m64 -g -O2 -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wall px.c -o px
/usr/bin/ld: /tmp/ccMBbGp2.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
collect2: error: ld returned 1 exit status
make: *** [Makevars:11: px] Error 1
ERROR: compilation failed for package ‘ps’
* removing ‘/home/matt/R/x86_64-redhat-linux-gnu-library/4.0/ps’
Warning in install.packages :
installation of package ‘ps’ had non-zero exit status
ERROR: dependency ‘ps’ is not available for package ‘processx’
* removing ‘/home/matt/R/x86_64-redhat-linux-gnu-library/4.0/processx’
Warning in install.packages :
installation of package ‘processx’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpTObj1G/downloaded_packages’
I've tried uninstalling and re-installing R from a package and currently have installed these:
R x86_64 4.0.5-2.fc34 updates 9.6 k
R-core x86_64 4.0.5-2.fc34 updates 57 M
I did have a version of R installed in ~/.local, which I have uninstalled in case it was causing issues, but it hasn't solved it. I don't intend to have customized the compiler or R installation on the system.
(I accidentally closed this issue because I thought I had found the problem, but now re-opened it)
My compilation output is very different. Do you have anything in ~/.R/Makevars
? What is the output of gcc --version
? I get
[root@3f8c9e1033a3 /]# gcc --version
gcc (GCC) 11.3.1 20220421 (Red Hat 11.3.1-2)
Here are Makevars and gcc version:
[matt@matt-server ~]$ more ~/.R/Makevars
CFLAGS = -g -O2
CXXFLAGS = -g -O2
[matt@matt-server ~]$ gcc --version
gcc (GCC) 11.3.1 20220421 (Red Hat 11.3.1-2)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I renamed ~/.R
to ~/.R.old
, and now it seems to be working. I'm not sure how it may have caused an issue?
You have overwritten the default flags. Which actually already contain -O2
and -g
:
[root@3f8c9e1033a3 ~]# R CMD config CFLAGS
-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
If you want to add extra flags, you need to use +=
instead of =
:
CFLAGS += -g -O2
Ah thanks.
I am running RStudio 2023.03.0 and R 4.0.5 on Fedora 34. I am unable to install processx due to a compiler error:
My .Rprofile sets the R_LIBS_USER variable:
My session info is like this: