Closed WHM1 closed 8 months ago
This is the same as #502 - Google appear to have broken protobuf. If you can install an earlier version of the protobuf library it may work.
Unfortunately I’m away from my development machine for a few weeks and unlikely to be able to address this though someone else may have a solution. But you could try uninstalling the version of protobuf that’s been installed, and then brew install protobuf@21
.
I tried the old version protobuf@21, but it seems that there are new issues % make Using Lua 5.1 (include path is -I/opt/homebrew/include/lua5.1, library path is -llua5.1) protoc --proto_path=include --cpp_out=include include/osmformat.proto make: protoc: No such file or directory make: *** [include/osmformat.pb.cc] Error 1
Maybe it installs protoc under a different name - protoc21 or something. If you type proto into Terminal then press tab, what does it autocomplete with?
protoc % protoc protoc protoc-23.4.0
Running brew install protobuf@21
is keg only. This means it does not symlink into /opt/homebrew/include
so the compiler cannot locate the files. When you run make
the c++
command it runs is printed:
c++ -O3 -Wall -Wno-unknown-pragmas -Wno-sign-compare -std=c++14 -pthread -fPIE -DTM_VERSION=v2.4.0 -o include/osmformat.pb.o -c include/osmformat.pb.cc -I/opt/homebrew/include -isystem ./include -I./src -I/opt/homebrew/include/lua5.1
Notice how it includes from /opt/homebrew/include
but the keg-only version of protobuf@21
specifically says (after installation):
For compilers to find protobuf@21 you may need to set:
export LDFLAGS="-L/opt/homebrew/opt/protobuf@21/lib"
export CPPFLAGS="-I/opt/homebrew/opt/protobuf@21/include"
If you modify line 82 and 83 of the Makefile
you can add the protobuf library and include paths:
LIB := -L$(PLATFORM_PATH)/lib -L/opt/homebrew/opt/protobuf@21/lib -lz $(LUA_LIBS) -lboost_program_options -lsqlite3 -lboost_filesystem -lboost_system -lboost_iostreams -lprotobuf -lshp -pthread
INC := -I$(PLATFORM_PATH)/include -I/opt/homebrew/opt/protobuf@21/include -isystem ./include -I./src $(LUA_CFLAGS)
Re-run make
and compilation will succeed. @systemed Would it make sense to add $(LDFLAGS)
and $(CPPFLAGS)
to the Makefile? Mac users would just need to export those two directories per the Homebrew installation note and they would be all set. Makefile would look like this:
LIB := -L$(PLATFORM_PATH)/lib $(LDFLAGS) -lz $(LUA_LIBS) -lboost_program_options -lsqlite3 -lboost_filesystem -lboost_system -lboost_iostreams -lprotobuf -lshp -pthread
INC := -I$(PLATFORM_PATH)/include $(CPPFLAGS) -isystem ./include -I./src $(LUA_CFLAGS)
I'm also willing to submit a PR to do this and a little note in the install docs for Mac users to export those following brew install of protobuf.
That’s really helpful - thank you. A PR to do that would be excellent.
Thanks for these instructions @glenselle! It was one thing that tripped me up still that others might encounter too. I was running the newer protoc binary with the protobuf@21 headers. To run the old binary as well, simply do:
export PATH="/opt/homebrew/opt/protobuf@21/bin:$PATH
...before running make
Fixed in v3.0.
PC: macOs Apple M1 Pro I downloaded the tilemaker project and installed all dependencies according to install.md, but there were some errors when executing make and sudo make install. I hope you can help me take a look.
% make Using Lua 5.1 (include path is -I/opt/homebrew/include/lua5.1, library path is -llua5.1) protoc --proto_path=include --cpp_out=include include/osmformat.proto c++ -O3 -Wall -Wno-unknown-pragmas -Wno-sign-compare -std=c++14 -pthread -fPIE -DTM_VERSION=v2.4.0 -o include/osmformat.pb.o -c include/osmformat.pb.cc -I/opt/homebrew/include -isystem ./include -I./src -I/opt/homebrew/include/lua5.1 In file included from include/osmformat.pb.cc:4: In file included from ./include/osmformat.pb.h:24: In file included from /opt/homebrew/include/google/protobuf/io/coded_stream.h:134: In file included from /opt/homebrew/include/absl/strings/cord.h:78: In file included from /opt/homebrew/include/absl/container/inlined_vector.h:53: In file included from /opt/homebrew/include/absl/container/internal/inlined_vector.h:30: In file included from /opt/homebrew/include/absl/container/internal/compressed_tuple.h:40: /opt/homebrew/include/absl/utility/utility.h:164:12: error: no member named 'in_place_t' in namespace 'std' using std::in_place_t;