Lubridate 1.7.0 will not install or update on Red Hat Enterprise Linux 6 (version 1.6.0 was previously installed and working):
install.packages("lubridate")
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
trying URL 'https://mirror.las.iastate.edu/CRAN/src/contrib/lubridate_1.7.0.tar.gz'Content type 'application/x-gzip' length 398375 bytes (389 KB)
downloaded 389 KB
The downloaded source packages are in
‘/tmp/RtmpZAQIGJ/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("lubridate") :
installation of package ‘lubridate’ had non-zero exit status
Well, I guess it's an outdated gcc compiler which is to blame. We need C++11 as CCTZ requires that. So the obvious options are
devtools::install_version("lubridate", "1.6.0")
. Not recommended as there a couple of severe bugs there.devtools::install_github("tidyverse/lubridate@before-CCTZ")
Please let me know if any of the above worked for you.
Sorry about this but there is no way I am going back on CCTZ. It would be close to imposible to improve on time-zone manipulation and date-time updates without it.
Aha, another issue that can be blamed on RHEL 6's outdated set of system tools (it is gcc version 4.4.7). I'll see if I can update gcc; otherwise, I'll roll back to 1.6.0. Thanks for the help!
@arnonerba : How did you update system tools? I do not have root permission and I need to update gcc. Will RHEL ever get with the program ???? frustrating
Thanks in advance.
@c2b2pss Unfortunately, I couldn't find a good solution to update gcc on RHEL 6 so I just rolled back lubridate. I doubt RHEL 6 will get a newer version of gcc, but RHEL 7 and CentOS 7 both include updated development tools.
I was able to download and compile a newer version of gcc on Centos 6. After adding these lines to the ~/.R/Makevars file:
CC=/opt/gcc_4.9.1/rtf/bin/gcc -std=gnu99
CXX1X=/opt/gcc_4.9.1/rtf/bin/g++
It successfully compiled using the newer version - unfortunately R doesn't correctly load the library:
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/opt/R/R-3.3.3/library/lubridate/libs/lubridate.so':
/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by /opt/R/R-3.3.3/library/lubridate/libs/lubridate.so)
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/opt/R/R-3.3.3/library/lubridate’
And changing the LD_LIBRARY_PATH:
$ LD_LIBRARY_PATH="/opt/gcc_4.9.1/rtf/lib64/:$LD_LIBRARY_PATH"
(which I kind of don't want to do - would rather have something in the Makevars file) doesn't work either, though I do get a new error:
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/opt/R/R-3.3.3/library/lubridate/libs/lubridate.so':
/opt/R/R-3.3.3/library/lubridate/libs/lubridate.so: undefined symbol: _ZN4cctz14load_time_zoneERKSsPNS_9time_zoneE
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/opt/R/R-3.3.3/library/lubridate’
I don't suppose there would be an easy fix for this?
That symbol comes from the CCTZ library which suggests that linker couldn't find it in the lubridate.so archive. So either something went wrong during the compilation or linker looks at a wrong file. I occasionally see such errors during the development due to stale object files but restarting the session and re-installing from scratch always helps.
Regarding LD_LIBRARY_PATH you might be able to set it in .Renvioron file.
Hmm. I added the additional path to LD_LIBRARY_PATH
in /opt/R/R-3.3.3/etc/ldpaths
and that does get rid of the GLIBC error, but not the undefined symbol: _ZN4cctz14load_time_zoneERKSsPNS_9time_zoneE
gcc 4.9.1 should be a late enough version to be able to compile this, right?
yes. 4.9.1 should be just fine. It's the linker problem, it somehow misses the symbol in the archive or R picks wrong archive. This is what I see on my machine:
~$ locate lubridate.so
/home/vspinu/.lib/R/lubridate/libs/lubridate.so
/store/Dropbox/dev/lubridate/src/lubridate.so
~$ nm -gC /store/Dropbox/dev/lubridate/src/lubridate.so | grep load_time_zone
0000000000020720 T cctz::load_time_zone(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cctz::time_zone*)
~$ nm -g /store/Dropbox/dev/lubridate/src/lubridate.so | grep load_time_zone
0000000000020720 T _ZN4cctz14load_time_zoneERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_9time_zoneE
Any solution for undefined symbol: _ZNK4cctz9time_zone6lookupERKNS_6detail10civil_timeINS1_10second_tagEEE
on RHEL 6 so far?
Most helpful comment
Well, I guess it's an outdated gcc compiler which is to blame. We need C++11 as CCTZ requires that. So the obvious options are
devtools::install_version("lubridate", "1.6.0")
. Not recommended as there a couple of severe bugs there.devtools::install_github("tidyverse/lubridate@before-CCTZ")
Please let me know if any of the above worked for you.
Sorry about this but there is no way I am going back on CCTZ. It would be close to imposible to improve on time-zone manipulation and date-time updates without it.