简体   繁体   中英

OSError during loading of C shared library in Python (undefined symbol:checkedCalloc)

I would like to ask for some help about following problem.

Some theory: I am using Ubuntu 12.04, python2.7 and I am trying to load C shared library (libFSToolbox.so) in python. I want to use PyFeat that is python wrapper for FEAST. I have compiled FEAST and FEAST prerequisite MIToolbox. The problematic libFSToolbox.so is results of compilation of FEAST

...and reality: Building and everything went quite fine, but when I am trying to to use feast there is problem during import

File "test.py", line 2, in <module>
from feast import *
File "/usr/local/lib/python2.7/dist-packages/feast.py", line 25, in <module>
libFSToolbox = c.CDLL("/home/peterd/VUT/ML/FEAST-master/libFSToolbox.so"); 
File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /home/peterd/VUT/ML/FEAST-master/libFSToolbox.so: undefined symbol:     
checkedCalloc

I have compiled c libraries as x64 ($(MAKE) libFSToolbox.so "CXXFLAGS = -O3 -fPIC -m64") and my python interpreter is also 64 (tried : python>> platform.machine() answer:'x86_64')

Thank you for your time

I think the problem is how the options to the linker are given in the Makefile for FEAST.

Two options are

1) Change the line in Makefile for FEAST

from LINKER = gcc

to

LINKER = ld

2) if you want to use gcc to link change the line 47 of the Makefile

from

$(LINKER) -lMIToolbox -lm -L$(MITOOLBOXPATH) -shared -o libFSToolbox.so $(objects)

to

$(LINKER) -L$(MITOOLBOXPATH) -shared -o libFSToolbox.so $(objects) -lMIToolbox -lm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM