Lubridate: Issues during installation on RHEL 6

Created on 1 Nov 2017  Â·  9Comments  Â·  Source: tidyverse/lubridate

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

  • installing source package ‘lubridate’ ...
    * package ‘lubridate’ successfully unpacked and MD5 sums checked
    *
    libs
    g++ -m64 -std=gnu++0x -I/usr/include/R -DNDEBUG -I. -I./cctz/include/ -I./cctz/src/ -I"/usr/lib64/R/library/Rcpp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c RcppExports.cpp -o RcppExports.o
    gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I. -I./cctz/include/ -I./cctz/src/ -I"/usr/lib64/R/library/Rcpp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC -c datetime.c -o datetime.o
    gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I. -I./cctz/include/ -I./cctz/src/ -I"/usr/lib64/R/library/Rcpp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC -c period.c -o period.o
    gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I. -I./cctz/include/ -I./cctz/src/ -I"/usr/lib64/R/library/Rcpp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC -c tparse.c -o tparse.o
    tparse.c: In function ‘C_parse_dt’:
    tparse.c:62: warning: ‘oYEAR’ may be used uninitialized in this function
    tparse.c:62: warning: ‘oMONTH’ may be used uninitialized in this function
    tparse.c:62: warning: ‘oDAY’ may be used uninitialized in this function
    tparse.c:62: warning: ‘oHOUR’ may be used uninitialized in this function
    tparse.c:62: warning: ‘oMIN’ may be used uninitialized in this function
    tparse.c:290: warning: ‘is_leap’ may be used uninitialized in this function
    g++ -m64 -std=gnu++0x -I/usr/include/R -DNDEBUG -I. -I./cctz/include/ -I./cctz/src/ -I"/usr/lib64/R/library/Rcpp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c update.cpp -o update.o
    In file included from ./cctz/include/civil_time.h:18,
    from update.cpp:2:
    ./cctz/include/civil_time_detail.h:37: error: expected nested-name-specifier before ‘year_t’
    ./cctz/include/civil_time_detail.h:37: error: ‘year_t’ has not been declared
    ./cctz/include/civil_time_detail.h:37: error: expected ‘;’ before ‘=’ token
    ./cctz/include/civil_time_detail.h:37: error: expected unqualified-id before ‘=’ token
    ./cctz/include/civil_time_detail.h:41: error: expected nested-name-specifier before ‘diff_t’
    ./cctz/include/civil_time_detail.h:41: error: ‘diff_t’ has not been declared
    ./cctz/include/civil_time_detail.h:41: error: expected ‘;’ before ‘=’ token
    ./cctz/include/civil_time_detail.h:41: error: expected unqualified-id before ‘=’ token
    ./cctz/include/civil_time_detail.h:46: error: expected nested-name-specifier before ‘month_t’
    ./cctz/include/civil_time_detail.h:46: error: ‘month_t’ has not been declared
    ./cctz/include/civil_time_detail.h:46: error: expected ‘;’ before ‘=’ token
    ./cctz/include/civil_time_detail.h:46: error: expected unqualified-id before ‘=’ token
    ./cctz/include/civil_time_detail.h:47: error: expected nested-name-specifier before ‘day_t’
    ./cctz/include/civil_time_detail.h:47: error: ‘day_t’ has not been declared
    ./cctz/include/civil_time_detail.h:47: error: expected ‘;’ before ‘=’ token
    ./cctz/include/civil_time_detail.h:47: error: expected unqualified-id before ‘=’ token
    ./cctz/include/civil_time_detail.h:48: error: expected nested-name-specifier before ‘hour_t’
    ./cctz/include/civil_time_detail.h:48: error: ‘hour_t’ has not been declared
    ./cctz/include/civil_time_detail.h:48: error: expected ‘;’ before ‘=’ token
    ./cctz/include/civil_time_detail.h:48: error: expected unqualified-id before ‘=’ token
    ./cctz/include/civil_time_detail.h:49: error: expected nested-name-specifier before ‘minute_t’
    ./cctz/include/civil_time_detail.h:49: error: ‘minute_t’ has not been declared
    ./cctz/include/civil_time_detail.h:49: error: expected ‘;’ before ‘=’ token
    ./cctz/include/civil_time_detail.h:49: error: expected unqualified-id before ‘=’ token
    ./cctz/include/civil_time_detail.h:50: error: expected nested-name-specifier before ‘second_t’
    ./cctz/include/civil_time_detail.h:50: error: ‘second_t’ has not been declared
    ./cctz/include/civil_time_detail.h:50: error: expected ‘;’ before ‘=’ token
    ./cctz/include/civil_time_detail.h:50: error: expected unqualified-id before ‘=’ token
    ./cctz/include/civil_time_detail.h:54: error: expected ‘)’ before ‘year’
    ./cctz/include/civil_time_detail.h:78: error: ‘cctz::detail::impl::is_leap_year’ declared as an ‘inline’ variable
    ./cctz/include/civil_time_detail.h:78: error: ‘year_t’ was not declared in this scope
    ./cctz/include/civil_time_detail.h:78: error: expected ‘,’ or ‘;’ before ‘noexcept’
    ./cctz/include/civil_time_detail.h:81: error: ‘cctz::detail::impl::year_index’ declared as an ‘inline’ variable
    ./cctz/include/civil_time_detail.h:81: error: ‘year_t’ was not declared in this scope
    ./cctz/include/civil_time_detail.h:81: error: ‘month_t’ was not declared in this scope
    ./cctz/include/civil_time_detail.h:81: error: initializer expression list treated as compound expression
    ./cctz/include/civil_time_detail.h:81: error: expected ‘,’ or ‘;’ before ‘noexcept’
    ./cctz/include/civil_time_detail.h:84: error: ‘cctz::detail::impl::days_per_century’ declared as an ‘inline’ variable
    ./cctz/include/civil_time_detail.h:84: error: ‘year_t’ was not declared in this scope
    ./cctz/include/civil_time_detail.h:84: error: ‘month_t’ was not declared in this scope
    ./cctz/include/civil_time_detail.h:84: error: initializer expression list treated as compound expression
    ./cctz/include/civil_time_detail.h:84: error: expected ‘,’ or ‘;’ before ‘noexcept’
    ./cctz/include/civil_time_detail.h:88: error: ‘cctz::detail::impl::days_per_4years’ declared as an ‘inline’ variable
    ./cctz/include/civil_time_detail.h:88: error: ‘year_t’ was not declared in this scope
    ./cctz/include/civil_time_detail.h:88: error: ‘month_t’ was not declared in this scope
    ./cctz/include/civil_time_detail.h:88: error: initializer expression list treated as compound expression
    ./cctz/include/civil_time_detail.h:88: error: expected ‘,’ or ‘;’ before ‘noexcept’
    ./cctz/include/civil_time_detail.h:92: error: ‘cctz::detail::impl::days_per_year’ declared as an ‘inline’ variable
    ./cctz/include/civil_time_detail.h:92: error: ‘year_t’ was not declared in this scope
    ./cctz/include/civil_time_detail.h:92: error: ‘month_t’ was not declared in this scope
    ./cctz/include/civil_time_detail.h:92: error: initializer expression list treated as compound expression
    ./cctz/include/civil_time_detail.h:92: error: expected ‘,’ or ‘;’ before ‘noexcept’
    ./cctz/include/civil_time_detail.h:95: error: ‘cctz::detail::impl::days_per_month’ declared as an ‘inline’ variable
    ./cctz/include/civil_time_detail.h:95: error: ‘year_t’ was not declared in this scope
    ./cctz/include/civil_time_detail.h:95: error: ‘month_t’ was not declared in this scope
    ./cctz/include/civil_time_detail.h:95: error: initializer expression list treated as compound expression
    ./cctz/include/civil_time_detail.h:95: error: expected ‘,’ or ‘;’ before ‘noexcept’
    update.cpp:371: error: expected ‘}’ at end of input
    update.cpp:371: error: expected ‘}’ at end of input
    update.cpp:371: error: expected ‘}’ at end of input
    make: * [update.o] Error 1
    ERROR: compilation failed for package ‘lubridate’
  • removing ‘/usr/lib64/R/library/lubridate’

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

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

  • update gcc if you can
  • install lubridate 1.6 like devtools::install_version("lubridate", "1.6.0"). Not recommended as there a couple of severe bugs there.
  • install dev version just before CCTZ 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.

All 9 comments

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

  • update gcc if you can
  • install lubridate 1.6 like devtools::install_version("lubridate", "1.6.0"). Not recommended as there a couple of severe bugs there.
  • install dev version just before CCTZ 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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ClaytonJY picture ClaytonJY  Â·  5Comments

rappster picture rappster  Â·  10Comments

garrettgman picture garrettgman  Â·  7Comments

sebschub picture sebschub  Â·  7Comments

MichaelJW picture MichaelJW  Â·  7Comments