Skip to content

xgboost 2.0 build fails on osx because of a overridden virtual function caused by std::make_shared #9601

Closed
@tylerjthomas9

Description

@tylerjthomas9

I am trying to build xgboost 2.0 for Julia. However, I am struggling to get the osx builds to work. I have narrowed it down to this commit that is causing issues with the osx build. I see that there are previous conversations on std::make_shared, but I am struggling to find any solutions for building with libc.

[19:46:11] In file included from /workspace/srcdir/xgboost/src/common/io.cc:25:
--
  | [19:46:11] In file included from /opt/aarch64-apple-darwin20/aarch64-apple-darwin20/sys-root/usr/include/c++/v1/algorithm:644:
  | [19:46:11] /opt/aarch64-apple-darwin20/aarch64-apple-darwin20/sys-root/usr/include/c++/v1/memory:3658:7: error: exception specification of overriding function is more lax than base version
  | [19:46:11] class __shared_ptr_emplace
  | [19:46:11]       ^
  | [19:46:11] /opt/aarch64-apple-darwin20/aarch64-apple-darwin20/sys-root/usr/include/c++/v1/memory:4331:26: note: in instantiation of template class 'std::__shared_ptr_emplace<xgboost::common::MmapResource, std::allocator<xgboost::common::MmapResource>>' requested here
  | [19:46:11]     ::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
  | [19:46:11]                          ^
  | [19:46:11] /opt/aarch64-apple-darwin20/aarch64-apple-darwin20/sys-root/usr/include/c++/v1/memory:4710:29: note: in instantiation of function template specialization 'std::shared_ptr<xgboost::common::MmapResource>::make_shared<std::basic_string<char> &, unsigned long &, unsigned long &>' requested here
  | [19:46:11]     return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
  | [19:46:11]                             ^
  | [19:46:11] /workspace/srcdir/xgboost/src/common/io.h:387:40: note: in instantiation of function template specialization 'std::make_shared<xgboost::common::MmapResource, std::basic_string<char> &, unsigned long &, unsigned long &>' requested here
  | [19:46:11]       : AlignedResourceReadStream{std::make_shared<MmapResource>(path, offset, length)} {}
  | [19:46:11]                                        ^
  | [19:46:11] /opt/aarch64-apple-darwin20/aarch64-apple-darwin20/sys-root/usr/include/c++/v1/memory:3567:13: note: overridden virtual function is here
  | [19:46:11]     virtual ~__shared_weak_count();
  | [19:46:11]             ^

The full build log is here: https://buildkite.com/julialang/yggdrasil/builds/5173#018a9a59-ab3d-4d6d-937b-6179b2f6ac71

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions