osmcode / libosmium

Fast and flexible C++ library for working with OpenStreetMap data.
https://osmcode.org/libosmium/
Boost Software License 1.0
472 stars 114 forks source link

Does libosmium work with MacOS (M series chip) #362

Closed jiawlu closed 1 year ago

jiawlu commented 1 year ago

What version of libosmium are you using?

v2.19.0

What operating system and compiler are you using?

MacOS 13.2.1 Homebrew clang version 15.0.6

I encountered the following problems when compiling my project. It seems some symbols used in osmium are not available on architecture arm64.

Undefined symbols for architecture arm64:
  "_BZ2_bzDecompress", referenced from:
      osmium::io::Bzip2BufferDecompressor::read() in main.cpp.o
  "_BZ2_bzDecompressEnd", referenced from:
      osmium::io::Bzip2BufferDecompressor::close() in main.cpp.o
  "_BZ2_bzDecompressInit", referenced from:
      osmium::io::Bzip2BufferDecompressor::Bzip2BufferDecompressor(char const*, unsigned long) in main.cpp.o
  "_BZ2_bzRead", referenced from:
      osmium::io::Bzip2Decompressor::read() in main.cpp.o
  "_BZ2_bzReadClose", referenced from:
      osmium::io::Bzip2Decompressor::read() in main.cpp.o
      osmium::io::Bzip2Decompressor::close() in main.cpp.o
  "_BZ2_bzReadGetUnused", referenced from:
      osmium::io::Bzip2Decompressor::read() in main.cpp.o
  "_BZ2_bzReadOpen", referenced from:
      osmium::io::Bzip2Decompressor::Bzip2Decompressor(int) in main.cpp.o
      osmium::io::Bzip2Decompressor::read() in main.cpp.o
  "_BZ2_bzWrite", referenced from:
      osmium::io::Bzip2Compressor::write(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in main.cpp.o
  "_BZ2_bzWriteClose64", referenced from:
      osmium::io::Bzip2Compressor::close() in main.cpp.o
  "_BZ2_bzWriteOpen", referenced from:
      osmium::io::Bzip2Compressor::Bzip2Compressor(int, osmium::io::fsync) in main.cpp.o
  "_BZ2_bzerror", referenced from:
      osmium::io::detail::throw_bzip2_error(void*, char const*, int) in main.cpp.o
  "_XML_ErrorString", referenced from:
      osmium::xml_error::xml_error(XML_ParserStruct* const&) in main.cpp.o
  "_XML_GetCurrentColumnNumber", referenced from:
      osmium::xml_error::xml_error(XML_ParserStruct* const&) in main.cpp.o
  "_XML_GetCurrentLineNumber", referenced from:
      osmium::xml_error::xml_error(XML_ParserStruct* const&) in main.cpp.o
  "_XML_GetErrorCode", referenced from:
      osmium::xml_error::xml_error(XML_ParserStruct* const&) in main.cpp.o
  "_XML_Parse", referenced from:
      osmium::io::detail::XMLParser::ExpatXMLParser::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) in main.cpp.o
  "_XML_ParserCreate", referenced from:
      osmium::io::detail::XMLParser::ExpatXMLParser::ExpatXMLParser(void*) in main.cpp.o
  "_XML_ParserFree", referenced from:
      osmium::io::detail::XMLParser::ExpatXMLParser::~ExpatXMLParser() in main.cpp.o
  "_XML_SetCharacterDataHandler", referenced from:
      osmium::io::detail::XMLParser::ExpatXMLParser::ExpatXMLParser(void*) in main.cpp.o
  "_XML_SetElementHandler", referenced from:
      osmium::io::detail::XMLParser::ExpatXMLParser::ExpatXMLParser(void*) in main.cpp.o
  "_XML_SetEntityDeclHandler", referenced from:
      osmium::io::detail::XMLParser::ExpatXMLParser::ExpatXMLParser(void*) in main.cpp.o
  "_XML_SetUserData", referenced from:
      osmium::io::detail::XMLParser::ExpatXMLParser::ExpatXMLParser(void*) in main.cpp.o
  "_XML_StopParser", referenced from:
      void osmium::io::detail::XMLParser::ExpatXMLParser::member_wrap<osmium::io::detail::XMLParser::ExpatXMLParser::start_element_wrapper(void*, char const*, char const**)::'lambda'(osmium::io::detail::XMLParser&)>(osmium::io::detail::XMLParser&, osmium::io::detail::XMLParser::ExpatXMLParser::start_element_wrapper(void*, char const*, char const**)::'lambda'(osmium::io::detail::XMLParser&)&&) in main.cpp.o
      void osmium::io::detail::XMLParser::ExpatXMLParser::member_wrap<osmium::io::detail::XMLParser::ExpatXMLParser::end_element_wrapper(void*, char const*)::'lambda'(osmium::io::detail::XMLParser&)>(osmium::io::detail::XMLParser&, osmium::io::detail::XMLParser::ExpatXMLParser::end_element_wrapper(void*, char const*)::'lambda'(osmium::io::detail::XMLParser&)&&) in main.cpp.o
      void osmium::io::detail::XMLParser::ExpatXMLParser::member_wrap<osmium::io::detail::XMLParser::ExpatXMLParser::character_data_wrapper(void*, char const*, int)::'lambda'(osmium::io::detail::XMLParser&)>(osmium::io::detail::XMLParser&, osmium::io::detail::XMLParser::ExpatXMLParser::character_data_wrapper(void*, char const*, int)::'lambda'(osmium::io::detail::XMLParser&)&&) in main.cpp.o
      void osmium::io::detail::XMLParser::ExpatXMLParser::member_wrap<osmium::io::detail::XMLParser::ExpatXMLParser::entity_declaration_handler(void*, char const*, int, char const*, int, char const*, char const*, char const*, char const*)::'lambda'(osmium::io::detail::XMLParser&)>(osmium::io::detail::XMLParser&, osmium::io::detail::XMLParser::ExpatXMLParser::entity_declaration_handler(void*, char const*, int, char const*, int, char const*, char const*, char const*, char const*)::'lambda'(osmium::io::detail::XMLParser&)&&) in main.cpp.o
  "_gzclose_r", referenced from:
      osmium::io::GzipDecompressor::close() in main.cpp.o
  "_gzclose_w", referenced from:
      osmium::io::GzipCompressor::close() in main.cpp.o
  "_gzdopen", referenced from:
      osmium::io::GzipCompressor::GzipCompressor(int, osmium::io::fsync) in main.cpp.o
      osmium::io::GzipDecompressor::GzipDecompressor(int) in main.cpp.o
  "_gzerror", referenced from:
      osmium::io::detail::throw_gzip_error(gzFile_s*, char const*) in main.cpp.o
  "_gzoffset", referenced from:
      osmium::io::GzipDecompressor::read() in main.cpp.o
  "_gzread", referenced from:
      osmium::io::GzipDecompressor::read() in main.cpp.o
  "_gzwrite", referenced from:
      osmium::io::GzipCompressor::write(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in main.cpp.o
  "_inflate", referenced from:
      osmium::io::GzipBufferDecompressor::read() in main.cpp.o
  "_inflateEnd", referenced from:
      osmium::io::GzipBufferDecompressor::close() in main.cpp.o
  "_inflateInit2_", referenced from:
      osmium::io::GzipBufferDecompressor::GzipBufferDecompressor(char const*, unsigned long) in main.cpp.o
  "_uncompress", referenced from:
      osmium::io::detail::zlib_uncompress_string(char const*, unsigned long, unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) in main.cpp.o
     (maybe you meant: osmium::io::detail::zlib_uncompress_string(char const*, unsigned long, unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&))
  "_zError", referenced from:
      osmium::io::detail::zlib_uncompress_string(char const*, unsigned long, unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) in main.cpp.o
ld: symbol(s) not found for architecture arm64
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.