Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
492 views
in Technique[技术] by (71.8m points)

gfortran - R v3.4.0-2 unable to find libgfortran.so.3 on Arch

I was just on vacation for a month so am unable to say the exact point at which this happened, but R from the official Arch repos is now unable to start, citing

/usr/lib64/R/bin/exec/R: error while loading shared libraries: 
libgfortran.so.3: cannot open shared object file: No such file or directory

I thought that perhaps a symlink was improperly placed or destroyed, so I looked in /usr/lib to try to find it:

ls -halt /usr/lib/libgfortran.so.*

lrwxrwxrwx 1 root root   20 May 16 03:01 /usr/lib/libgfortran.so.4 -> libgfortran.so.4.0.0
-rwxr-xr-x 1 root root 7.1M May 16 03:01 /usr/lib/libgfortran.so.4.0.0

Has libfortran.so.3 been superseded by libgfortran.so.4 in Arch? If so, are there any possible workarounds for getting R to run with an older version?


pacman -Qi r

Name            : r
Version         : 3.4.0-2
Description     : Language and environment for statistical computing and graphics
Architecture    : x86_64
URL             : http://www.r-project.org/
Licenses        : GPL
Groups          : None
Provides        : None
Depends On      : blas  lapack  bzip2  libpng  libjpeg  libtiff  ncurses  pcre  readline  zlib  perl  gcc-libs  libxt  libxmu  pango  xz  desktop-file-utils  zip  unzip
Optional Deps   : tk: tcl/tk interface [installed]
                  texlive-bin: latex sty files [installed]
Required By     : None
Optional For    : graphviz
Conflicts With  : None
Replaces        : None
Installed Size  : 58.04 MiB
Packager        : Evangelos Foutras <[email protected]>
Build Date      : Tue 25 Apr 2017 05:04:31 AM EDT
Install Date    : Tue 20 Jun 2017 12:27:06 PM EDT
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

Edit: If anyone else comes across this, the r-devel AUR correctly compiles and runs, so hopefully on the next version bump the issue will be resolved.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Indeed, gfortran 7 bumps the ligfortran version to version 4. See http://gcc.1065356.n8.nabble.com/patch-fortran-PR77828-Linking-gfortran-7-compiled-program-with-libgfortran-of-5-x-allowed-but-crashes-td1311625.html It is not backwards compatible and some APIs have changed.

If you install an older version of gfortran you will get libgfortran.so.3. It is completely fine to have multiple versions in your system. Maybe there is a way how to rebuild R for version 4, but it will be possibly more work. See other answers how to rebuild the software https://stackoverflow.com/a/50744705/721644


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...