user321627
user321627

Reputation: 2564

On CentOS Linux 7.4, cannot install the R package "httpuv"

I am currently using CentOS Linux 7.4.1708 (Core). I have tried to install the package httpuv in R through various methods to no avail. It always ends with the error:

  CC       src/unix/libuv_la-procfs-exepath.lo
  CC       src/unix/libuv_la-proctitle.lo
  CC       src/unix/libuv_la-sysinfo-loadavg.lo
  CC       src/unix/libuv_la-sysinfo-memory.lo
  CCLD     libuv.la
libtool:   error: require no space between '-L' and '-L/n/helmod/apps/centos7/Core/pcre/8.37-fasrc02/lib'
make[1]: *** [libuv.la] Error 1
make[1]: Leaving directory `/tmp/Rtmp5Dj7hL/R.INSTALL5c046d96dc92/httpuv/src/libuv'
make: *** [libuv/.libs/libuv.a] Error 2
ERROR: compilation failed for package ‘httpuv’

Does anyone have any thought as to what is going on here? Thanks.

Upvotes: 3

Views: 1395

Answers (2)

Kevin Arseneau
Kevin Arseneau

Reputation: 6264

The previous answer is partially correct in that it identifies libuv as the missing dependency.

In CentOS 7 you can add this with yum install libuv-devel, then attempt to install the package again with install.packages("httpuv") and provided that was your only issue, it should compile correctly.

Upvotes: 4

Gwang-Jin Kim
Gwang-Jin Kim

Reputation: 9865

The error says that there is a library error in libuv.la. The cc and CCLD commands show that this is a compilation error - very likely from gcc thrown when trying to compile libuv.la.

In ubuntu linux, I would look in such cases:

$ apt search httpuv
# which gives:
# r-cran-httpuv

R packages with mostly need other system dependencies (libraries outside of R etc) mostly have a package in the apt repository.

Then you do simply:

$ sudo apt install r-cran-httpuv

And then every dependency problems are resolved (though it might be that R asks you to update/upgrade your package after the installation - which sometimes works but sometimes not).

I was looking if CentOS can use apt: https://everyday-tech.com/apt-get-on-centos/

Another possibility for you would be to use conda which is great to solve such dependency problems. People have then similar to apt prepared for you conda-packages which provide all package dependencies.

$ conda install -c conda-forge r-httpuv

If you don't know conda, I highly recommend you this tutorial: https://www.youtube.com/watch?v=YJC6ldI3hWk (from Corey Schafer who gives great - mainly Python - tutorials).

Upvotes: 1

Related Questions