ostis-ai/sc-machine

ScAddrHashFunc is not implemented for unsigned long

Closed this issue · 1 comments

Describe the bug
Linking sc-machine with scl-machine on macOS platform (MacBook Air M1 if that matters) requires a template function ScAddrHashFunc<unsigned long> which is not implemented. I do not have insights onto internals of sc-machine, so I can't say what would be the preferred fix for this.

To Reproduce

  1. Use Apple Clang 14 or 15 to build the sc-machine
  2. Link InferenceManager from scl-machine to sc-machine
  3. Observe a linker error:
ld: Undefined symbols:
ScAddrHashFunc<unsigned long>::operator()(ScAddr const&), referenced from:
    std::__1::__hash_iterator<std::__1::__hash_node<ScAddr, void*>*> std::__1::__hash_table<ScAddr, ScAddrHashFunc<unsigned long>, std::__1::equal_to<ScAddr>, std::__1::allocator<ScAddr>>::find<ScAddr>(ScAddr const&) in TemplateExpressionNode.cpp.o
    std::__1::pair<std::__1::__hash_iterator<std::__1::__hash_node<ScAddr, void*>*>, bool> std::__1::__hash_table<ScAddr, ScAddrHashFunc<unsigned long>, std::__1::equal_to<ScAddr>, std::__1::allocator<ScAddr>>::__emplace_unique_key_args<ScAddr, ScAddr const&>(ScAddr const&, ScAddr const&) in TemplateExpressionNode.cpp.o
    std::__1::__hash_table<ScAddr, ScAddrHashFunc<unsigned long>, std::__1::equal_to<ScAddr>, std::__1::allocator<ScAddr>>::__node_insert_multi(std::__1::__hash_node<ScAddr, void*>*) in InferenceManagerAbstract.cpp.o
    std::__1::unique_ptr<std::__1::__hash_node<ScAddr, void*>, std::__1::__hash_node_destructor<std::__1::allocator<std::__1::__hash_node<ScAddr, void*>>>> std::__1::__hash_table<ScAddr, ScAddrHashFunc<unsigned long>, std::__1::equal_to<ScAddr>, std::__1::allocator<ScAddr>>::__construct_node<ScAddr const&>(ScAddr const&) in InferenceManagerAbstract.cpp.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Expected behavior
sc-machine implements ScAddrHashFunc for all supported platforms (or scl-machine is forced to use any structures that are supported by sc-machine, whichever is more preferable)

Screenshots
image

Desktop (please complete the following information):

  • OS: macOS 14.0
  • Version 0.8.0 (f957ef7)

Additional context
Doesn't happen on the same machine under Linux, it looks like a platform-specific typedef issue. Type synchronization between sc-machine and scl-machine is required.

Fixed by #393