Skip to content

Can't compile on Mac OS #134

Description

@jkozniewski

When trying to build on Mac Book Pro M3 running mac os 15.7.3 (24G419) which is eqivalent of macos-latest in GHA runners, with all essential tools updated according to https://github.com/actions/runner-images/blob/main/images/macos/macos-15-arm64-Readme.md - like latest xcode, gcc, clang etc... i get following errors (preceded by few warnings):

In file included from /Users/jkozniewski/Documents/Resources/code/effort/OnnxStream/src/onnxstream.cpp:1:
In file included from /Users/jkozniewski/Documents/Resources/code/effort/OnnxStream/src/onnxstream.h:4:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:302:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/allocate_at_least.h:13:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/allocator_traits.h:304:9: error: no matching function for call to 'construct_at'
        _VSTD::construct_at(__p, _VSTD::forward<_Args>(__args)...);
        ^~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:715:17: note: expanded from macro '_VSTD'
#  define _VSTD std
                ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:811:21: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<onnxstream::Model::BatchCacheItem>>::construct<onnxstream::Model::BatchCacheItem, int, bool &, bool, std::shared_ptr<std::vector<onnxstream::Tensor>>, void, void>' requested here
    __alloc_traits::construct(this->__alloc(), std::__to_address(__tx.__pos_),
                    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:1600:9: note: in instantiation of function template specialization 'std::vector<onnxstream::Model::BatchCacheItem>::__construct_one_at_end<int, bool &, bool, std::shared_ptr<std::vector<onnxstream::Tensor>>>' requested here
        __construct_one_at_end(std::forward<_Args>(__args)...);
        ^
/Users/jkozniewski/Documents/Resources/code/effort/OnnxStream/src/onnxstream.cpp:2786:27: note: in instantiation of function template specialization 'std::vector<onnxstream::Model::BatchCacheItem>::emplace_back<int, bool &, bool, std::shared_ptr<std::vector<onnxstream::Tensor>>>' requested here
            m_batch_cache.emplace_back(0, unique, false /* is_batch */, std::move(v));
                          ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/construct_at.h:36:38: note: candidate template ignored: substitution failure [with _Tp = onnxstream::Model::BatchCacheItem, _Args = <int, bool &, bool, std::shared_ptr<std::vector<onnxstream::Tensor>>>]: no matching constructor for initialization of 'onnxstream::Model::BatchCacheItem'
_LIBCPP_HIDE_FROM_ABI constexpr _Tp* construct_at(_Tp* __location, _Args&&... __args) {
                                     ^
In file included from /Users/jkozniewski/Documents/Resources/code/effort/OnnxStream/src/onnxstream.cpp:1:
In file included from /Users/jkozniewski/Documents/Resources/code/effort/OnnxStream/src/onnxstream.h:4:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:302:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/allocate_at_least.h:13:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/allocator_traits.h:304:9: error: no matching function for call to 'construct_at'
        _VSTD::construct_at(__p, _VSTD::forward<_Args>(__args)...);
        ^~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:715:17: note: expanded from macro '_VSTD'
#  define _VSTD std
                ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:811:21: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<onnxstream::Model::BatchCacheItem>>::construct<onnxstream::Model::BatchCacheItem, int, bool &, bool, std::shared_ptr<std::vector<onnxstream::Tensor>> &, void, void>' requested here
    __alloc_traits::construct(this->__alloc(), std::__to_address(__tx.__pos_),
                    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:1600:9: note: in instantiation of function template specialization 'std::vector<onnxstream::Model::BatchCacheItem>::__construct_one_at_end<int, bool &, bool, std::shared_ptr<std::vector<onnxstream::Tensor>> &>' requested here
        __construct_one_at_end(std::forward<_Args>(__args)...);
        ^
/Users/jkozniewski/Documents/Resources/code/effort/OnnxStream/src/onnxstream.cpp:2790:27: note: in instantiation of function template specialization 'std::vector<onnxstream::Model::BatchCacheItem>::emplace_back<int, bool &, bool, std::shared_ptr<std::vector<onnxstream::Tensor>> &>' requested here
            m_batch_cache.emplace_back(0, unique, true /* is_batch */, t.m_batch);
                          ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/construct_at.h:36:38: note: candidate template ignored: substitution failure [with _Tp = onnxstream::Model::BatchCacheItem, _Args = <int, bool &, bool, std::shared_ptr<std::vector<onnxstream::Tensor>> &>]: no matching constructor for initialization of 'onnxstream::Model::BatchCacheItem'
_LIBCPP_HIDE_FROM_ABI constexpr _Tp* construct_at(_Tp* __location, _Args&&... __args) {
                                     ^
/Users/jkozniewski/Documents/Resources/code/effort/OnnxStream/src/onnxstream.cpp:8041:21: warning: enumeration values 'none', 'uint8', and 'int64' not handled in switch [-Wswitch]
            switch (t.m_type)
                    ^~~~~~~~
/Users/jkozniewski/Documents/Resources/code/effort/OnnxStream/src/onnxstream.cpp:8041:21: note: add missing switch cases
            switch (t.m_type)
                    ^
7 warnings and 2 errors generated.
make[2]: *** [CMakeFiles/sd.dir/onnxstream.cpp.o] Error 1
make[1]: *** [CMakeFiles/sd.dir/all] Error 2
make: *** [all] Error 2

Not sure if that's related to current issues with build process as discussed in #133 though with current workarounds build is successful on pi5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions