0

I am having real trouble installing couple of packages but the root cause is mainly missing libraries. I will list one example here.

inside R-2.15.2

install.packages("RCurl")

/usr/share/R/include/Rinternals.h:676: note: expected 'const char *' but argument is of type 'ucs_t *'
gcc -std=gnu99 -shared -o RCurl.so base64.o curl.o curlInit.o curl_base64.o enums.o json.o memoryManagement.o myUTF8.o -L/jgi/local/Linux_x86_64/unixadm/curl/7.19.7/lib -lcurl -lidn -lssl -lcrypto -lrt -lssl -lcrypto -lz -lxml2 -L/usr/lib64/R/lib -lR
/usr/bin/ld: cannot find -lidn
collect2: ld returned 1 exit status
make: *** [RCurl.so] Error 1
ERROR: compilation failed for package 'RCurl'
* removing '/house/homedirs/a/apratap/lib/R/RCurl'

I have tried few things to supply library path but not successful.

Also:

</scratch>echo $LD_LIBRARY_PATH 
/usr/lib:/house/homedirs/a/apratap/lib:/jgi/tools/lib
</scratch>echo $R_LD_LIBRARY_PATH 
/usr/lib:/house/homedirs/a/apratap/lib:/jgi/tools/lib
Abhi
  • 6,075
  • 10
  • 41
  • 55
  • Save the source from the top right of this page: http://www.omegahat.org/RCurl/ Then from R's package installer, choose install from source and choose this archive. – Maiasaura Oct 30 '12 at 04:41
  • @Maiasaura: Thanks for ur quick reply but I think the link is down..[link](http://www.omegahat.org/RCurl/RCurl_1.95-3.tar.gz) – Abhi Oct 30 '12 at 05:06
  • Tried downloading from here [link](http://www.omegahat.org/R/src/contrib/)..still getting the same error – Abhi Oct 30 '12 at 05:08
  • Not sure the explanation for closing the question makes any sense..I see many questions relating to R and R package installations.. [examples](http://stackoverflow.com/search?q=R+install+question) ..Anyways I guess I am better off posting this on R mailing list..thanks – Abhi Oct 30 '12 at 15:30

2 Answers2

1
/usr/bin/ld: cannot find -lidn

means the compiler was looking for, and failed to find, libidn, which would seem to be this:

http://www.gnu.org/software/libidn/

So, install it using your (unspecified) operating system's package management, and try again. An R package being installed from source cannot be expected to sort out all your system dependencies.

It may well be a requirement of libcurl - have you installed that?

Spacedman
  • 92,590
  • 12
  • 140
  • 224
-1

I just installed RCurl in CentOS 6.2 without any issues. From your output, it looks like, the problem lies with your Linux installation (GNU linker). Can you try reinstalling make and gcc?

Indrajit
  • 2,152
  • 1
  • 14
  • 20