Building avrocpp library on Mac Big Sur (mac osx 10.11) for arm64

Viewed 328

I am trying to build avrocpp on Mac Big Sur Mac OS 10.11) for ARM64. After installing boost and downloading avro-cpp, when I run the build.sh from avro directory to build, getting following error (and many more) when DataFile.cpp of avro is being compiled:

**Undefined symbols for architecture arm64:
  "boost::iostreams::zlib_error::check(int)", referenced from:
      long boost::iostreams::symmetric_filter<boost::iostreams::detail::zlib_compressor_impl<std::__1::allocator<char> >, std::__1::allocator<char> >::write<boost::iostreams::detail::linked_streambuf<char, std::__1::char_traits<char> > >(boost::iostreams::detail::linked_streambuf<char, std::__1::char_traits<char> >&, char const*, long) in DataFile.o**

All the errors are in boost::iostream -> zlib compressor or decompressor

As of now since Homebrew doesn't support Mac Big sur for boost (boost: fix arm64 build https://github.com/Homebrew/homebrew-core/pull/59257) and it is giving errors when building boost zlib and avrocpp, I am tring to build the source but getting the error and here is what I have tried so far:

  1. boost 1.74 built with architecture=arm and also verified that the libs created are arm64 (lipo -archs)

  2. In avro directory, modified the build.sh modified 'xcode-test' and added architecture. Here is the modified command

    xcode-test) mkdir -p build.xcode (cd build.xcode
    && cmake -G Xcode ..
    && xcodebuild -verbose ARCHS="arm64" ONLY_ACTIVE_ARCH=YES -configuration Release ) ;;

  3. Also update CMakeLists.txt to point to my boost directory. Added lines:

    project (Avro-cpp) set(Boost_NO_SYSTEM_PATHS TRUE) if (Boost_NO_SYSTEM_PATHS) set(BOOST_ROOT "/Users/a/Downloads/boost_1_74_0") set(Boost_DIR "/Users/a/Downloads/boost_1_74_0") set(BOOST_INCLUDE_DIRS "${BOOST_ROOT}/boost") set(BOOST_LIBRARY_DIRS "${BOOST_ROOT}/stage_mac32_64/lib") set(Boost_LIBRARY_DIR_RELEASE "${BOOST_ROOT}/stage_mac32_64/lib") endif (Boost_NO_SYSTEM_PATHS)

  4. Ran the command: ./build.sh xcode-test returned the same error in boost::iostream ->zlib

  5. Downloaded zlib source and I tried building boost::iostream by speicfying zlib source, same error. Command:

./b2 --toolset=clang --with-iostreams --layout=versioned --build-type=complete threading=multi runtime-link=static architecture=arm address-model=64 --stagedir=stage_mac32_64 stage --debug-configuration -s ZLIB_SOURCE="/Users/a/Downloads/zlib-1.2.11"

If anyone has tried build avrocpp on Mac big sur for arm64 Please help.

0 Answers
Related