在Mac Big Sur(mac osx 10.11)上为arm64构建avrocpp库

时间:2020-08-31 21:42:30

标签: macos boost avro zlib macos-big-sur

我正在尝试在Mac Big Sur Mac OS 10.11(适用于ARM64)上构建avrocpp。安装boost和下载avro-cpp之后,当我从avro目录运行build.sh进行构建时,在编译avro的DataFile.cpp时出现以下错误(以及更多):

**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**

所有错误都在boost :: iostream-> zlib压缩器或解压缩器中

到目前为止,由于Homebrew不支持Mac Big sur进行增强(增强:修复arm64 build https://github.com/Homebrew/homebrew-core/pull/59257),并且在构建boost zlib和avrocpp时出现错误,我正尝试构建源代码,但越来越错误,并且这是我到目前为止尝试过的

  1. 使用architecture = arm构建的boost 1.74,并且还验证了创建的库是arm64(lipo -archs)

  2. 在avro目录中,修改了build.sh,修改了“ xcode-test”并添加了体系结构。这是修改后的命令

    xcode-test) mkdir -p build.xcode (cd build.xcode
    && cmake -G Xcode ..
    && xcodebuild -verbose ARCHS =“ arm64” ONLY_ACTIVE_ARCH = YES-配置发布) ;;

  3. 还更新CMakeLists.txt以指向我的boost目录。添加的行:

    项目(Avro-cpp) 设置(Boost_NO_SYSTEM_PATHS TRUE) 如果(Boost_NO_SYSTEM_PATHS) 设置(BOOST_ROOT“ /用户/一个/下载/ boost_1_74_0”) 设置(Boost_DIR“ /用户/一个/下载/ boost_1_74_0”) 设置(BOOST_INCLUDE_DIRS“ $ {BOOST_ROOT} / boost”) 设置(BOOST_LIBRARY_DIRS“ $ {BOOST_ROOT} / stage_mac32_64 / lib”) 设置(Boost_LIBRARY_DIR_RELEASE“ $ {BOOST_ROOT} / stage_mac32_64 / lib”) endif(Boost_NO_SYSTEM_PATHS)

  4. 运行命令:./build.sh xcode-test 在boost :: iostream-> zlib

    中返回了相同的错误
  5. 下载了zlib源代码,我尝试通过指定zlib源代码来构建boost :: iostream,同样的错误。命令:

./ 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”

如果有人尝试在Mac big sur上为arm64构建avrocpp,请提供帮助。

0 个答案:

没有答案