Closed descostesn closed 3 years ago
It looks like the linking against Rhdf5lib fails. In the the g++ -std=gnu++11 ...
line there should be references to .../Rhdf5lib/lib/libhdf5.a
which is where that symbol is defined.
I guess this is really down to whatever is causing the throwing of the Rscript execution error: Not a directory
error.
What's the output if you run Rhdf5lib::pkgconfig("PKG_C_LIBS")
and packageVersion("Rhdf5lib")
?
Also, does running Rscript -e 'Rhdf5lib::pkgconfig("PKG_C_LIBS")'
in a terminal throw an error?
I get:
> Rhdf5lib::pkgconfig("PKG_C_LIBS")
"/home/descostes/R/x86_64-pc-linux-gnu-library/4.0/Rhdf5lib/lib/libhdf5.a" "/home/descostes/R/x86_64-pc-linux-gnu-library/4.0/Rhdf5lib/lib/libsz.a" -lz>
> packageVersion("Rhdf5lib")
[1] ‘1.10.1’
and
$ Rscript -e 'Rhdf5lib::pkgconfig("PKG_C_LIBS")'
Rscript execution error: Not a directory
So something is wrong with your Rscript
command. That should produce the same output as when you run the command in the R session.
Reading around (e.g. https://stackoverflow.com/questions/39832110/rscript-execution-error-no-such-file-or-directory) suggests maybe R was compiled/installed in one place, and then moved? Does that sound possible?
It sounds like Rscript has a hardcoded path to R that is set at installation time, and moving might break that relationship. Maybe running which Rscript
and which R
would also offer some insight?
I did a whole fresh install of R and still get the problem. This suggests that Rscript is not the problem to me:
descostes@PC-BIOINF-Nico:~$ Rscript
Usage: /path/to/Rscript [--options] [-e expr [-e expr2 ...] | file] [args]
--options accepted are
--help Print usage and exit
--version Print version and exit
--verbose Print information on progress
--default-packages=list
Where 'list' is a comma-separated set
of package names, or 'NULL'
or options to R, in addition to --no-echo --no-restore, such as
--save Do save workspace at the end of the session
--no-environ Don't read the site and user environment files
--no-site-file Don't read the site-wide Rprofile
--no-init-file Don't read the user R profile
--restore Do restore previously saved objects at startup
--vanilla Combine --no-save, --no-restore, --no-site-file
--no-init-file and --no-environ
'file' may contain spaces but not shell metacharacters
Expressions (one or more '-e <expr>') may be used *instead* of 'file'
See also ?Rscript from within R
However I still get:
$ Rscript -e 'Rhdf5lib::pkgconfig("PKG_C_LIBS")'
Rscript execution error: No such file or directory
which looks fine to me:
descostes@PC-BIOINF-Nico:~$ which R
/usr/local/bin/R
descostes@PC-BIOINF-Nico:~$ which Rscript
/usr/local/bin/Rscript
/usr/local/bin is in my PATH.
Reading more, it is indeed coming from Rscript (that print the manual even if there is a problem). For instance:
$Rscript -e 'rnorm(1)'
Rscript execution error: No such file or directory
Most of forums suggests to re-install R but I did it. If I find a solution I will put it here.
So I fixed the bug. My problem was that I had multiple versions of R, lots of conflicts, etc. For some reason, installing R from the source binary did not help so I went for the Ubuntu install.
I first cleaned everything doing:
sudo apt remove rbase
sudo apt remove rbase-dev
I then deleted every executable 'R' and 'Rscript" that I could find. I found everything in /usr/
but it could have been somewhere else.
cd
cd ../..
sudo find * -name R | xargs -I{} sudo rm -r {}
sudo find * -name Rscript | xargs -I{} sudo rm -r {}
In /etc/apt/sources.list
I added the line deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/
that I found on this page. This line may differ according to your version of Ubuntu. Then do:
sudo apt-get update
apt-cache show r-base
I selected the last version and did:
sudo apt-get install r-base=4.0.3-1.1804.0
sudo apt-get install r-base-dev=4.0.3-1.1804.0
I then changed the RHOME variable in the .bashrc:
~$ which R
/usr/bin/R
# Added the line below in the .bashrc. Note that bin/R is automatically added to the variable.
RHOME="/usr/"
I was then able to install the package. What helped me was to use the --verbose
option below to realize that Rscript was not pointing to the right location:
Rscript -e 'rnorm(1)' --verbose
Great to you know that fixed this, and thanks for the detailed description of how you solved it.
Hi,
I am on ubuntu 18.04.4 LTS and using R 4.0.0. When trying to install the package I get:
Here is my session info:
Thank you for your help.
Nicolas