-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Building (cross-compiling) dlib into amd64 container fails #3038
Comments
Update: Changing install command to But the test program fails on start with: Traceback (most recent call last):
File "/app/frapi-start.py", line 14, in <module>
import FRAPI_impl
File "/app/FRAPI_impl.py", line 18, in <module>
import face_recognition
File "/usr/local/lib/python3.12/site-packages/face_recognition/__init__.py", line 7, in <module>
from .api import load_image_file, face_locations, batch_face_locations, face_landmarks, face_encodings, compare_faces, face_distance
File "/usr/local/lib/python3.12/site-packages/face_recognition/api.py", line 4, in <module>
import dlib
File "/usr/local/lib/python3.12/site-packages/dlib/__init__.py", line 19, in <module>
from _dlib_pybind11 import *
ImportError: dynamic module does not define module export function (PyInit__dlib_pybind11) The same error is produced in |
Cool. Can you send me a PR that makes it work for you? :) |
No Davis, it didn't work. It builds ok but fails in run. The only way I was able to build the package was building it with clang. With both gnuc 10 and 12 the build fails. It appears to be a problem related to LTO (A link optimization technique) bug either on dlib or pybind11. I couldn't invest more time researching. Building with clang did the trick to me. Hope it helps you to find the fix. |
That |
It must be a linux-in-docker setting... I'll try your suggestion and post results here. Thanks! |
What Operating System(s) are you seeing this problem on?
Linux (x86-64), macOS (Apple Silicon)
dlib version
19.24.1
Python version
3.12
Compiler
GNU C 12.2.0
Expected Behavior
It should build and install fine
Current Behavior
It fails when building docker container on Apple M1 using
docker buildx build --platform=linux/amd64 -t myimage .
Steps to Reproduce
Place:
into a
Dockerfile
and run:docker buildx build --platform=linux/amd64 -t myimage .
Anything else?
It builds ok on
linux/arm64
or Apple M1 platformsThe text was updated successfully, but these errors were encountered: