jeroen / protolite

Fast and Simple Object Serialization to Protocol Buffers
Other
48 stars 9 forks source link

compilation failed for package ‘protolite’ #21

Open renanmacedosem opened 1 year ago

renanmacedosem commented 1 year ago

Hi!

I am trying to install geojsonio package and it seems I could not finish this process because I can not install protolite package. There is an issue in some parts. Please, can you help to figure out what should be the issue?

Also, I tried to reinstall the Linux dependencies:sudo apt-get install -y libprotobuf-dev protobuf-compiler and I still have the same issue.

Error message:

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/renan/R/x86_64-pc-linux-gnu-library/3.6/protolite’
Warning in install.packages :
  installation of package ‘protolite’ had non-zero exit status
ERROR: dependency ‘protolite’ is not available for package ‘geojson’
* removing ‘/home/renan/R/x86_64-pc-linux-gnu-library/3.6/geojson’
Warning in install.packages :
  installation of package ‘geojson’ had non-zero exit status
ERROR: dependency ‘geojson’ is not available for package ‘geojsonio’
* removing ‘/home/renan/R/x86_64-pc-linux-gnu-library/3.6/geojsonio’
Warning in install.packages :
  installation of package ‘geojsonio’ had non-zero exit status

Session info:

> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3

locale:
 [1] LC_CTYPE=en_CA.UTF-8       LC_NUMERIC=C               LC_TIME=en_CA.UTF-8        LC_COLLATE=en_CA.UTF-8     LC_MONETARY=en_CA.UTF-8    LC_MESSAGES=en_CA.UTF-8    LC_PAPER=en_CA.UTF-8      
 [8] LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] bigrquery_1.4.1

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9       rstudioapi_0.14  magrittr_2.0.3   rappdirs_0.3.3   bit_4.0.5        here_1.0.1       lattice_0.20-45  R6_2.5.1         rlang_1.0.6      fansi_1.0.3      httr_1.4.4       tools_3.6.3     
[13] grid_3.6.3       png_0.1-8        utf8_1.2.2       cli_3.4.1        DBI_1.1.3        rprojroot_2.0.3  bit64_4.0.5      assertthat_0.2.1 tibble_3.1.8     gargle_1.2.1     lifecycle_1.0.3  Matrix_1.2-18   
[25] vctrs_0.5.1      fs_1.5.2         glue_1.6.2       compiler_3.6.3   pillar_1.8.1     reticulate_1.26  jsonlite_1.8.3   pkgconfig_2.0.3 

Thanks!

jeroen commented 1 year ago

Can you show the command you used and the full install log pls

renanmacedosem commented 1 year ago

So, I solved the problem. I had an old R version (3.6.3) and did not realize it. After removing this version and installing 4.2.2 this problem was solved.

Sorry for bothering you.

Thanks for your time and quickly answer.

renanmacedosem commented 1 year ago
> install.packages('protolite')
trying URL 'https://cloud.r-project.org/src/contrib/protolite_2.1.3.tar.gz'
Content type 'application/x-gzip' length 25173 bytes (24 KB)
==================================================
downloaded 24 KB

* installing *source* package ‘protolite’ ...
** package ‘protolite’ successfully unpacked and MD5 sums checked
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-pthread
Using PKG_LIBS=-lprotobuf -pthread
Using C++17 compiler: g++ -std=gnu++17
Using libprotoc 3.14.0 from /home/renan/.local/share/r-miniconda/envs/r-reticulate/bin/protoc
Warning: protoc version libprotoc 3.14.0 might not match libproto version 3.6.1.
** libs
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG -pthread -DUSENEWAPI -I'/home/renan/R/x86_64-pc-linux-gnu-library/4.2/Rcpp/include'   -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-a3XuZ5/r-base-4.2.2.20221110=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG -pthread -DUSENEWAPI -I'/home/renan/R/x86_64-pc-linux-gnu-library/4.2/Rcpp/include'   -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-a3XuZ5/r-base-4.2.2.20221110=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -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:178: geobuf.o] Error 1
ERROR: compilation failed for package ‘protolite’
* removing ‘/home/renan/R/x86_64-pc-linux-gnu-library/4.2/protolite’
Warning in install.packages :
  installation of package ‘protolite’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpEwnQ4U/downloaded_packages’