systemed / tilemaker

Make OpenStreetMap vector tiles without the stack
https://tilemaker.org/
Other
1.42k stars 228 forks source link

Makefile:51: *** Couldn't find Lua libraries. Stop. #650

Closed StephenAtty closed 6 months ago

StephenAtty commented 7 months ago

Version 3.0

steve@nyman:/openmaptiles/tilemaker-3.0.0$ make Using make: -e: No such file or directory

All pre-reqs installed.

Checked makefile - seems to use luajit

LUA_JITV := $(shell luajit -e 'a,b,c=string.find(jit.version,"LuaJIT (%d.%d)");print(c)')

but luajit is not in the pre-reqs and its not installed by default

steve@nyman:/openmaptiles/tilemaker-3.0.0$ juajit Command 'juajit' not found, did you mean: command 'luajit' from deb luajit (2.1.0~beta3+dfsg-6) Try: sudo apt install

So installed luajit

make Using luajit

machine is running Ubuntu 22.04.3 LTS

lua.h is at

/usr/include/lua5.1/lua.h

if I dump the values of $LUA_DIR and $LUA_LANGV which are used to work out where the lua.h file is

I get

$LUA_DIR is [luajit-2.1] $LUA_LANGV is [5.1]

which is wrong

systemed commented 7 months ago

I think you have luajit installed and liblua5.1-dev but not libluajit-5.1-dev.

Consequently tilemaker will see that you have LuaJIT, try to find its libraries, and fail.

If you do sudo apt install libluajit-5.1-dev then this will install the headers for LuaJIT and it should build happily. (Tested on Ubuntu 20.04.)

StephenAtty commented 7 months ago

OK I removed luajit and installed lua 5.1 and that's fixed it. Either way the list of packages to install is wrong - if its going to include liblua5.1-0-dev then it should also include lua5.1

now it fails on

fatal: not a git repository (or any of the parent directories): .git g++ -O3 -Wall -Wno-unknown-pragmas -Wno-sign-compare -std=c++14 -pthread -fPIE -DTM_VERSION= -o src/attribute_store.o -c src/attribute_store.cpp -I/usr/local/include -isystem ./include -I./src -I/usr/include/lua5.1 fatal: not a git repository (or any of the parent directories): .git g++ -O3 -Wall -Wno-unknown-pragmas -Wno-sign-compare -std=c++14 -pthread -fPIE -DTM_VERSION= -o src/coordinates_geom.o -c src/coordinates_geom.cpp -I/usr/local/include -isystem ./include -I./src -I/usr/include/lua5.1 In file included from /usr/include/boost/math/tools/cxx03_warn.hpp:9, from /usr/include/boost/math/constants/constants.hpp:11, from /usr/include/boost/geometry/util/math.hpp:29, from /usr/include/boost/geometry/core/radian_access.hpp:33, from /usr/include/boost/geometry/geometry.hpp:51, from /usr/include/boost/geometry.hpp:17, from ./include/geom.h:14, from ./include/coordinates_geom.h:5, from src/coordinates_geom.cpp:1: /usr/include/boost/detail/no_exceptions_support.hpp:17:1: note: ‘#pragma message: This header is deprecated. Use <boost/core/no_exceptions_support.hpp> instead.’ 17 | BOOST_HEADER_DEPRECATED("<boost/core/no_exceptions_support.hpp>") | ^~~~~~~ fatal: not a git repository (or any of the parent directories): .git g++ -O3 -Wall -Wno-unknown-pragmas -Wno-sign-compare -std=c++14 -pthread -fPIE -DTM_VERSION= -o src/coordinates.o -c src/coordinates.cpp -I/usr/local/include -isystem ./include -I./src -I/usr/include/lua5.1 fatal: not a git repository (or any of the parent directories): .git cc -O3 -Wall -Wno-unknown-pragmas -Wno-sign-compare -std=c99 -fPIE -DTM_VERSION= -o src/external/streamvbyte_decode.o -c src/external/streamvbyte_decode.c -I/usr/local/include -isystem ./include -I./src -I/usr/include/lua5.1 fatal: not a git repository (or any of the parent directories): .git cc -O3 -Wall -Wno-unknown-pragmas -Wno-sign-compare -std=c99 -fPIE -DTM_VERSION= -o src/external/streamvbyte_encode.o -c src/external/streamvbyte_encode.c -I/usr/local/include -isystem ./include -I./src -I/usr/include/lua5.1 fatal: not a git repository (or any of the parent directories): .git cc -O3 -Wall -Wno-unknown-pragmas -Wno-sign-compare -std=c99 -fPIE -DTM_VERSION= -o src/external/streamvbyte_zigzag.o -c src/external/streamvbyte_zigzag.c -I/usr/local/include -isystem ./include -I./src -I/usr/include/lua5.1 fatal: not a git repository (or any of the parent directories): .git g++ -O3 -Wall -Wno-unknown-pragmas -Wno-sign-compare -std=c++14 -pthread -fPIE -DTM_VERSION= -o src/geojson_processor.o -c src/geojson_processor.cpp -I/usr/local/include -isystem ./include -I./src -I/usr/include/lua5.1 ^Cmake: *** [Makefile:206: src/geojson_processor.o] Interrupt

systemed commented 7 months ago

OK I removed luajit and installed lua 5.1 and that's fixed it. Either way the list of packages to install is wrong - if its going to include liblua5.1-0-dev then it should also include lua5.1

I don't think that's the issue: if you install liblua5.1-0-dev then you get lua5.1 along with it AIUI. The issue is that you'd installed luajit but not libluajit-5.1-dev. tilemaker looks for LuaJIT first (because it's faster than other Luas), so it was trying to use that, but you hadn't installed the development headers.

Detecting Lua, and all the various places it can be installed, from the simple environment of a Makefile is hard. If you want to use an unusual setup (i.e. LuaJIT binary but no headers, Lua 5.1 binary and headers) then the CMake build will do a better job of that.

now it fails on fatal: not a git repository (or any of the parent directories): .git

It's not failing to build, it's just failing to get the tilemaker version number (which it gets from a git tag) - I'm guessing you're building from a downloaded zip rather than a git clone? Regardless, if you let it build then it will be fine.

StephenAtty commented 7 months ago

I'd run the apt install list in the docs - it looks like installing the dev package on 22.04 doesn't include the run time

sudo apt install liblua5.1-0-dev Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: liblua5.1-0-dev 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 122 kB of archives. After this operation, 817 kB of additional disk space will be used.

$ lua Command 'lua' not found, but can be installed with: sudo apt install lua5.1 # version 5.1.5-8.1build4, or sudo apt install lua5.2 # version 5.2.4-2 sudo apt install lua5.3 # version 5.3.6-1build1 sudo apt install lua5.4 # version 5.4.4-1 sudo apt install tarantool # version 2.6.0-1ubuntu3

systemed commented 7 months ago

Wow, that's curious. Ok, I'll take a look at the README - thanks.

StephenAtty commented 7 months ago

I did a make clean and it all worked OK - so I guess something got left behind

systemed commented 7 months ago

Excellent - glad it's working!