Dlib: Setup.py: How to use LDFLAGS?

Created on 30 Nov 2018  路  7Comments  路  Source: davisking/dlib

My PC is broken and I'm trying to install this on android using termux. Now android linker is different than the normal one so I need to compile it and link against libpython3.so. I've tried running:

LDFLAGS=" -llog -lpython3" python3 setup.py install --set 'DCMAKE_INSTALL_PREFIX=$PREFIX'

But with no results.

Any other way to install this? If I don't link it I will get this error:

ImportError: dlopen failed: cannot locate symbol "PyInstanceMethod_Type"

Thanks.

inactive

Most helpful comment

@Nannigalaxy If I remember right I installed it with cmake. I don't remember from what folder but you can check the setup.py script to check from where is installing it.. it was tools/something

All 7 comments

Any luck? I too got this error

@Nannigalaxy If I remember right I installed it with cmake. I don't remember from what folder but you can check the setup.py script to check from where is installing it.. it was tools/something

Warning: this issue has been inactive for 30 days and will be automatically closed on 2019-01-16 if there is no further activity.

If you are waiting for a response but haven't received one it's likely your question is somehow inappropriate. E.g. you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's documentation, or a Google search.

Notice: this issue has been closed because it has been inactive for 35 days. You may reopen this issue if it has been closed in error.

@nitanmarcel curious if you found a fix for this. I am also trying to install dlib on my android using termux. but got similar error.

    import dlib
ImportError: dlopen failed: cannot locate symbol "PyInstanceMethod_Type" referenced by "/data/data/com.termux/files/usr/lib/python3.7/site-packages/dlib.cpython-37m.so"...

alright i think i got it working, looks like you i needed some additional package

apt update
apt upgrade
apt install python clang fftw libzmq libzmq freetype libpng libpng pkg-config zlib libiconv  curl

wget https://files.pythonhosted.org/packages/05/57/e8a8caa3c89a27f80bc78da39c423e2553f482a3705adc619176a3a24b36/dlib-19.17.0.tar.gz
tar -xf dlib-19.17.0.tar.gz
cd dlib-19.17.0
LDFLAGS=" -llog -lpython3" python3 setup.py install --set 'DCMAKE_INSTALL_PREFIX=$PREFIX'


Thank you, friend. I am almoust gave up, but your solution work for me perfect. I am finally got face_recognition on termux!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

abhisheksoni27 picture abhisheksoni27  路  4Comments

lvella picture lvella  路  4Comments

srikanthreddybethi picture srikanthreddybethi  路  4Comments

joeking11829 picture joeking11829  路  5Comments

farazirfan47 picture farazirfan47  路  5Comments