Skip to content
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

aarch64: cannot allocate memory in static TLS block #14884

ric96 opened this issue Jun 25, 2019 · 2 comments


3 participants
Copy link

commented Jun 25, 2019

I am compiling opencv from source in order to enable multi-core support on a aarch64 platform.

I am building open cv with the following config:


but every time I import it using python, I get the following error. A lot of the results on-line seems to be very vague and/or point towards a bug in gcc 4.2 fixed in 4.3 and I am currently on 8.x provided by debian repo and also 9.0.1 built from upstream source:

root@linaro-developer:~# python3
Python 3.7.3 (default, Apr  3 2019, 05:39:12) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/dist-packages/cv2/", line 89, in <module>
  File "/usr/local/lib/python3.7/dist-packages/cv2/", line 79, in bootstrap
    import cv2
ImportError: /usr/lib/aarch64-linux-gnu/ cannot allocate memory in static TLS block

This is on opencv master branch as well as 4.0.1


This comment has been minimized.

Copy link

commented Jul 7, 2019

I can now confirm that OpenCV 3.2 built with openmp is working fine on the exact same platform.


This comment has been minimized.

Copy link

commented Jul 8, 2019

I just wanted to point that it is not necessary to enable TBB or OpenMP in order to enable multicore support. Default pthreads backend can be good enough for most situations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.