Giter VIP home page Giter VIP logo

Comments (12)

systemed avatar systemed commented on June 15, 2024

Thanks. I don't use Homebrew on my M2 mini so a PR here would be great.

from tilemaker.

FunMiles avatar FunMiles commented on June 15, 2024

Related but taking another path, the CMakeLists.txt are woefully outdated. I have been able to modernize the CMakeLists and build tilemaker with CMake on my mac. I will try to make a PR for that. The trouble for addressing @cmahnke's problem is that I do a lot of development and thus some packages are already installed on my machine and may be different from his. Having someone try my approach on their machine and helping make sure we write complete correct instructions would be helpful. @cmahnke, would you be willing to help?

from tilemaker.

dougkpowers avatar dougkpowers commented on June 15, 2024

This worked for me on osx Ventura

Start by installing homebrew https://brew.sh/

After homebrew is installed. Install the necessary dependencies. Note that an older version of protobuf is required
brew install brew install protobuf@21 boost [email protected] shapelib rapidjson

Clone Tilemaker
git clone https://github.com/systemed/tilemaker

Checkout tag v2.4.0 (this is the version I've verified these instructions against)
git checkout tags/v2.4.0

Update the Makefile (in the tilemaker directory) to include the specific path to protobuf
First, look for this line
protoc --proto_path=include --cpp_out=include $<
and replace it with to add a full path to protoc and specify the include path for protoc include files
/usr/local/opt/protobuf@21/bin/protoc --proto_path=include -I/usr/local/opt/protobuf@21/include --cpp_out=include $<

Second, look for this line
INC := -I$(PLATFORM_PATH)/include -isystem ./include -I./src $(LUA_CFLAGS)
and ensure the protobuf include folder is added. for example:
INC := -I/usr/local/opt/protobuf@21/include -I$(PLATFORM_PATH)/include -isystem ./include -I./src $(LUA_CFLAGS)

Third, look for this line
LIB := -L$(PLATFORM_PATH)/lib -lz $(LUA_LIBS) -lboost_program_options -lsqlite3 -lboost_filesystem -lboost_system -lboost_iostreams -lprotobuf -lshp -pthread
and ensure the protobuf lib folder is added. For example:
LIB := -L/usr/local/opt/protobuf@21/lib -L$(PLATFORM_PATH)/lib -lz $(LUA_LIBS) -lboost_program_options -lsqlite3 -lboost_filesystem -lboost_system -lboost_iostreams -lprotobuf -lshp -pthread

Build Tilemaker using the Makefile
cd ./tilemaker && make

from tilemaker.

systemed avatar systemed commented on June 15, 2024

I think this should work:

https://github.com/systemed/tilemaker/tree/mac_build

It updates the instructions to use cmake and Lua 5.3. The fixes from #555 are now in trunk (slightly adjusted). I don't use Homebrew (too many bad experiences with it breaking everything) so would be interested to hear from anyone who tries it.

from tilemaker.

dougkpowers avatar dougkpowers commented on June 15, 2024

@systemed I've got the new M3 on order and will try your mac_build branch with a clean install when it arrives.

from tilemaker.

systemed avatar systemed commented on June 15, 2024

Thank you!

from tilemaker.

dougkpowers avatar dougkpowers commented on June 15, 2024
CMake Error at /opt/homebrew/Cellar/cmake/3.28.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find LuaJIT (missing: LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIR)
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.28.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindLuaJIT.cmake:57 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:49 (find_package)

from tilemaker.

systemed avatar systemed commented on June 15, 2024

Oh, that's interesting. It should only be looking for LuaJIT if it couldn't find plain vanilla Lua previously. Had brew install [email protected] installed Lua happily?

from tilemaker.

dougkpowers avatar dougkpowers commented on June 15, 2024

The default version of lua is 5.4.6. If we explicitly install 5.3 (which I did), then we also have to explicitly add it to our path.

==> [email protected]: stable 5.3.6 (bottled) [keg-only]
Powerful, lightweight programming language
https://www.lua.org/
/opt/homebrew/Cellar/[email protected]/5.3.6 (28 files, 407.2KB)
  Poured from bottle using the formulae.brew.sh API on 2023-12-09 at 20:20:36
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/l/[email protected]
License: MIT
==> Caveats
You may also want luarocks:
  brew install luarocks

[email protected] is keg-only, which means it was not symlinked into /opt/homebrew,
because this is an alternate version of another formula.

If you need to have [email protected] first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"' >> ~/.zshrc

For compilers to find [email protected] you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/[email protected]/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/[email protected]/include"

For pkg-config to find [email protected] you may need to set:
  export PKG_CONFIG_PATH="/opt/homebrew/opt/[email protected]/lib/pkgconfig"
==> Analytics
install: 292 (30 days), 601 (90 days), 10,636 (365 days)
install-on-request: 282 (30 days), 559 (90 days), 1,101 (365 days)
build-error: 0 (30 days)```

from tilemaker.

systemed avatar systemed commented on June 15, 2024

Right, got it. Thank you.

I wonder if (for Mac + homebrew) it might be easiest if we just recommend brew install luajit rather than vanilla Lua. LuaJIT is reliable, fast, and homebrew should be capable of installing it properly without additional steps.

from tilemaker.

FunMiles avatar FunMiles commented on June 15, 2024

I have a brand new Mac M3 and tried the instructions on it with cmake. Here are my observations:
First, there is an issue with compiling streamvbyte_arm_decode.c. It attempts to compile it as C++ and restrict is disliked. For now I added #define restrict __restrict to work around it.

brew install luajit will allow the code to compile but it will not link.
Removing luajit and doing brew install lua fixed it.
The current CMakeLists.txt is not looking for luajit but just lua. Did you modify the CMakeLists file, @dougkpowers?

from tilemaker.

systemed avatar systemed commented on June 15, 2024

v3 now builds and installs fine on an ARM Mac. I need to put my M2 through a deep cleanse after temporarily installing Homebrew to test :|

The manpages don't install because of SIP, but that's not really important because tilemaker --help serves just as well.

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.