0

I'm trying to install curl (as sudoer), but I get this error.

> install.packages("curl", lib = .Library)
...
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: cannot find -lcurl
collect2: error: ld returned 1 exit status
/usr/lib64/R/share/make/shlib.mk:6: recipe for target 'curl.so' failed
make: *** [curl.so] Error 1
ERROR: compilation failed for package ‘curl’
* removing ‘/usr/lib64/R/library/curl’
...

I'm working with a SUSE SLE 12.4

> cat /etc/SuSE-release
SUSE Linux Enterprise Server 12 (x86_64)
VERSION = 12
PATCHLEVEL = 4

Seems like it doesn't find ld

If you need other information, I would be more than happy to provide them.

Edo
  • 7,567
  • 2
  • 9
  • 19
  • It's not that it cannot find `ld`, it's that it cannot find `libcurl` (via the `-lcurl` command line argument inherent to the make recipe). The `curl`-package [github readme](https://github.com/jeroen/curl#readme) says that you need the underlying linux package installed; I don't know suse, but the package name might be one of `libcurl-dev` or `libcurl-devel`. (This needs to be done outside of R.) After that is installed, re-attempt `install.packages("curl",...)`. – r2evans Aug 07 '20 at 17:00
  • “libcurl-devel” is installed. – Edo Aug 07 '20 at 17:26
  • Okay. The error says that `ld` cannot find `libcurl` for linking. This is *typically* because it is not installed, but in your case perhaps it's because it is not in the load-path, `ldconfig` doesn't know where it is, or something else. Or I'm barking up the wrong tree. Sorry, I don't know much more how to help. – r2evans Aug 07 '20 at 17:27
  • Could you explain me how to see where `ldconfig` is looking at and how to add a new path? Also, if I type `find / curl.so` should I find the file? Coz I don’t.. sorry probably I’m asking really dumb questions, but I don’t know this stuff – Edo Aug 07 '20 at 18:17
  • I haven't had to deal with mis-configured library paths in so long that I can't really suggest much. You shouldn't need to do `find / -name curl.so`, though, since there is likely a way to get the package manager to tell you where it thinks it installed the files from the `libcurl-devel` package. https://stackoverflow.com/a/21610523/3358272 suggests using `ld --verbose | grep SEARCH_DIR` will advise on where the linker is looking. – r2evans Aug 07 '20 at 18:55

0 Answers0