tilemaker icon indicating copy to clipboard operation
tilemaker copied to clipboard

Build failure version 2.2 with GCC

Open Nakaner opened this issue 2 years ago • 6 comments

Building version 2.2 fails with:

[  8%] Building CXX object CMakeFiles/tilemaker.dir/src/read_pbf.cpp.o
/usr/bin/c++  -DBOOST_ALL_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_IOSTREAMS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -I/home/michael/git/github.com/systemed/Tilemaker/include -I/home/michael/git/github.com/systemed/Tilemaker/build -I/usr/include/lua5.1  -O3 -DNDEBUG   -std=gnu++14 -o CMakeFiles/tilemaker.dir/src/read_pbf.cpp.o -c /home/michael/git/github.com/systemed/Tilemaker/src/read_pbf.cpp
/home/michael/git/github.com/systemed/Tilemaker/src/read_pbf.cpp: In member function ‘bool PbfReader::ReadWays(OsmLuaProcessing&, PrimitiveGroup&, const PrimitiveBlock&, bool)’:
/home/michael/git/github.com/systemed/Tilemaker/src/read_pbf.cpp:83:28: error: ‘class Way’ has no member named ‘lats_size’; did you mean ‘vals_size’?
   83 |     for (int k=0; k<pbfWay.lats_size(); k++) {
      |                            ^~~~~~~~~
      |                            vals_size
/home/michael/git/github.com/systemed/Tilemaker/src/read_pbf.cpp:84:20: error: ‘class Way’ has no member named ‘lats’
   84 |      lat += pbfWay.lats(k);
      |                    ^~~~
/home/michael/git/github.com/systemed/Tilemaker/src/read_pbf.cpp:85:20: error: ‘class Way’ has no member named ‘lons’
   85 |      lon += pbfWay.lons(k);
      |                    ^~~~

/usr/bin/c++ points to g++.

I removed the build directory and re-run cmake again but it did not help.

Nakaner avatar Mar 22 '22 16:03 Nakaner

Works fine for me with g++ 9.4.0 on Ubuntu 20.04.

https://github.com/systemed/tilemaker/commit/ad1fcfbdf31e3b437d97d8497ed565b538e371c7 added support for osmium's LocationsOnWays format, which extends the .osm.pbf format with (optional) lats and lons. That's what the error message is complaining about here, so I suspect you're still building with an older version of the .proto file somehow.

systemed avatar Mar 22 '22 18:03 systemed

The .proto files are checked in into Git and are not modified by the build process:

michael@hopscotch:~/git/github.com/systemed/Tilemaker$ find . -name "*.proto"
./include/vector_tile.proto
./include/osmformat.proto
michael@hopscotch:~/git/github.com/systemed/Tilemaker$ git status 
Auf Branch master
Ihr Branch ist auf demselben Stand wie 'upstream/master'.

Unversionierte Dateien:
  (benutzen Sie "git add <Datei>...", um die Änderungen zum Commit vorzumerken)
	.cproject
	.project
	.settings/
	build/

nichts zum Commit vorgemerkt, aber es gibt unversionierte Dateien
(benutzen Sie "git add" zum Versionieren)
michael@hopscotch:~/git/github.com/systemed/Tilemaker$ git log -p include/osmformat.proto
commit ad1fcfbdf31e3b437d97d8497ed565b538e371c7
Author: Richard Fairhurst <[email protected]>
Date:   Sat Feb 26 16:58:44 2022 +0000

    Support osmium locations-on-ways format (#386)

I use G++ 9.4.0.

Nakaner avatar Mar 23 '22 17:03 Nakaner

Ok. If you run grep lats_size include/osmformat.pb.h (from the tilemaker directory) does it output anything?

systemed avatar Mar 23 '22 17:03 systemed

No output.

Nakaner avatar Mar 23 '22 17:03 Nakaner

Ok. The .proto contains lats and lons - https://github.com/systemed/tilemaker/blob/master/include/osmformat.proto#L203 - so if protoc is compiling the .proto correctly, lats_size should be in there.

I wonder if maybe you have an old osmformat.pb.h in your include/ directory (from make) and a new one in your build/ directory (from cmake). Try make clean to remove the artefacts from make, then rm -rf build and recreate as usual for cmake, and see if that fixes it.

systemed avatar Mar 23 '22 17:03 systemed

Did you get this resolved, @Nakaner?

systemed avatar Mar 29 '22 08:03 systemed