簡體   English   中英

R install.packages編譯時出現錯誤的ELF類錯誤

[英]R wrong ELF class errors while install.packages is compiling

我正在運行Ubuntu Budgie 64位:

lsb_release -a

Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:    18.04
Codename:   bionic

lscpu

Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              2
On-line CPU(s) list: 0,1
Thread(s) per core:  1
Core(s) per socket:  2
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               76
Model name:          Intel(R) Celeron(R) CPU  N3050  @ 1.60GHz
Stepping:            3
CPU MHz:             2160.000
CPU max MHz:         2160.0000
CPU min MHz:         480.0000
BogoMIPS:            3200.00
Virtualization:      VT-x
L1d cache:           24K
L1i cache:           32K
L2 cache:            1024K
NUMA node0 CPU(s):   0,1
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes rdrand lahf_lm 3dnowprefetch epb pti tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms dtherm ida arat

我按照此處的說明重新安裝了R 3.5(r-base和r-base-dev): https : //cran.cnr.berkeley.edu

一切似乎都正常,

R

R version 3.5.1 (2018-07-02) -- "Feather Spray"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

但是,當我去安裝新軟件包時(例如install.packages("ggplot2") ),編譯失敗,並顯示以下錯誤:

/usr/bin/x86_64-linux-gnu-ld: /usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so:
error loading plugin: /usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so:
wrong ELF class: ELFCLASS64
collect2: error: ld returned 1 exit status

我嘗試安裝的其他其他軟件包(dplyr,Rcpp)也因此錯誤而失敗。

到目前為止,我已經嘗試通過添加-m64標志來處理/usr/lib/R/etc/Makeconf的gcc / g ++編譯標志。 但是我仍然遇到同樣的問題。

更新:

file -L /usr/bin/x86_64-linux-gnu-ld給出:

x86_64-linux-gnu-ld: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV),
dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0,
BuildID[sha1]=8263ec62232df7411c36026e7e3e02afbfeb8b4f, stripped

更新2:

我發現我可以通過synaptic軟件包管理器並通過r-cran下載軟件包。 例如,我只運行sudo apt-get install r-cran-ggplot2 ,而不是在R中運行install.packages("ggplot2")

您的GCC安裝已被擰緊。

特別是,您具有32位鏈接器( x86_64-linux-gnu-ld ),但具有64位LTO插件liblto_plugin.so

這些應該匹配。 您應該找出哪個軟件包提供了以上兩個文件,並為每個軟件包安裝32位或64位版本。

我最近遇到了幾乎相同的問題,除了在aarch64鏈接器上使用armhf liblto_plugin.so。 在(有意)在aarch64主機上安裝gcc:armhf和binutils:armhf之后,我陷入了這種情況。 解決方案是安裝不太明顯的名為binutils-arm-linux-gnueabihf:armhf

按照@Employed Russian所說的內容,您需要安裝適當的binutils。 嘗試:

sudo apt install --reinstall binutils:amd64 binutils-x86_64-linux-gnu:amd64

如果找不到或無法使用這些軟件包,請嘗試像以前一樣通過apt-file搜索正確的軟件包名稱。

sudo apt install -y apt-file
sudo apt-file update
apt-file search x86_64-linux-gnu-ld
apt-file search x86_64-linux-gnu-ld.bfd

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM