Unable to install devtools in R v3.4.3 in Fedora 2

2019-08-02 06:43发布

问题:

I cannot install this R package due to compile errors. I try

install.packages("devtools")

and receive

/usr/bin/ld: skipping incompatible /usr/lib/libcurl.so when searching for -lcurl
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/7/../../../libcurl.so when searching for -lcurl
/usr/bin/ld: skipping incompatible //lib/libcurl.so when searching for -lcurl
/usr/bin/ld: skipping incompatible //usr/lib/libcurl.so when searching for -lcurl
/usr/bin/ld: cannot find -lcurl
collect2: error: ld returned 1 exit status
make: *** [/usr/share/R/make/shlib.mk:6: curl.so] Error 1
ERROR: compilation failed for package ‘curl’
* removing ‘/home/laur/R/x86_64-redhat-linux-gnu-library/3.4/curl’

Searching online revealed similar problems have been solved by installing libcurl-devel, but it didn't help me, and I now have multiple versions in 32 and 64-bit:

sudo dnf -y install libcurl libcurl-devel

returns

Package libcurl-7.55.1-9.fc27.x86_64 is already installed, skipping.
Package libcurl-7.55.1-10.fc27.i686 is already installed, skipping.
Package libcurl-devel-7.55.1-10.fc27.i686 is already installed, skipping.

I also tried to install curl-config, but couldn't find it.

回答1:

/usr/bin/ld: skipping incompatible //usr/lib/libcurl.so when searching for -lcurl

/usr/bin/ld: cannot find -lcurl

You are missing the 64bits version. # dnf install libcurl-devel.x86_64

libcurl-devel.x86_64 provides: /usr/bin/curl-config :64bit, /usr/lib64/libcurl.so , /usr/lib64/pkgconfig/libcurl.pc



回答2:

I could not reproduce your error on Fedora 27. However, maybe this will help:

If libcurl is already installed, check that 'pkg-config' is in your PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config is unavailable you can set INCLUDE_DIR and LIB_DIR manually via: R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'

From an ANTICONF ERROR message here.

EDIT: Not related to your error message, but make sure you also run sudo dnf -y install openssl-devel gnutls-devel