Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R-Package tmap/protolite installation failed:

Tags:

r

tmap

I am working on Ubuntu 16.04 with R-version 3.4.2.

I want to install the R-Package "protolite" (more precisely, I want to install "tmap" where protolite is a prerequisite). I have libprotocol version 2.6.1 installed:

$ protoc --version

returns libprotoc 2.6.1.

When I type install.packages "protolite" , R gives me the warning:

Package protobuf was not found in the pkg-config search path.
Perhaps you should add the directory containing 'protobuf.pc'
to the PKG_CONFIG_PATH environment variable
No package 'protobuf' found 

Later the installation fails with

/usr/bin/ld: cannot find -lprotobuf
collect2: error: ld returned 1 exit status

Since libprotocoll is installed, I searched for the pc file by

apt-file search protobuf.pc

which returned

libprotobuf-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/protobuf.pc

So I added

export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig

however, this did not resolve the issue. Can somebody help me out?

Note: I spent hours trying to install "tmap" by now, at first my problem was that I had installed libprotocol 3.2, which I had to delete to install tmap/protolite because the installation required libprotocol 2.6.1. So maybe this deletion/new installation brought some things in disorder on my computer.

like image 880
Florestan Avatar asked Nov 06 '25 14:11

Florestan


1 Answers

Using

sudo apt-get install -y libprotobuf-dev protobuf-compiler

worked for me.

like image 98
MYaseen208 Avatar answered Nov 08 '25 10:11

MYaseen208