Skip to content

ImportError: Undefined symbol when importing aidge_core module

I encountered an ImportError when trying to import the aidge_core, aidge_backend_cpu and aidge_onnx modules. I have already attempted to resolve the issue based on solutions from issues #9 and #32, but the problem persists.

Below are the details of the aidge_core module import issue:

Error details:

Python 3.8.12 | packaged by conda-forge | (default, Sep 29 2021, 19:50:30) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import aidge_core
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/marwa/.conda/envs/aidge/lib/python3.8/site-packages/aidge_core/__init__.py", line 10, in <module>
    from aidge_core.aidge_core import * # import so generated by PyBind
ImportError: /home/marwa/.conda/envs/aidge/lib/python3.8/site-packages/aidge_core/aidge_core.cpython-38-x86_64-linux-gnu.so: `undefined symbol: _ZNK5Aidge10Dropout_Op20getAvailableBackendsB5cxx11Ev

Conda virtual environment details:

  • Python version: 3.8.12
  • aidge_core version: 0.4.1.dev17+g2a22b3bc.d20241218
  • cmake version: 3.31.2
  • fmt version: 10.2.1
  • Operating system: Ubuntu 22.04

GCC compiler and libgcc library versions in the environment:

  • _libgcc_mutex version: 0.1
  • gcc version: 12.1.0
  • gcc_impl_linux-64 version: 12.1.0
  • gcc_linux-64 version: 12.1.0
  • libgcc version: 14.2.0
  • libgcc-devel_linux-64 version: 12.1.0
  • libgcc-ng version: 14.2.0

Reproduced steps:

  1. Installed the aidge_core, aidge_backend_cpu, and aidge_onnx modules in a Conda environment using pip.
  2. Attempted to import the aidge_core module using import aidge_core.

Expected behavior:

The modules should import without any errors.

Observed behavior:

An ImportError is raised indicating an undefined symbol: _ZNK5Aidge10Dropout_Op20getAvailableBackendsB5cxx11Ev.

Questions:

  1. Is there a step that I am missing where I add the link to the dropout.cpp during the building process?
  2. Do you have any tutorial, example or commit where you added an operator on the CPU backend that I could follow?
  3. Could this be due to a mismatch between the compiled .so file and my GCC version or Python ABI?
Edited by Marwa ABDELOUINISSE