Issue with compiling C++ extension files

Hello everyone,

I am having issues compiling graph-tool C++ extensions. I am using graph-tool-py3.12 on Mac OSX arm64. When attempting to compile my C++ files:

g++-14 -O3 -fopenmp -std=gnu++17 -Wall -fPIC -Wno-deprecated-declarations `pkg-config --cflags --libs graph-tool-py3.12`  activity.cc -o libactivity.so

I get the following error:

Undefined symbols for architecture arm64:
  "graph_tool::ActionNotFound::ActionNotFound(std::type_info const&, std::vector<std::type_info const*, std::allocator<std::type_info const*>> const&)", referenced from:
      avg_layer_activity_bind(graph_tool::GraphInterface&, unsigned long, unsigned long) in ccSRkbFo.o
  "graph_tool::GraphException::~GraphException()", referenced from:
      graph_tool::ActionNotFound::~ActionNotFound() in ccSRkbFo.o
      graph_tool::ActionNotFound::~ActionNotFound() in ccSRkbFo.o
  "graph_tool::GraphException::what() const", referenced from:
      vtable for graph_tool::ActionNotFound in ccSRkbFo.o
  "graph_tool::GraphInterface::get_graph_view() const", referenced from:
      avg_layer_activity_bind(graph_tool::GraphInterface&, unsigned long, unsigned long) in ccSRkbFo.o
  "typeinfo for graph_tool::GraphException", referenced from:
      typeinfo for graph_tool::ActionNotFound in ccSRkbFo.o
  "_main", referenced from:
      <initial-undefines>
ld: symbol(s) not found for architecture arm64
collect2: error: ld returned 1 exit status
make: *** [libactivity.so] Error 1

My pkg-config currently locates to the following graph-tool binaries:

-pthread 
-I/opt/homebrew/Caskroom/miniconda/base/envs/mln/include 

-I/opt/homebrew/Caskroom/miniconda/base/envs/mln/lib/python3.12/site-packages/graph_tool/include 

-I/opt/homebrew/Caskroom/miniconda/base/envs/mln/lib/python3.12/site-packages/graph_tool/include/boost-workaround 

-I/opt/homebrew/Caskroom/miniconda/base/envs/mln/lib/python3.12/site-packages/graph_tool/include/pcg-cpp 

-I/Users/runner/miniforge3/conda-bld/graph-tool-suite_1719688869621/_build_env/lib/python3.12/site-packages/cairo/include 

-I/opt/homebrew/Caskroom/miniconda/base/envs/mln/include/python3.12 -I/opt/homebrew/Caskroom/miniconda/base/envs/mln/include 

-I/Users/runner/miniforge3/conda-bld/graph-tool-suite_1719688869621/_build_env/venv/lib/python3.12/site-packages/numpy/core/include 

-L/opt/homebrew/Caskroom/miniconda/base/envs/mln/lib 

-L/opt/homebrew/Caskroom/miniconda/base/envs/mln/lib/python3.12/site-packages/graph_tool -lboost_python312 -lpython3.12

I suspect there may be a library that’s missing?

UPDATE: it seems like the missing symbols reside in the libgraph_tool_core.so file which isn’t currently referenced by pkg-config. Now the issue is that libgraph_tool_core.so is a Mach-O bundle and cannot be linked.

How can I solve my issue?

Thank you for your help in advance