orsic / swiftnet

GNU General Public License v3.0
251 stars 54 forks source link

Undefined symbols for architecture x86_64 #10

Open zelin opened 5 years ago

zelin commented 5 years ago

Hi,

I am trying to compile cylib module however I am getting error,

This is the modifications i did in my build.sh

rm cylib.so

cython -a cylib.pyx -o cylib.cc

#gcc -shared -pthread -fPIC -fwrapv -O2 -Wall -fno-strict-aliasing \
#  -I/usr/include/python3.5m -o cylib.so cylib.c
g++ -shared -pthread -fPIC -fwrapv -O3 -Wall -fno-strict-aliasing \
-I/usr/local/lib/python3.7/site-packages/numpy/core/include -I/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/include/python3.7m -o cylib.so cylib.cc -std=c++11
#-I/usr/lib/python3.7/site-packages/numpy/core/include -I/usr/include/python3.7m -o cylib.so cylib.cc
  #-I/usr/include/python3.6m -o cylib.so cylib.cc
#g++ -shared -pthread -fopenmp -fPIC -fwrapv -O2 -Wall -fno-strict-aliasing \
#  -I/usr/include/python3.5m -o cylib.so cylib.cc

After compiling its giving a long error

rm: cylib.so: No such file or directory
/usr/local/lib/python3.7/site-packages/Cython/Compiler/Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /Volumes/MacOx/Study/Advanced Al/Project/SWIFTNET/lib/cylib.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
In file included from cylib.cc:598:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822:
/usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with "
      "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it with " \
 ^
1 warning generated.
Undefined symbols for architecture x86_64:
  "_PyBaseObject_Type", referenced from:
      __pyx_pw_5cylib_1collect_confusion_matrix(_object*, _object*, _object*) in cylib-352273.o
      __pyx_pw_5cylib_3collect_disp_class_matrices(_object*, _object*, _object*) in cylib-352273.o
      __pyx_pw_5cylib_5convert_colors_to_ids(_object*, _object*, _object*) in cylib-352273.o
  "_PyBuffer_Release", referenced from:
      __pyx_pw_5cylib_1collect_confusion_matrix(_object*, _object*, _object*) in cylib-352273.o
      __Pyx__GetBufferAndValidate(bufferinfo*, _object*, __Pyx_TypeInfo*, int, int, int, __Pyx_BufFmt_StackElem*) in cylib-352273.o
      __pyx_pw_5cylib_3collect_disp_class_matrices(_object*, _object*, _object*) in cylib-352273.o
      __pyx_pw_5cylib_5convert_colors_to_ids(_object*, _object*, _object*) in cylib-352273.o
  "_PyBytes_FromStringAndSize", referenced from:
      __pyx_pymod_exec_cylib(_object*) in cylib-352273.o
  "_PyCFunction_NewEx", referenced from:
      __pyx_pymod_exec_cylib(_object*) in cylib-352273.o
  "_PyCFunction_Type", referenced from:
      __Pyx_PyObject_Call2Args(_object*, _object*, _object*) in cylib-352273.o
      __Pyx_PyObject_CallOneArg(_object*, _object*) in cylib-352273.o
  "_PyCode_New", referenced from:
      __pyx_pymod_exec_cylib(_object*) in cylib-352273.o

Is it possible if you can update the .so file somewhere for us to download of have you any idea how can I solve this.

orsic commented 5 years ago

Which system are you using? Also, which Numpy version?