failed to compile with R version 4.1.2
Closed this issue · 1 comments
elfayoumi commented
Hi
I tried to install the latest version from source code, but it fails because of missing include file:
R version 4.1.2 (2021-11-01) Bird Hippie
- installing source package ‘protolite’ ...
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-pthread
Using PKG_LIBS=-lprotobuf -pthread
Using libprotoc 3.16.0 from /mnt/data/anaconda3/bin/protoc
Warning: protoc version libprotoc 3.16.0 might not match libproto version 3.6.1.
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -pthread -DUSENEWAPI -I'/home/ibrahim/R/x86_64-pc-linux-gnu-library/4.1/Rcpp/include' -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-i2PIHO/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -pthread -DUSENEWAPI -I'/home/ibrahim/R/x86_64-pc-linux-gnu-library/4.1/Rcpp/include' -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-i2PIHO/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c geobuf.cpp -o geobuf.o
In file included from geobuf.cpp:1:
geobuf.pb.h:10:10: fatal error: google/protobuf/port_def.inc: No such file or directory
10 | #include <google/protobuf/port_def.inc>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [/usr/lib/R/etc/Makeconf:177: geobuf.o] Error 1
ERROR: compilation failed for package ‘protolite’ - removing ‘/home/ibrahim/R/x86_64-pc-linux-gnu-library/4.1/protolite’
Warning in i.p(...) :
installation of package ‘/tmp/RtmpPG2vnd/file8ae2216bfa30d/protolite_2.1.1.tar.gz’ had non-zero exit status
I am not sure where is this file, I could not see geobuf.pb.h file anywhere..
Regards
Ibrahim
jeroen commented
The geobuf.pb.h
file gets autogenerated by protoc
. The problem is this line from your output:
Warning: protoc version libprotoc 3.16.0 might not match libproto version 3.6.1.
I'm guessing you have mixed up versions of protocol buffers from anaconda and your OS. If you use anaconda you should probably install this package through anaconda: https://anaconda.org/conda-forge/r-protolite