nod-ai / SHARK-Platform

SHARK Inference Modeling and Serving
Apache License 2.0
9 stars 19 forks source link

Issue building libshortfin with GCC #215

Closed marbre closed 6 days ago

marbre commented 1 week ago

Trying to build libshortfin with GCC 13.2.0

cmake \
  -GNinja -S. -Bbuild \
  -DCMAKE_C_COMPILER=gcc \
  -DCMAKE_CXX_COMPILER=g++ \
  -DSHORTFIN_BUNDLE_DEPS=ON

cmake \
  --build build \
  --target all

the build fails with

[build] SHARK-Platform/libshortfin/src/shortfin/local/messaging.cc: In constructor ‘shortfin::local::{anonymous}::QueueCreator::QueueCreator(shortfin::local::Queue::Options)’:
[build] SHARK-Platform/libshortfin/src/shortfin/local/messaging.cc:26:59: error: ‘shortfin::local::Queue::Queue(Options)’ is private within this context
[build]    26 |   QueueCreator(Options options) : Queue(std::move(options)) {}
[build]       |                                                           ^
[build] In file included from SHARK-Platform/libshortfin/src/shortfin/local/messaging.cc:7:
[build] SHARK-Platform/libshortfin/src/shortfin/local/messaging.h:195:3: note: declared private here
[build]   195 |   Queue(Options options);
[build]       |   ^~~~~

Moving QueueCreator outside off its anonymous namespace solves the issue but their might be other options (beside making https://github.com/nod-ai/SHARK-Platform/blob/a9d3d4154a5333981880fd521b8977fb662b3229/libshortfin/src/shortfin/local/messaging.h#L195 public).