I am working on a project that uses foma in Python, and saw you had created this library with the code from foma's own Github, and wanted to ask about an error I am encountering with both (considering the issues on the actual repo are rarely answered).
When using foma in my Python code, either after installing this package or using the file given in foma's repo, I find that I get:
File "/root/reconstruct/reconstruct.py", line 2, in <module>
from foma import FST
File "/usr/local/lib/python3.9/dist-packages/foma/__init__.py", line 111, in <module>
foma_add_defined_function = foma.add_defined_function
File "/usr/lib/python3.9/ctypes/__init__.py", line 387, in __getattr__
func = self.__getitem__(name)
File "/usr/lib/python3.9/ctypes/__init__.py", line 392, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /lib/x86_64-linux-gnu/libfoma.so.0: undefined symbol: add_defined_function
0000000000006130 g DF .text 00000000000000c8 Base add_defined
00000000000141f0 g DF .text 00000000000000d9 Base load_defined
0000000000013dc0 g DF .text 00000000000000b8 Base save_defined
0000000000005eb0 g DF .text 000000000000000f Base defined_networks_init
0000000000005ec0 g DF .text 000000000000000f Base defined_functions_init
I have found that a solution to have this work is to just comment out lines 111 and 112, along with the function definef
of your __init__.py
/ foma.py
as I am not currently using this in my program. I was wondering whether you have gotten this to work without the error, and if so how? Is it possible I am somehow on a wrong version of libfoma
? Thank you for any help!