[OSM-dev] libosmium / osmi-addresses

Florian Lohoff f at zz.de
Tue Mar 3 10:55:20 UTC 2015


Had anyone success in building libosmium/osmi-addresses on wheezy
lately? I stumbled upon the following issues:


- You need a better c++/clang so i installed clang-3.5 from 
  deb http://llvm.org/apt/wheezy/ llvm-toolchain-wheezy main

- Building libosmium with

  export CC=/usr/bin/clang-3.5
  export CXX=/usr/bin/clang++-3.5

  fails in finding my backported libsparsehash-dev 2.0.2-1 package
  or better fails to compile the testcase from cmake to find the size.

	-- Check size of google::sparsetable<int>::size_type
	-- Check size of google::sparsetable<int>::size_type - failed
	CMake Warning at cmake/FindOsmium.cmake:244 (message):
	  Osmium: Disabled Google SparseHash library because we can't detect whether
	  we are on a 64bit system.
	Call Stack (most recent call first):
	  CMakeLists.txt:73 (find_package)
 
  Which is a strange error in finding "iterator" - I have no clue about c++ but this
  sounds really weird. CMakeError.log:

	Determining size of google::sparsetable<int>::size_type failed with the following output:
	Change Dir: /opt/addr/libosmium/build/CMakeFiles/CMakeTmp

	Run Build Command:/usr/bin/make "cmTryCompileExec471435021/fast"
	/usr/bin/make -f CMakeFiles/cmTryCompileExec471435021.dir/build.make CMakeFiles/cmTryCompileExec471435021.dir/build
	make[1]: Entering directory `/opt/addr/libosmium/build/CMakeFiles/CMakeTmp'
	/usr/bin/cmake -E cmake_progress_report /opt/addr/libosmium/build/CMakeFiles/CMakeTmp/CMakeFiles 1
	Building C object CMakeFiles/cmTryCompileExec471435021.dir/SPARSETABLE_SIZE_TYPE.c.o
	/usr/bin/clang-3.5    -o CMakeFiles/cmTryCompileExec471435021.dir/SPARSETABLE_SIZE_TYPE.c.o   -c /opt/addr/libosmium/build/CMakeFiles/CheckTypeSize/SPARSETABLE_SIZE_TYPE.c
	In file included from /opt/addr/libosmium/build/CMakeFiles/CheckTypeSize/SPARSETABLE_SIZE_TYPE.c:4:
	In file included from /usr/include/google/sparsetable:34:
	/usr/include/sparsehash/sparsetable:241:10: fatal error: 'iterator' file not found
	#include <iterator>             // to define reverse_iterator for me
		 ^
	1 error generated.
	make[1]: Leaving directory `/opt/addr/libosmium/build/CMakeFiles/CMakeTmp'
	make[1]: *** [CMakeFiles/cmTryCompileExec471435021.dir/SPARSETABLE_SIZE_TYPE.c.o] Error 1
	make: *** [cmTryCompileExec471435021/fast] Error 2

	/opt/addr/libosmium/build/CMakeFiles/CheckTypeSize/SPARSETABLE_SIZE_TYPE.c:
	#include <sys/types.h>
	#include <stdint.h>
	#include <stddef.h>
	#include "google/sparsetable"


	#undef KEY
	[ ... ]

        I guess this is a clang-3.5/libstdc++ issue. Works on Debian/Jessie with gcc 4.9

- When trying to build osmi-addresses it fails because of class renaming in libosmium.

	/usr/bin/clang++-3.5 -I. -O3 -std=c++11 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wextra -pedantic -Wredundant-decls -Wdisabled-optimization -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wsign-promo -Wold-style-cast -I/usr/include/gdal -o osmi main.cpp  -lexpat -pthread -lz -lprotobuf-lite -losmpbf -lz -lbz2 -L/usr/lib -lgeos-3.3.3 -L/usr/lib -lgdal -lboost_program_options ; touch last_use_of_gcc.tmp
	main.cpp:18:10: fatal error: 'osmium/index/map/sparse_table.hpp' file not found
	#include <osmium/index/map/sparse_table.hpp>

- Going back to last libosmium commit before renaming 

        git checkout -b older 97b4d34a5821435ac23cd8293fef41cf0a380bd4

    breaks in other libosmium c++ stuff.

	/usr/bin/clang++-3.5 -I. -O3 -std=c++11 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wextra -pedantic -Wredundant-decls -Wdisabled-optimization -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wsign-promo -Wold-style-cast -I/usr/include/gdal -o osmi main.cpp  -lexpat -pthread -lz -lprotobuf-lite -losmpbf -lz -lbz2 -L/usr/lib -lgeos-3.3.3 -L/usr/lib -lgdal -lboost_program_options ; touch last_use_of_gcc.tmp
	In file included from main.cpp:23:
	In file included from ./osmium/visitor.hpp:38:
	In file included from ./osmium/io/reader_iterator.hpp:36:
	In file included from ./osmium/io/reader.hpp:55:
	In file included from ./osmium/io/detail/input_format.hpp:43:
	./osmium/io/file.hpp:176:35: error: unexpected ':' in nested name specifier; did you mean '::'?
			for (auto& option : options) {
					  ^
					  ::
	./osmium/io/file.hpp:176:37: error: definition or redeclaration of 'options' not allowed inside a function
			for (auto& option : options) {
				   ~~~~~~~~ ^
	./osmium/io/file.hpp:176:44: error: expected ';' in 'for' statement specifier
			for (auto& option : options) {

	[...]

    This breaks at a different location on Debian/Jessie with gcc4.9

	g++ -O3 -I. -std=c++11 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wextra -pedantic -Wredundant-decls -Wdisabled-optimization -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wsign-promo -Wold-style-cast -I/usr/include/gdal -o osmi main.cpp  -lexpat -pthread -lz -lprotobuf-lite -losmpbf -lz -lbz2 -L/usr/lib -lgeos-3.4.2 -L/usr/lib -lgdal -lboost_program_options ; touch last_use_of_gcc.tmp
	In file included from main.cpp:18:0:
	./osmium/index/map/sparse_table.hpp: In instantiation of ‘void osmium::index::map::SparseTable<TId, TValue>::dump_as_list(int) const [with TId = long unsigned int; TValue = AltTagList]’:
	main.cpp:95:1:   required from here
	./osmium/index/map/sparse_table.hpp:124:35: error: no match for ‘operator!=’ (operand types are ‘const AltTagList’ and ‘AltTagList’)
				 if (value != osmium::index::empty_value<TValue>()) {
					   ^
	./osmium/index/map/sparse_table.hpp:124:35: note: candidates are:
	In file included from ./osmium/handler/node_locations_for_ways.hpp:41:0,
			 from main.cpp:22:
	./osmium/osm/location.hpp:245:34: note: constexpr bool osmium::operator!=(const osmium::Location&, const osmium::Location&)
	     inline OSMIUM_CONSTEXPR bool operator!=(const Location& lhs, const Location& rhs) noexcept {

    I once had a working libosmium state building osmi and thats c8a4ee68181a51f3168f83b516b2cc1c720f95b7 which still builds on
    jessie.

- My osmi build from libosmium c8a4ee68181a51f3168f83b516b2cc1c720f95b7 and osmi-addresses 4dd06179420d82fd77d08757f73cc2216c915b05 
  which i got build mid of last year barfs at the current germany extract of mine:

	~/bin/osmi  ~/germany.osm.pbf germany
	node processing in FirstHandler finished
	terminate called after throwing an instance of 'std::out_of_range'
	  what():  Missing location
	Aborted

As all production machines i have are Wheezy i am lost here.

Flo
-- 
Florian Lohoff                                                 f at zz.de
     We need to self-defense - GnuPG/PGP enable your email today!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20150303/b03d6ec9/attachment-0001.sig>


More information about the dev mailing list