Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

google/protobuf/inlined_string_field.h no such file or directory #17

Open
pelacables opened this issue Mar 29, 2022 · 13 comments
Open

google/protobuf/inlined_string_field.h no such file or directory #17

pelacables opened this issue Mar 29, 2022 · 13 comments

Comments

@pelacables
Copy link

Trying to build it on R 4.1.2 with gcc 10.3.0 and getting the error:

  CXX      google/protobuf/compiler/csharp/csharp_wrapper_field.lo
  CXXLD    libprotoc.la
  CXXLD    protoc
./.libs/libprotoc.so: error: undefined reference to 'scc_info_FileDescriptorProto_google_2fprotobuf_2fdescri
ptor_2eproto'
./.libs/libprotoc.so: error: undefined reference to 'descriptor_table_google_2fprotobuf_2fdescriptor_2eproto
'
collect2: error: ld returned 1 exit status
make[1]: *** [protoc] Error 1
make[1]: Leaving directory `/tmp/RtmpOoKxyP/R.INSTALL2c35616a567e5/RProtoBufLib/src/protobuf-3.13.0/src'
make: *** [install-recursive] Error 1
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -std=gnu++11 -shared -fpic -I../inst/include/ -I/tmp/RtmpOoKxyP/R.INSTALL2c35616a567e5/RProtoBufLib/src/
pb_build/include/ -o GatingSet_pb_lib/libGatingSet.pb.so GatingSet_pb_lib/GatingSet.pb.cc
In file included from GatingSet_pb_lib/GatingSet.pb.cc:4:
../inst/include/cytolib/GatingSet.pb.h:17:2: error: #error This file was generated by an older version of pr
otoc which is
   17 | #error This file was generated by an older version of protoc which is
      |  ^~~~~
../inst/include/cytolib/GatingSet.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. P
lease
   18 | #error incompatible with your Protocol Buffer headers. Please
      |  ^~~~~
../inst/include/cytolib/GatingSet.pb.h:19:2: error: #error regenerate this file with a newer version of prot
oc.
   19 | #error regenerate this file with a newer version of protoc.
      |  ^~~~~
In file included from GatingSet_pb_lib/GatingSet.pb.cc:4:
../inst/include/cytolib/GatingSet.pb.h:28:10: fatal error: google/protobuf/inlined_string_field.h: No such f
ile or directory
   28 | #include <google/protobuf/inlined_string_field.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ERROR: compilation failed for package ‘RProtoBufLib’
* removing ‘/apps/prod/easybuild/sl7.x86_64.foss-2021a/software/BiocLibrary/3.14-foss-2021a-R-4.1.2/site-lib
rary/RProtoBufLib’

let me know what other info do you need.

@mikejiang
Copy link
Member

Can you try the latest master branch from GitHub?or from bioconductor http://bioconductor.org/packages/3.15/bioc/html/RProtoBufLib.html?

@pelacables
Copy link
Author

g++ -std=gnu++11 -shared -fpic -I../inst/include/ -I/tmp/Rtmp6AhM8F/R.INSTALL40da345dc5cf/RProtoBufLib/src/pb_build/include/ -o GatingSet_pb_lib/libGatingSet.pb.so GatingSet_pb_lib/GatingSet.pb.cc
In file included from GatingSet_pb_lib/GatingSet.pb.cc:4:
../inst/include/cytolib/GatingSet.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
17 | #error This file was generated by an older version of protoc which is
| ^~~~~
../inst/include/cytolib/GatingSet.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
18 | #error incompatible with your Protocol Buffer headers. Please
| ^~~~~
../inst/include/cytolib/GatingSet.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
19 | #error regenerate this file with a newer version of protoc.
| ^~~~~
In file included from GatingSet_pb_lib/GatingSet.pb.cc:4:
../inst/include/cytolib/GatingSet.pb.h:28:10: fatal error: google/protobuf/inlined_string_field.h: No such file or directory
28 | #include
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [libGatingSet.pb] Error 1

what version do I need for the headers?

@mikejiang
Copy link
Member

try remotes::install_github("rglab/RProtoBufLib")
and make sure you don't have another protocol buffer library installed at your system

@mikejiang
Copy link
Member

Here is my installation output

> remotes::install_github("rglab/RProtoBufLib")
Downloading GitHub repo rglab/RProtoBufLib@HEADchecking for file/tmp/Rtmpg4aBx8/remotes122b6b46af/RGLab-RProtoBufLib-c362a52/DESCRIPTION...preparingRProtoBufLib:checking DESCRIPTION meta-information ...cleaning srcrunningcleanup’
─  checking for LF line-endings in source and make files and shell scriptschecking for empty or unneeded directoriesbuildingRProtoBufLib_2.7.4.tar.gzInstalling package into/usr/local/lib/R/site-library’
(aslibis unspecified)
* installing *source* packageRProtoBufLib...
** using staged installation
checking for gcc... gcc
...
untarring protobuf ...
building protobuf...
...
make[2]: Leaving directory '/tmp/Rtmpj8QF8G/R.INSTALL1c879451bfc/RProtoBufLib/src/protobuf-3.8.0/src'
make[1]: Leaving directory '/tmp/Rtmpj8QF8G/R.INSTALL1c879451bfc/RProtoBufLib/src/protobuf-3.8.0/src'
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -std=gnu++11 -shared -fpic -I../inst/include/ -I/tmp/Rtmpj8QF8G/R.INSTALL1c879451bfc/RProtoBufLib/src/pb_build/include/ -o GatingSet_pb_lib/libGatingSet.pb.so GatingSet_pb_lib/GatingSet.pb.cc
mkdir -p "/usr/local/lib/R/site-library/00LOCK-RProtoBufLib/00new/RProtoBufLib/include"
cp -r /tmp/Rtmpj8QF8G/R.INSTALL1c879451bfc/RProtoBufLib/src/pb_build/include/google /usr/local/lib/R/site-library/00LOCK-RProtoBufLib/00new/RProtoBufLib/include
mkdir -p "/usr/local/lib/R/site-library/00LOCK-RProtoBufLib/00new/RProtoBufLib/lib/"
cp /tmp/Rtmpj8QF8G/R.INSTALL1c879451bfc/RProtoBufLib/src/pb_build/lib/libprotobuf* /usr/local/lib/R/site-library/00LOCK-RProtoBufLib/00new/RProtoBufLib/lib/
cp GatingSet_pb_lib/libGatingSet.pb.so /usr/local/lib/R/site-library/00LOCK-RProtoBufLib/00new/RProtoBufLib/lib//libGatingSet.pb.so
g++ -std=gnu++11 -I"/usr/local/lib/R/include" -DNDEBUG -I../inst/include/ -I/tmp/Rtmpj8QF8G/R.INSTALL1c879451bfc/RProtoBufLib/src/pb_build/include/  -I/usr/local/include   -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c dummy.cpp -o dummy.o
g++ -std=gnu++11 -shared -L/usr/local/lib/R/lib -L/usr/local/lib -o RProtoBufLib.so dummy.o -L/usr/local/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/00LOCK-RProtoBufLib/00new/RProtoBufLib/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (RProtoBufLib)

@pescobar
Copy link

I am getting a similar error

/bin/sh ../libtool  --tag=CXX   --mode=link g++ -std=gnu++14 -pthread -DHAVE_PTHREAD=1 -DHAVE_ZLIB=1 -Wall -Wno-sign-compare  -O2 -ftree-vectorize -march=x86-64 -mtune=generic -fno-math-errno -pthread  -o protoc google/protobuf/compiler/main.o  libprotobuf.la libprotoc.la -lz
libtool: link: g++ -std=gnu++14 -pthread -DHAVE_PTHREAD=1 -DHAVE_ZLIB=1 -Wall -Wno-sign-compare -O2 -ftree-vectorize -march=x86-64 -mtune=generic -fno-math-errno -pthread -o .libs/protoc google/protobuf/compiler/main.o  ./.libs/libprotobuf.so ./.libs/libprotoc.so -lz -pthread -Wl,-rpath -Wl,/scratch/RtmpnjUEbS/R.INSTALL5dcf3f3c6dd1/RProtoBufLib/src/pb_build/lib
./.libs/libprotoc.so: error: undefined reference to 'scc_info_FileDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto'
./.libs/libprotoc.so: error: undefined reference to 'descriptor_table_google_2fprotobuf_2fdescriptor_2eproto'
collect2: error: ld returned 1 exit status
make[1]: *** [protoc] Error 1
make[1]: Leaving directory `/scratch/RtmpnjUEbS/R.INSTALL5dcf3f3c6dd1/RProtoBufLib/src/protobuf-3.8.0/src'
make: *** [install-recursive] Error 1
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -std=gnu++11 -shared -fpic -I../inst/include/ -I/scratch/RtmpnjUEbS/R.INSTALL5dcf3f3c6dd1/RProtoBufLib/src/pb_build/include/ -o GatingSet_pb_lib/libGatingSet.pb.so GatingSet_pb_lib/GatingSet.pb.cc
In file included from GatingSet_pb_lib/GatingSet.pb.cc:4:0:
../inst/include/cytolib/GatingSet.pb.h:10:10: fatal error: google/protobuf/port_def.inc: No such file or directory
 #include <google/protobuf/port_def.inc>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [libGatingSet.pb] Error 1
ERROR: compilation failed for package ‘RProtoBufLib’

@pescobar
Copy link

after some debugging I realized the problem happens when building the protobuf tarball provided in this repo

The protobuf build problem and workaround is reported here

I could install the package patching the RProtoBufLib like this:

$> mkdir /tmp/rprotobuflib-fix
$> cd /tmp/rprotobuflib-fix
$> wget https://bioconductor.org/packages/release/bioc/src/contrib/RProtoBufLib_2.6.0.tar.gz
$> tar xf RProtoBufLib_2.6.0.tar.gz
$> cd RProtoBufLib/src/
$> tar xf protobuf-3.13.0.tar.gz
$> cd protobuf-3.13.0/
$> wget https://gist.githubusercontent.com/pescobar/f05d3d6b427dae625d5636e2ee441cf7/raw/9a78838cbd53a7479ef099dee261359fc3279624/protobuf-3.8.0.patch
$> patch -p1 < protobuf-3.8.0.patch
$> cd ..
$> rm -fr protobuf-3.13.0.tar.gz
$> tar -czf protobuf-3.13.0.tar.gz protobuf-3.13.0/
$> cd /tmp/rprotobuflib-fix
$> rm RProtoBufLib_2.6.0.tar.gz
$> tar -czf RProtoBufLib_2.6.0.tar.gz RProtoBufLib/

inside R shell:
R> install.packages('/tmp/rprotobuflib-fix/RProtoBufLib_2.6.0.tar.gz', repos = NULL, type="source")

@pelacables
Copy link
Author

Thanks Pablo :-)

@pescobar
Copy link

Thanks Pablo :-)

De nada...a ver si pasan menos años hasta el próximo congreso ;) Hasta luego Lucas!

@pelacables
Copy link
Author

Pues sí, la verdad, ganas de desconectar un poco ya!

@mbstadler
Copy link

I have experienced the same issue using GCC 10.2.0 on centos 7. Installing the devel version (2.7.4) as suggested by @mikejiang above did not help, but the solution to patch protobuf-3.13.0.tar.gz suggested by @pescobar worked fine. Thanks a lot for posting your recipie!

@PedroMilanezAlmeida
Copy link

Just fyi, I am having the same issue in R 4.2.1. @mikejiang 's suggestion to install using remotes::install_github("rglab/RProtoBufLib") did not help. Did not try @pescobar 's solution yet.

@pelacables
Copy link
Author

I was installing this package yesterday and I can confirm that Pablo's solution is still valid.

@PedroMilanezAlmeida
Copy link

Just reporting back that I cannot install using @pescobar 's strategy (proxy error, setup that I cannot change).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants