Sander W. van der Laan
Sander W. van der Laan

Reputation: 790

Failure to install rcurl on Big Sur with home-brew and r 4.1

I am trying to install RCurl on my macOS with Big Sur and R 4.1. See below for the output - it isn't working. I do really need it as I need to have GenomeInfDB.

Does anyone know how to fix this issue with the 'namespace' and RCurl?

Many thanks for your suggestions.

Thanks

Sander

install.packages("RCurl")
Installing package into ‘/opt/homebrew/lib/R/4.1/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/RCurl_1.98-1.3.tar.gz'
Content type 'application/x-gzip' length 728630 bytes (711 KB)
==================================================
downloaded 711 KB

* installing *source* package ‘RCurl’ ...
** package ‘RCurl’ successfully unpacked and MD5 sums checked
** using staged installation
checking for curl-config... /Users/slaan3/anaconda3/bin/curl-config
checking for gcc... gcc

[I removed a bit because it didn't fit the number of characters...]

ld: warning: ignoring file /Users/slaan3/anaconda3/lib/libcrypto.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64ld: warning: ignoring file /Users/slaan3/anaconda3/lib/libcurl.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /Users/slaan3/anaconda3/lib/libssl.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64

ld: warning: ignoring file /Users/slaan3/anaconda3/lib/libgssapi_krb5.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /Users/slaan3/anaconda3/lib/libxml2.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /Users/slaan3/anaconda3/lib/libicui18n.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /Users/slaan3/anaconda3/lib/libiconv.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /Users/slaan3/anaconda3/lib/libz.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /Users/slaan3/anaconda3/lib/libicudata.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /Users/slaan3/anaconda3/lib/libicuuc.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
installing to /opt/homebrew/lib/R/4.1/site-library/00LOCK-RCurl/00new/RCurl/libs
** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘RCurl’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/opt/homebrew/lib/R/4.1/site-library/00LOCK-RCurl/00new/RCurl/libs/RCurl.so':
  dlopen(/opt/homebrew/lib/R/4.1/site-library/00LOCK-RCurl/00new/RCurl/libs/RCurl.so, 6): Symbol not found: _curl_easy_cleanup
  Referenced from: /opt/homebrew/lib/R/4.1/site-library/00LOCK-RCurl/00new/RCurl/libs/RCurl.so
  Expected in: flat namespace
 in /opt/homebrew/lib/R/4.1/site-library/00LOCK-RCurl/00new/RCurl/libs/RCurl.so
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/opt/homebrew/lib/R/4.1/site-library/RCurl’

Upvotes: 2

Views: 746

Answers (2)

Jopejor
Jopejor

Reputation: 11

Deactivate conda before installing.

Upvotes: 1

mjsteinbaugh
mjsteinbaugh

Reputation: 46

I develop R packages on macOS, and strongly recommend not having conda active in your system PATH inside R. This is causing R to pick up the conda gcc, which is not compatible with building many R packages on macOS. Take a look at the R for macOS Developers guide, which explains this in detail. Alternatively, you can set PATH specifically inside R using an Renviron file, and that will help prevent the compiler mixup with conda gcc.

Also, it's recommended to use the CRAN R binary installation on macOS when building packages from source. The version of R available via conda is not recommended for building packages from source on macOS.

This can be installed via Homebrew using:

brew install --cask r

Upvotes: 1

Related Questions