0

`Hi,

our cluster is running Ubuntu-22.04. Due to packages that require specific versions of R, I need to have R-3.6.1 available on the nodes.

Through the package manager the oldest version of R that can be installed is 3.6.3-2:

apt-cache madison r-base

r-base | 4.3.1-4.2204.0 jammy-cran40/ Packages r-base | 4.3.1-3.2204.0 jammy-cran40/ Packages r-base | 4.3.1-2.2204.0 jammy-cran40/ Packages r-base | 4.3.1-1.2204.0 jammy-cran40/ Packages r-base | 4.3.0-1.2204.0 jammy-cran40/ Packages r-base | 4.2.3-1.2204.0 jammy-cran40/ Packages r-base | 4.2.2.20221110-1.2204.0 jammy-cran40/ Packages r-base | 4.2.2-1.2204.0 jammy-cran40/ Packages r-base | 4.2.1-3.2204.0 jammy-cran40/ Packages r-base | 4.2.1-2.2204.0 jammy-cran40/ Packages r-base | 4.2.1-1.2204.0 jammy-cran40/ Packages r-base | 4.2.0-1.2204.0 jammy-cran40/ Packages r-base | 4.1.2-1ubuntu2 amd64 Packages r-base | 4.1.2-1ubuntu2 i386 Packages r-base | 3.6.3-2 | http://de.archive.ubuntu.com/ubuntu focal/universe Sources

In a common software directory I keep compiled versions of R that can be accessed on all nodes. This is the added to the path, so that it can be found by bash scripts.

Compilation of R-3.6.3 works using these configuration options:

./configure --with-blas --with-lapack --with-readline --with-readline --with-cairo --with-libpng --with-jpeglib --with-libtiff --enable-R-shlib --with-x --with-recommended-packages --enable-R-shlib --enable-BLAS-shlib --enable-shared=lapack --enable-shared=blas --with-tcltk --with-tcl-config=/usr/lib/x86_64-linux-gnu/tcl8.6/tclConfig.sh --with-tk-config=/usr/lib/x86_64-linux-gnu/tk8.6/tkConfig.sh --prefix=$(pwd)

The gcc compiler is installed through the package manager and version 11.4.0:

gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
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.

But I fail to build R-3.6.1, because it runs into a linker error with "tools.so":

installing 'sysdata.rda'
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
unable to load shared object '/storage1/Software/ubuntu/R/R-3.6.1/library/tools/libs/tools.so':
>   /storage1/Software/ubuntu/R/R-3.6.1/library/tools/libs/tools.so: undefined symbol: yyllocL
Error: unable to load R code in package 'tools'
Execution halted
make[4]: *** [../../../share/make/basepkg.mk:151: sysdata] Error 1
make[4]: Leaving directory '/storage1/Software/ubuntu/R/R-3.6.1/src/library/tools'
make[3]: *** [Makefile:36: all] Error 2
make[3]: Leaving directory '/storage1/Software/ubuntu/R/R-3.6.1/src/library/tools'
make[2]: *** [Makefile:37: R] Error 1
make[2]: Leaving directory '/storage1/Software/ubuntu/R/R-3.6.1/src/library'
make[1]: *** [Makefile:28: R] Error 1
make[1]: Leaving directory '/storage1/Software/ubuntu/R/R-3.6.1/src'
make: *** [Makefile:61: R] Error 1

I am confused why this occurs only for R-3.6.1 - after all this is only a minor version change.

I could not find "yyllocL" through: apt-cache search yylloc
or apt-file search yyllocL

but
apt-file search yyloc
libmailutils-dev: /usr/include/mailutils/yyloc.h

I then installed this package:
apt-get install libmailutils-dev

but that did not help either, as that seems only to install the above mentioned include file:
/usr/include/mailutils/yyloc.h

But I managed to find this forum post, which mentions the yy-lexer.

I then installed these packages:
apt-get install flex flexc++ yydebug r-cran-isoweek

where the latter will probably only relate to the R-versions of the package manager, but flex and yydebug seemed good candidates.

After a complete cycle of:

make clean
./configure --with-blas --with-lapack --with-readline --with-readline --with-cairo --with-libpng --with-jpeglib --with-libtiff --enable-R-shlib --with-x --with-recommended-packages --enable-R-shlib --enable-BLAS-shlib --enable-shared=lapack --enable-shared=blas --with-tcltk --with-tcl-config=/usr/lib/x86_64-linux-gnu/tcl8.6/tclConfig.sh --with-tk-config=/usr/lib/x86_64-linux-gnu/tk8.6/tkConfig.sh --prefix=$(pwd)

and

make -j4

to rebuild it, I ran into the same error, though.

Using R-3.6.3 is only partially an option, as - to my dismay - all packages do not only a recompilation in spite of the minor version upgrade, but also partially fail entirely, because they seem to be badly maintained.

In order to keep our analysis workflows reproducible, we need R-3.6.1 on the cluster nodes.

Using docker/rocker might be a workaround, but requires adaption in all analysis scripts that the scientists use.

Could the error be due to a newer version of gcc compared to Ubuntu-20.04? Maybe using "alternatives" with gcc and using an older version could help? But I would only expect that with compilation problems, while this is clearly a linker problem.

I would set LD_LIBRARY_PATH, if I knew the location of the "yylocL"-library; provided it got installed with the yydebug package?

export LDFLAGS=-L/storage1/Software/ubuntu/R/R-3.6.1/library/
export LD_LIBRARY_PATH=/storage1/Software/ubuntu/R/R-3.6.1/library

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/storage1/Software/ubuntu/R/R-3.6.1/lib
export LDFLAGS=-L/storage1/Software/ubuntu/R/R-3.6.1/lib

Checking with nm shows more undefined symbols in tools.so:

nm -u /storage1/Software/ubuntu/R/R-3.6.1/library/tools/libs/tools.so 
                 U ALTREP_LENGTH
                 U ALTSTRING_ELT
                 U ALTVEC_DATAPTR
                 U chmod@GLIBC_2.2.5
                 U closedir@GLIBC_2.2.5
                 U __ctype_b_loc@GLIBC_2.3
                 U __ctype_get_mb_cur_max@GLIBC_2.2.5
                 w __cxa_finalize@GLIBC_2.2.5
                 U dcgettext@GLIBC_2.2.5
                 U __errno_location@GLIBC_2.2.5
                 U extR_HTTPDCreate
                 U extR_HTTPDStop
                 U fclose@GLIBC_2.2.5
                 U ferror@GLIBC_2.2.5
                 U fopen@GLIBC_2.2.5
                 U fread@GLIBC_2.2.5
                 U free@GLIBC_2.2.5
                 U fwrite@GLIBC_2.2.5
                 U getConnection
                 U getpriority@GLIBC_2.2.5
                 w __gmon_start__
                 U INTEGER
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
                 U kill@GLIBC_2.2.5
                 U LENGTH
                 U malloc@GLIBC_2.2.5
                 U mbcslocale
                 U __memcpy_chk@GLIBC_2.3.4
                 U memcpy@GLIBC_2.14
                 U __memmove_chk@GLIBC_2.3.4
                 U memmove@GLIBC_2.2.5
                 U opendir@GLIBC_2.2.5
                 U parseError
                 U R_alloc
                 U R_BadLongVector
                 U R_BaseEnv
                 U RC_fopen
                 U R_CHAR
                 U R_chk_calloc
                 U R_chk_free
                 U R_chk_realloc
                 U R_ClassSymbol
                 U Rconn_fgetc
                 U readdir@GLIBC_2.2.5
                 U realloc@GLIBC_2.2.5
                 U R_EmptyEnv
                 U Rf_allocVector
                 U Rf_allocVector3
                 U Rf_asInteger
                 U Rf_asLogical
                 U Rf_begincontext
                 U Rf_coerceVector
                 U Rf_cons
                 U Rf_defineVar
                 U Rf_duplicate
                 U Rf_endcontext
                 U Rf_envlength
                 U Rf_error
                 U Rf_findVar
                 U Rf_getAttrib
                 U Rf_getCharCE
                 U R_FileExists
                 U Rf_imax2
                 U Rf_install
                 U Rf_installTrChar
                 U Rf_isString
                 U Rf_length
                 U Rf_lengthgets
                 U Rf_mbrtowc
                 U Rf_mkChar
                 U Rf_mkCharCE
                 U Rf_mkCharLen
                 U Rf_mkCharLenCE
                 U R_forceSymbols
                 U Rf_PairToVectorList
                 U Rf_protect
                 U Rf_ScalarInteger
                 U Rf_ScalarLogical
                 U Rf_ScalarString
                 U Rf_setAttrib
                 U Rf_strchr
                 U Rf_translateChar
                 U Rf_translateCharUTF8
                 U Rf_unprotect
                 U Rf_warning
                 U Rf_warningcall
                 U Rf_xlengthgets
                 U R_NaInt
                 U R_NaString
                 U R_NewHashedEnv
                 U R_NewPreciousMSet
                 U R_NilValue
                 U R_ParseContext
                 U R_ParseContextLast
                 U R_ParseContextLine
                 U R_ParseError
                 U R_ParseErrorMsg
                 U R_PPStack
                 U R_PPStackSize
                 U R_PPStackTop
                 U R_PreserveInMSet
                 U Rprintf
                 U R_registerRoutines
                 U R_ReleaseFromMSet
                 U R_signal_protect_error
                 U R_SrcfileSymbol
                 U R_SrcrefSymbol
                 U R_UnboundValue
                 U R_useDynamicSymbols
                 U SETCAR
                 U SETCDR
                 U setpriority@GLIBC_2.2.5
                 U SET_STRING_ELT
                 U SET_VECTOR_ELT
                 U __snprintf_chk@GLIBC_2.3.4
                 U snprintf@GLIBC_2.2.5
                 U __sprintf_chk@GLIBC_2.3.4
                 U __stack_chk_fail@GLIBC_2.4
                 U stat@GLIBC_2.33
                 U __stpcpy_chk@GLIBC_2.3.4
                 U stpcpy@GLIBC_2.2.5
                 U __strcat_chk@GLIBC_2.3.4
                 U strchr@GLIBC_2.2.5
                 U strcmp@GLIBC_2.2.5
                 U __strcpy_chk@GLIBC_2.3.4
                 U strcspn@GLIBC_2.2.5
                 U STRING_ELT
                 U strlen@GLIBC_2.2.5
                 U strncmp@GLIBC_2.2.5
                 U __strncpy_chk@GLIBC_2.3.4
                 U strncpy@GLIBC_2.2.5
                 U strstr@GLIBC_2.2.5
                 U TYPEOF
                 U vmaxget
                 U vmaxset
                 U yyllocL

Has anyone successfully built R-3.6.1 from sources on Ubuntu 22.04? Any suggestions on how to get R-3.6.1 built on Ubuntu-22.04 are highly appreciated.

Best regards,

Dr_Soong

Dr. Soong
  • 1
  • 2
  • what `gcc --version` are you using? – Chris Aug 31 '23 at 15:07
  • As mentioned in my admittedly long description, the default package version of gcc: `gcc --version` gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 – Dr. Soong Aug 31 '23 at 19:20
  • I used madison and alternatives to install gcc-9 which is according to my research the version that was part of Ubuntu-20.04 - where a build of 3.6.1 was successful. ` apt-get -s install build-essential=12.8ubuntu1` With a make clean ./configure... make -j4 cycle, I had again the same error. I not sure, though, if that also changed the linker to Ubuntu-20.04's version. ld --version GNU ld (GNU Binutils for Ubuntu) 2.38 Copyright (C) 2022 Free Software Foundation, Inc. can't be the one shipped with Ubuntu-20.04 in 2020. – Dr. Soong Aug 31 '23 at 21:21
  • How do I install an alternative version corresponding to Ubuntu-20.04's version of ld? I can't find it with ``apt-cache madison ld`? – Dr. Soong Aug 31 '23 at 21:25
  • I was guessing it would be gcc-8, as that was approx ubuntu 20.04 version in 2019 when R-3.6.1. I don't have gcc-8, but I can't build 3.6.1 from source due to changes in gcc 10 (like you, I'm gcc 11) a config or make CC option CC='fcommon`...But, considering the longitudinal nature of your organization, that is also going forward and whose span (institutionally may reach R-8.9.?), – Chris Aug 31 '23 at 21:50
  • it may be more practical to take the docker approach and change scripts rather that achieving a one off 3.6.1 build that may be fragile, Overall, as in internal discussion at your shop, what are the packages from 3.6.1 that are no longer maintained, hence not on CRAN, that it might make sense to adopt and maintain for your continuing research purposes. Several approached proposed here. I generally resist mixing versions (say between madison and jammy) as it leads to future incomprehensible problems. – Chris Aug 31 '23 at 21:51

0 Answers0