Closed baderstine closed 3 years ago
What do you get in the shell when you do
which gcc
gcc --version
I suspect you have an outdated compiler. A workaround would be to install:
sudo yum install libgit2-devel
And then in R:
Sys.setenv(USE_SYSTEM_LIBGIT2=1)
install.packages("gert")
I did try sudo yum install libgit2-devel
already.
which gcc
/usr/bin/gcc
gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
Copyright (C) 2015 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.
and
ld --version
GNU ld version 2.25.1-32.base.el7_4.1
Copyright (C) 2014 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
Are you tied to an old subrelease of centos 7? In my centos 7.9 container I see:
[root@906e90a43fa5 ~]# ld --version
GNU ld version 2.27-44.base.el7
Copyright (C) 2016 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
[root@906e90a43fa5 ~]# gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Copyright (C) 2015 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.
So I think you can solve the problem either by updating to CentOS 7.9, or using the USE_SYSTEM_LIBGIT2
workaround above.
After trying Sys.setenv(USE_SYSTEM_LIBGIT2=1)
in R
install.packages now has a different error:
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘gert’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/opt/R/4.0.4/lib/R/library/00LOCK-gert/00new/gert/libs/gert.so':
/lib64/libgit2.so.26: undefined symbol: libssh2_userauth_publickey_frommemory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/opt/R/4.0.4/lib/R/library/gert’
updated to gcc 4.8.5 20150623 (Red Hat 4.8.5-44). That alone did not work. After upgrading, your workaround also did not work (same dyn.load error as my previous comment).
So I ran sudo yum install binutils
which updated ld
to the newer version, and after that the normal install.packages("gert")
worked just fine.
Somehow I figured that out from the comments about binutils this post: https://stackoverflow.com/questions/52737698/unable-to-compile-unrecognized-relocation-0x2a-in-section-text
Thanks for the update. There must have been some bugfix in binutils at some point between the 2014 and 2016 version 🤷 . Glad you got it fixed.
updated to gcc 4.8.5 20150623 (Red Hat 4.8.5-44). That alone did not work. After upgrading, your workaround also did not work (same dyn.load error as my previous comment).
So I ran
sudo yum install binutils
which updatedld
to the newer version, and after that the normalinstall.packages("gert")
worked just fine.Somehow I figured that out from the comments about binutils this post: https://stackoverflow.com/questions/61646933/how-to-update-to-specific-r-version-on-linux-red-hat-centos-keeping-the-previ
That's work for me, thanks!
Clearly there's some error here, which seems to be a problem related to
libgit2
:...but I have no idea what to do about it. "gert" is required by "usethis" which is required by "devtools", so I cannot install devtools which is what I ultimately am trying to do.