DoubangoTelecom / ultimateMICR-SDK

Bank check information extraction/OCR from Magnetic Ink Character Recognition [MICR] (E-13B & CMC-7) using deep learning
https://www.doubango.org/webapps/micr/
Other
51 stars 18 forks source link

Build error when compiling the extension for Linux platform #56

Closed ghost closed 2 years ago

ghost commented 2 years ago

I am trying to compile the extension using gcc in Ubuntu. But the compilation fails for this command given in your build instructions. I am using python 3.8.10.


$ python ../../../python/setup.py build_ext --inplace -v

Your platform: linux
running build_ext
building '_ultimateMicrSdk' extension
creating build
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I../../../c++ -I/ultimateMICR-SDK-master/.venv/include -I/usr/include/python3.8 -c /ultimateMICR-SDK-master/python/ultimateMICR-SDK-API-PUBLIC-SWIG_python.cxx -o build/temp.linux-x86_64-3.8/ultimateMICR-SDK-master/python/ultimateMICR-SDK-API-PUBLIC-SWIG_python.o
In file included from /usr/include/string.h:495,
                 from /usr/include/python3.8/Python.h:30,
                 from /ultimateMICR-SDK-master/python/ultimateMICR-SDK-API-PUBLIC-SWIG_python.cxx:149:
In function 'char* strncpy(char*, const char*, size_t)',
    inlined from 'void SWIG_Python_FixMethods(PyMethodDef*, swig_const_info*, swig_type_info**, swig_type_info**)' at /ultimateMICR-SDK-master/python/ultimateMICR-SDK-API-PUBLIC-SWIG_python.cxx:5499:22,
    inlined from 'PyObject* PyInit__ultimateMicrSdk()' at /ultimateMICR-SDK-master/python/ultimateMICR-SDK-API-PUBLIC-SWIG_python.cxx:5597:25:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: warning: 'char* __builtin_strncpy(char*, const char*, long unsigned int)' output truncated before terminating nul copying 10 bytes from a string of the same length [-Wstringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.8/ultimateMICR-SDK-master/python/ultimateMICR-SDK-API-PUBLIC-SWIG_python.o -L. -lultimate_micr-sdk -o /ultimateMICR-SDK-master/binaries/linux/x86_64/_ultimateMicrSdk.so```
DoubangoTelecom commented 2 years ago

I see a warning but no error in the logs you have shared. What's the issue? What's your gcc version?

DoubangoTelecom commented 2 years ago

The warning happens at build time but it succeed. Then the link command is executed but you're not showing the result of the second command. For me everything is OK and the extension is correctly generated unless you're not showing the complete logs