Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

cmake: error: 'google/protobuf/stubs/common.h' file not found #23

Closed
loretoparisi opened this issue Mar 13, 2019 · 3 comments
Closed

cmake: error: 'google/protobuf/stubs/common.h' file not found #23

loretoparisi opened this issue Mar 13, 2019 · 3 comments

Comments

@loretoparisi
Copy link

loretoparisi commented Mar 13, 2019

As for #16 I'm trying to build the static library:

ip-192-168-1-105:AI loretoparisi$ git clone https://github.com/google/cld3.git
Cloning into 'cld3'...
remote: Enumerating objects: 16, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 429 (delta 6), reused 8 (delta 3), pack-reused 413
Receiving objects: 100% (429/429), 2.88 MiB | 481.00 KiB/s, done.
Resolving deltas: 100% (295/295), done.

and then building with Cmake

ip-192-168-1-105:AI loretoparisi$ cd cld3/
ip-192-168-1-105:cld3 loretoparisi$ mkdir build
ip-192-168-1-105:cld3 loretoparisi$ cd build/
ip-192-168-1-105:build loretoparisi$ cmake ..
-- The C compiler identification is AppleClang 10.0.0.10001145
-- The CXX compiler identification is AppleClang 10.0.0.10001145
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- Found Protobuf: /usr/local/lib/libprotobuf.dylib (found version "3.5.1") 
-- Protobuf_FOUND= TRUE
-- Protobuf_VERSION= 3.5.1
CMake Warning at CMakeLists.txt:11 (message):
  Protobuf 2.5 and CLD3 seems happy together.  This script does NOT check if
  your verison of protobuf is compatible.
-- Protobuf_LIBRARIES= /usr/local/lib/libprotobuf.dylib
-- Protobuf_LITE_LIBRARIES= /usr/local/lib/libprotobuf-lite.dylib
-- PROTO_HDRS= /Users/loretoparisi/Documents/Projects/AI/cld3/build/cld_3/protos/feature_extractor.pb.h;/Users/loretoparisi/Documents/Projects/AI/cld3/build/cld_3/protos/sentence.pb.h;/Users/loretoparisi/Documents/Projects/AI/cld3/build/cld_3/protos/task_spec.pb.h
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/loretoparisi/Documents/Projects/AI/cld3/build

Now running make

ip-192-168-1-105:build loretoparisi$ make
[  2%] Running C++ protocol buffer compiler on src/task_spec.proto
[  5%] Running C++ protocol buffer compiler on src/feature_extractor.proto
[  8%] Running C++ protocol buffer compiler on src/sentence.proto
Scanning dependencies of target cld3
[ 10%] Building CXX object CMakeFiles/cld3.dir/cld_3/protos/feature_extractor.pb.cc.o
In file included from /Users/loretoparisi/Documents/Projects/AI/cld3/build/cld_3/protos/feature_extractor.pb.cc:4:
/Users/loretoparisi/Documents/Projects/AI/cld3/build/cld_3/protos/feature_extractor.pb.h:9:10: fatal error: 'google/protobuf/stubs/common.h' file not found
#include <google/protobuf/stubs/common.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/cld3.dir/cld_3/protos/feature_extractor.pb.cc.o] Error 1
make[1]: *** [CMakeFiles/cld3.dir/all] Error 2
make: *** [all] Error 2
ip-192-168-1-105:build lor

Since I'm on macOS I have tried a protobuf update

Error: protobuf 3.5.1_1 is already installed
To upgrade to 3.7.0, run `brew upgrade protobuf`

After upgrading to protobuf 3.7.0 I get the same very error.

@WilliamTambellini
Copy link
Contributor

Should be fixed with my latest PullRequest #22.

@loretoparisi
Copy link
Author

loretoparisi commented Mar 17, 2019

@WilliamTambellini thank you it works. Hopefully it will be soon merged to the master!

Here is the results of compilation

-rw-r--r--   1 loretoparisi  staff    15668 18 Mar 00:28 CMakeCache.txt
drwxr-xr-x  19 loretoparisi  staff      608 18 Mar 00:28 CMakeFiles
-rw-r--r--   1 loretoparisi  staff    36048 18 Mar 00:28 Makefile
drwxr-xr-x   3 loretoparisi  staff       96 18 Mar 00:28 cld_3
-rw-r--r--   1 loretoparisi  staff     1405 18 Mar 00:28 cmake_install.cmake
-rwxr-xr-x   1 loretoparisi  staff   158732 18 Mar 00:28 getonescriptspan_test
-rwxr-xr-x   1 loretoparisi  staff  1372564 18 Mar 00:28 language_identifier_features_test
-rwxr-xr-x   1 loretoparisi  staff  1321820 18 Mar 00:28 language_identifier_main
-rw-r--r--   1 loretoparisi  staff  1842152 18 Mar 00:28 libcld3.a

@loretoparisi
Copy link
Author

@WilliamTambellini first thank you for the patch, it works! Could you please give me some hints about #24
Thanks a lot. Closing this.

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

No branches or pull requests

2 participants