Giter Club home page Giter Club logo

Comments (7)

systemed avatar systemed commented on May 28, 2024

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.

from tilemaker.

WHM1 avatar WHM1 commented on May 28, 2024

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

from tilemaker.

systemed avatar systemed commented on May 28, 2024

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?

from tilemaker.

WHM1 avatar WHM1 commented on May 28, 2024

protoc
% protoc
protoc protoc-23.4.0

from tilemaker.

glenselle avatar glenselle commented on May 28, 2024

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.

from tilemaker.

systemed avatar systemed commented on May 28, 2024

That’s really helpful - thank you. A PR to do that would be excellent.

from tilemaker.

jesperp avatar jesperp commented on May 28, 2024

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

from tilemaker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.