stan-dev / rstanarm

rstanarm R package for Bayesian applied regression modeling
https://mc-stan.org/rstanarm
GNU General Public License v3.0
389 stars 133 forks source link

Installation fails on Ubuntu #380

Closed sursu closed 5 years ago

sursu commented 5 years ago

Summary:

I'm trying to install rstanarm.

So in the terminal I run:

R
> install.packages("rstanarm")

But, then I get the following error:

* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lcurl
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libcurl was not found. Try installing:
 * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
 * rpm: libcurl-devel (Fedora, CentOS, RHEL)
 * csw: libcurl_dev (Solaris)
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=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘curl’
* removing ‘/usr/local/lib/R/site-library/curl’
* installing *source* package ‘openssl’ ...
** package ‘openssl’ successfully unpacked and MD5 sums checked
Using PKG_CFLAGS=
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because openssl was not found. Try installing:
 * deb: libssl-dev (Debian, Ubuntu, etc)
 * rpm: openssl-devel (Fedora, CentOS, RHEL)
 * csw: libssl_dev (Solaris)
 * brew: openssl@1.1 (Mac OSX)
If openssl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a openssl.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=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘openssl’
* removing ‘/usr/local/lib/R/site-library/openssl’
ERROR: dependencies ‘curl’, ‘openssl’ are not available for package ‘rsconnect’
* removing ‘/usr/local/lib/R/site-library/rsconnect’
ERROR: dependency ‘rsconnect’ is not available for package ‘shinystan’
* removing ‘/usr/local/lib/R/site-library/shinystan’
ERROR: dependency ‘shinystan’ is not available for package ‘rstanarm’
* removing ‘/usr/local/lib/R/site-library/rstanarm’

The downloaded source packages are in
    ‘/tmp/RtmpKh1R7T/downloaded_packages’
Warning messages:
1: In install.packages("rstanarm") :
  installation of package ‘curl’ had non-zero exit status
2: In install.packages("rstanarm") :
  installation of package ‘openssl’ had non-zero exit status
3: In install.packages("rstanarm") :
  installation of package ‘rsconnect’ had non-zero exit status
4: In install.packages("rstanarm") :
  installation of package ‘shinystan’ had non-zero exit status
5: In install.packages("rstanarm") :
  installation of package ‘rstanarm’ had non-zero exit status

I have installed R from the Ubuntu Software Center.

RStanARM Version:

2.18.2

R Version:

3.4.4

Operating System:

Ubuntu 18.04.2

sursu commented 5 years ago

Solved by updating R and installing libcurl4-openssl-dev.