MatLab错误:不能用静态TLS打开。

时间:2022-07-05 23:12:48

Since a couple of days, I constantly receive the same error while using MATLAB which happens at some point with dlopen. I am pretty new to MATLAB, and that is why I don't know what to do. Google doesn't seem to be helping me either. When I try to make an eigenvector, I get this:

几天以来,我不断收到同样的错误在使用MATLAB与dlopen在某一时刻发生。我很新的MATLAB,这就是为什么我不知道要做什么。谷歌似乎并没有帮助我。当我试图让一个特征向量,得到:

Error using eig
LAPACK loading error:
dlopen: cannot load any more object with static TLS

I also get this while making a multiplication:

我在做乘法运算时也得到了这个

Error using  * 
BLAS loading error:
dlopen: cannot load any more object with static TLS

I did of course look for the solutions to this problem, but I don't understand too much and don't know what to do. These are threads I found:

我当然是在寻找解决这个问题的方法,但我不太懂,也不知道该怎么做。这些是我找到的线索:

  1. How do I use the BLAS library provided by MATLAB?
  2. 如何使用MATLAB提供的BLAS库?
  3. http://www.mathworks.de/de/help/matlab/matlab_external/calling-lapack-and-blas-functions-from-mex-files.html
  4. http://www.mathworks.de/de/help/matlab/matlab_external/calling-lapack-and-blas-functions-from-mex-files.html

Can someone help me please?

有人能帮我吗?

Examples of function calls demonstrating this error

>> randn(3,3)

ans =

 2.7694    0.7254   -0.2050             
-1.3499   -0.0631   -0.1241             
 3.0349    0.7147    1.4897            

>> eig(ans)

Error using eig
LAPACK loading error:
dlopen: cannot load any more object with static TLS

10 个解决方案

#1


103  

That's bug no 961964 of MATLAB known since R2012b (8.0). MATLAB dynamically loads some libs with static TLS (thread local storage, e.g. see gcc compiler flag -ftls-model). Loading too many such libs => no space left.

这是自R2012b(8.0)以来,MATLAB的961964的bug。MATLAB动态地用静态TLS加载一些libs(线程本地存储,例如,见gcc编译器标记-ftls-model)。加载太多这样的libs =>没有空间了。

Until now mathwork's only workaround is to load the important(!) libs first by using them early (they suggest to put "ones(10)*ones(10);" in startup.m). I better don't comment on this "solution strategy".

直到现在,mathwork的唯一解决方法是先使用它们来加载重要的(!)libs(他们建议在startupm中使用“ones(10)*ones(10)”)。我最好不要评论这个“解决方案”。

Since R2013b (8.2.0.701) with Linux x86_64 my experience is: Don't use "doc" (the graphical help system)! I think this doc-utility (libxul, etc.) is using a lot of static TLS memory.

由于R2013b(8.2.0.701)和Linux x86_64,我的经验是:不要使用“doc”(图形帮助系统)!我认为这个doc-utility (libxul,等等)使用了许多静态TLS内存。

Here is an update (2013/12/31)

All the following tests were done with Fedora 20 (with glibc-2.18-11.fc20) and Matlab 8.3.0.73043 (R2014a Prerelease).

所有的测试都是用Fedora 20(使用glibc-2.18-11.fc20)和Matlab 8.3.0.73043 (R2014a Prerelease)完成的。

For more information on TLS, see Ulrich Drepper, ELF handling For Thread-Local Storage, Version 0.21, 2013, currently available at Akkadia and Redhat.

有关TLS的更多信息,请参见Ulrich Drepper,用于线程本地存储的ELF处理,版本0.21,2013,目前在Akkadia和Redhat中可用。

What happens exactly?

到底发生了什么?

MATLAB dynamically (with dlopen) loads several libraries that need tls initialization. All those libs need a slot in the dtv (dynamic thread vector). Because MATLAB loads several of these libs dynamically at runtime at compile/link time the linker (at mathworks) had no chance to count the slots needed (that's the important part). Now it's the task of the dynamic lib loader to handle such a case at runtime. But this is not easy. To cite dl-open.c:

MATLAB动态地(使用dlopen)加载了几个需要tls初始化的库。所有这些libs都需要dtv中的一个插槽(动态线程矢量)。因为MATLAB在运行时在编译/链接时动态地加载了几个libs,而linker(在mathworks中)没有机会计算所需的插槽(这是重要的部分)。现在,动态lib加载器的任务是在运行时处理这种情况。但这并不容易。引用dl-open.c:

For static TLS we have to allocate the memory here and now. This includes allocating memory in the DTV. But we cannot change any DTV other than our own. So, if we cannot guarantee that there is room in the DTV we don't even try it and fail the load.

对于静态TLS,我们必须在这里和现在分配内存。这包括在DTV中分配内存。但是除了我们自己,我们不能改变任何数字电视。所以,如果我们不能保证DTV里有房间,我们甚至不去尝试它,也不可能失败。

There is a compile time constant (called DTV_SURPLUS, see glibc-source/sysdeps/generic/ldsodefs.h) in the glibc's dynamic lib loader for reserving a number of additional slots for such a mess (dynamically loading libs with static TLS in a multithreading program). In the glibc-Version of Fedora 20 this value is 14.

在glibc的动态lib加载器中,有一个编译时常量(称为DTV_SURPLUS,参见glibc-source/sysdeps/generic/ldsodefs.h),用于为这种混乱(在多线程程序中动态地加载静态TLS的libs)提供一些额外的插槽。在Fedora 20的glibc版本中,这个值是14。

Here are the first libs (running MATLAB) that needed dtv slots in my case:

这里是第一个需要dtv插槽的libs(运行MATLAB):

matlabroot/bin/glnxa64/libut.so
/lib64/libstdc++.so.6
/lib64/libpthread.so.0
matlabroot/bin/glnxa64/libunwind.so.8
/lib64/libuuid.so.1
matlabroot/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so
matlabroot/sys/java/jre/glnxa64/jre/lib/amd64/libfontmanager.so
matlabroot/sys/java/jre/glnxa64/jre/lib/amd64/libt2k.so
matlabroot/bin/glnxa64/mkl.so
matlabroot/sys/os/glnxa64/libiomp5.so
/lib64/libasound.so.2
matlabroot/sys/jxbrowser/glnxa64/xulrunner/xulrunner-linux-64/libxul.so
/lib64/libselinux.so.1
/lib64/libpixman-1.so.0
/lib64/libEGL.so.1
/lib64/libGL.so.1
/lib64/libglapi.so.0

Yes more than 14 => too many => no slot left in the dtv. That's what the error message tries to tell us and especially mathworks.

是的,超过14 =>太多=>在dtv中没有插槽。这就是错误信息试图告诉我们的,尤其是mathworks。

For the record: In order not to violate MATLAB's license I didn't debug, decompile or disassemble any part of the binaries shipped with MATLAB. I only debugged the free and open glibc-binaries of Fedora 20 that MATLAB were using to dynamically load the libs.

对于记录:为了不违反MATLAB的许可,我没有调试、反编译或分解用MATLAB提供的二进制文件的任何部分。我只调试了Fedora 20的免费和开放的glibc-binaries,这是MATLAB用来动态加载libs的。

What can be done, to solve this problem?

我们能做些什么来解决这个问题呢?

There are 3 options:

有三个选项:

(a) Rebuild MATLAB and do not dynamically load those libs (with initial-exec tls model) instead link against them (then the linker can count the required slots!)

(a)重建MATLAB,并不能动态加载这些libs(带有initial-exec tls模型),而是链接到它们(然后链接器可以计算所需的槽数!)

(b) Rebuild those libs and ensure they are NOT using the initial-exec tls model.

(b)重建这些libs并确保它们不使用initial-exec tls模型。

(c) Rebuild glibc and increase DTV_SURPLUS in glibc/sysdeps/generic/ldsodefs.h

(c)重建glibc并在glibc/sysdeps/generic/ldsodefs.h中增加dtv_盈余。

Obviously options (a) and (b) can only be done by mathworks.

显然选项(a)和(b)只能由mathworks完成。

For option (c) no source of MATLAB is needed and thus can be done without mathworks.

对于选项(c),没有必要的MATLAB源代码,因此可以在没有mathworks的情况下完成。

What is the status at mathworks?

mathworks的状态是什么?

I really tried to explain this to the "MathWorks Technical Support Department". But my impression is: they don't understand me. They closed my support ticket and suggested a telephone(!) conversation in January 2014 with a technical support manager.

我真的试图向“MathWorks Technical Support Department”解释这个问题。但我的印象是:他们不了解我。他们关闭了我的支持票,并建议在2014年1月与一位技术支持经理进行电话交谈。

I'll do my very best to explain this, but to be honest: I'm not very confident.

我将尽我最大的努力来解释这一点,但说实话:我不是很有信心。

Update (2014/01/10): Currently mathworks is trying option (b).

更新(2014/01/10):目前mathworks正在尝试选项(b)。

Update (2014/03/19): For the file libiomp5.so you can download a newly compiled version (without static TLS) at mathworks, bug report 961964. And the other libs? No improvement there. So don't be suprised to get "dlopen: cannot load any more object with static TLS" with "doc", e.g. see bug report 1003952.

更新(2014/03/19):文件libiomp5。所以您可以在mathworks中下载一个新编译的版本(没有静态TLS), bug报告961964。和其他填词吗?没有改善。因此,不要让“dlopen:不能用静态TLS加载任何更多的对象”,比如“doc”,例如,查看bug报告1003952。

#2


26  

Restarting Matlab solved the problem for me.

重新启动Matlab解决了我的问题。

#3


6  

long story short: in the directory that you start matlab from create a file startup.m with content ones(10)*ones(10);. Restart matlab and it will be taken care of.

长话短说:在您启动matlab的目录中创建一个文件启动。与内容的(10)*的m(10);。重启matlab,它会被处理的。

#4


4  

http://www.mathworks.de/support/bugreports/961964 has been updated on 30/01/2014. There is a zip file attached with libiomp5.so I tested it on Mageia 4 x86_64 with Matlab R2013b. I can now use the Documentation of Matlab to open a demo without any problem.

http://www.mathworks.de/support/bugreports/961964已于2014年1月30日更新。有一个带有libiomp5的zip文件。所以我用Matlab R2013b在Mageia 4 x86_64上测试了它。我现在可以使用Matlab的文档来打开一个演示,没有任何问题。

#5


4  

This is, as I find, an age-old problem yet unsolved by MathWorks.

正如我所发现的,这是一个古老的问题,但仍未被MathWorks解决。

Here are my two cents, which worked for me (when I wanted IT++ external libraries, with MEX).

这是我的两美分,它为我工作(当我想要它+外部库,和MEX)。


Let the library that you found to be the cause of the problem be "libXYZ.so", and that you know where it lies on your system.

让您发现的库是问题的原因是“libXYZ”。所以,你知道它在你的系统上。

The solution is to inform MATLAB to load the specific library at the earliest of its startup. The reason for this error is apparently due to the lack of slots for this thread local storage aka tls purpose (due to they already been filled-up).

解决方案是让MATLAB在其启动时加载特定的库。这个错误的原因很明显是由于缺少该线程本地存储的槽(因为它们已经被过滤了)。

Because the latest compilations suddenly required a new library that was not loaded earlier during its startup, MATLAB throws up this error.

因为最新编译突然需要一个新的图书馆,不是早在启动时加载,MATLAB抛出这个错误。

Pity that MATLAB never cared to resolve this problem so long.

可惜的是,MATLAB从来没有想过要解决这个问题。

Fortunately, the solution is a single, very simple terminal command.

幸运的是,解决方案是一个简单的、非常简单的终端命令。


Typical steps on a linux-machine should be as follows:

linux-machine的典型步骤如下:

  1. Open command prompt (Ctrl+Alt+T in Ubuntu)
  2. 打开命令提示符(Ctrl+Alt+T)
  3. Issue the following command

    export LD_PRELOAD=<PATH-TO-libxyz.so>

    出口LD_PRELOAD = < PATH-TO-libxyz.so >

e.g.: export LD_PRELOAD=/usr/local/lib/libitpp.so

例如:出口LD_PRELOAD = / usr /地方/ lib / libitpp.so

  1. Start matlab from the same terminal

    matlab &

    matlab &

Running your program now should resolve the issue, as it is for my case.

现在运行您的程序应该解决这个问题,就像我的情况一样。

Good luck!

好运!


Reference:

参考:

[1] http://au.mathworks.com/matlabcentral/answers/125117-openmp-mex-files-static-tls-problem

[1]http://au.mathworks.com/matlabcentral/answers/125117-openmp-mex-files-static-tls-problem

#6


3  

I had the same problem and I think I just solved it.

我有同样的问题,我想我刚刚解决了。

When installing matlab use the custom installation (I did not do this the first time). Choose to create symbolic links to matlab scripts in the predefined folder (/usr/local/bin). This did the trick for me!

在安装matlab时使用自定义安装(我第一次没有这样做)。选择在预定义文件夹(/usr/local/bin)中创建与matlab脚本的符号链接。这对我有好处!

#7


3  

I had the same problem with both Matlab 2013b and Matlab 2014a. The fix provided by mathworks for libiomp5.so only removed the problem of LAPACK not working. However, I could not use external libraries which are using OpenMp (such as VL_FEAT): I still get the error "dlopen: cannot load any more object with static TLS."

我在Matlab 2013b和Matlab 2014a都有同样的问题。mathworks为libiomp5提供的修复。因此,只解决了LAPACK不工作的问题。但是,我不能使用使用OpenMp的外部库(如VL_FEAT):我仍然会得到“dlopen:不能用静态TLS加载任何更多对象”的错误。

The only thing which worked for me was downgrading to Matlab 2012b.

对我来说,唯一有效的是对Matlab 2012b的降级。

#8


2  

I came across this problem after "bar" (for bar plots) with a an array gives me just a single blue block, with no errors thrown. Reboot at first solved the problem. But after a memory error (after processing a very large file), I just cannot get past this blue block problem.

我在“bar”(用于条状图)之后遇到了这个问题,一个数组只给了我一个蓝色的块,没有抛出任何错误。重新启动首先解决了这个问题。但是在内存错误之后(处理一个很大的文件之后),我就是无法克服这个蓝色块的问题。

Using "hist" on a matrix input gives me the "BLAS loading error" problem and led me to this thread. The Mathwork workaround fixed the hist and bar problems.

使用“嘘”一个矩阵输入给我“布拉斯特区加载错误”的问题,让我这个线程。Mathwork方法固定嘘和酒吧的问题。

Just wanted to bring recognition to the extent of this bug's influence.

只是想让人们认识到这个bug的影响。

#9


0  

I had the same problem and solved it by increasing my Java Heap memory. Go to Preferences > General > Java-Heap Memory, and increase the allocated memory.

我有同样的问题,通过增加Java堆内存来解决它。转到Preferences >通用> java堆内存,并增加分配的内存。

#10


0  

Increasing Java heap memory (to 512 mb) also worked for me on R2013b/Ubuntu 12.04. The "BLAS loading error" began when I processed an 11 GB file (with 16 GB RAM), and has not recurred after increasing java heap memory and restarting matlab.

增加Java堆内存(到512mb)也适用于R2013b/Ubuntu 12.04。当我处理一个1gb的文件(有16gb RAM)时,“BLAS加载错误”就开始了,并且在增加java堆内存和重新启动matlab之后,没有再返回。

#1


103  

That's bug no 961964 of MATLAB known since R2012b (8.0). MATLAB dynamically loads some libs with static TLS (thread local storage, e.g. see gcc compiler flag -ftls-model). Loading too many such libs => no space left.

这是自R2012b(8.0)以来,MATLAB的961964的bug。MATLAB动态地用静态TLS加载一些libs(线程本地存储,例如,见gcc编译器标记-ftls-model)。加载太多这样的libs =>没有空间了。

Until now mathwork's only workaround is to load the important(!) libs first by using them early (they suggest to put "ones(10)*ones(10);" in startup.m). I better don't comment on this "solution strategy".

直到现在,mathwork的唯一解决方法是先使用它们来加载重要的(!)libs(他们建议在startupm中使用“ones(10)*ones(10)”)。我最好不要评论这个“解决方案”。

Since R2013b (8.2.0.701) with Linux x86_64 my experience is: Don't use "doc" (the graphical help system)! I think this doc-utility (libxul, etc.) is using a lot of static TLS memory.

由于R2013b(8.2.0.701)和Linux x86_64,我的经验是:不要使用“doc”(图形帮助系统)!我认为这个doc-utility (libxul,等等)使用了许多静态TLS内存。

Here is an update (2013/12/31)

All the following tests were done with Fedora 20 (with glibc-2.18-11.fc20) and Matlab 8.3.0.73043 (R2014a Prerelease).

所有的测试都是用Fedora 20(使用glibc-2.18-11.fc20)和Matlab 8.3.0.73043 (R2014a Prerelease)完成的。

For more information on TLS, see Ulrich Drepper, ELF handling For Thread-Local Storage, Version 0.21, 2013, currently available at Akkadia and Redhat.

有关TLS的更多信息,请参见Ulrich Drepper,用于线程本地存储的ELF处理,版本0.21,2013,目前在Akkadia和Redhat中可用。

What happens exactly?

到底发生了什么?

MATLAB dynamically (with dlopen) loads several libraries that need tls initialization. All those libs need a slot in the dtv (dynamic thread vector). Because MATLAB loads several of these libs dynamically at runtime at compile/link time the linker (at mathworks) had no chance to count the slots needed (that's the important part). Now it's the task of the dynamic lib loader to handle such a case at runtime. But this is not easy. To cite dl-open.c:

MATLAB动态地(使用dlopen)加载了几个需要tls初始化的库。所有这些libs都需要dtv中的一个插槽(动态线程矢量)。因为MATLAB在运行时在编译/链接时动态地加载了几个libs,而linker(在mathworks中)没有机会计算所需的插槽(这是重要的部分)。现在,动态lib加载器的任务是在运行时处理这种情况。但这并不容易。引用dl-open.c:

For static TLS we have to allocate the memory here and now. This includes allocating memory in the DTV. But we cannot change any DTV other than our own. So, if we cannot guarantee that there is room in the DTV we don't even try it and fail the load.

对于静态TLS,我们必须在这里和现在分配内存。这包括在DTV中分配内存。但是除了我们自己,我们不能改变任何数字电视。所以,如果我们不能保证DTV里有房间,我们甚至不去尝试它,也不可能失败。

There is a compile time constant (called DTV_SURPLUS, see glibc-source/sysdeps/generic/ldsodefs.h) in the glibc's dynamic lib loader for reserving a number of additional slots for such a mess (dynamically loading libs with static TLS in a multithreading program). In the glibc-Version of Fedora 20 this value is 14.

在glibc的动态lib加载器中,有一个编译时常量(称为DTV_SURPLUS,参见glibc-source/sysdeps/generic/ldsodefs.h),用于为这种混乱(在多线程程序中动态地加载静态TLS的libs)提供一些额外的插槽。在Fedora 20的glibc版本中,这个值是14。

Here are the first libs (running MATLAB) that needed dtv slots in my case:

这里是第一个需要dtv插槽的libs(运行MATLAB):

matlabroot/bin/glnxa64/libut.so
/lib64/libstdc++.so.6
/lib64/libpthread.so.0
matlabroot/bin/glnxa64/libunwind.so.8
/lib64/libuuid.so.1
matlabroot/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so
matlabroot/sys/java/jre/glnxa64/jre/lib/amd64/libfontmanager.so
matlabroot/sys/java/jre/glnxa64/jre/lib/amd64/libt2k.so
matlabroot/bin/glnxa64/mkl.so
matlabroot/sys/os/glnxa64/libiomp5.so
/lib64/libasound.so.2
matlabroot/sys/jxbrowser/glnxa64/xulrunner/xulrunner-linux-64/libxul.so
/lib64/libselinux.so.1
/lib64/libpixman-1.so.0
/lib64/libEGL.so.1
/lib64/libGL.so.1
/lib64/libglapi.so.0

Yes more than 14 => too many => no slot left in the dtv. That's what the error message tries to tell us and especially mathworks.

是的,超过14 =>太多=>在dtv中没有插槽。这就是错误信息试图告诉我们的,尤其是mathworks。

For the record: In order not to violate MATLAB's license I didn't debug, decompile or disassemble any part of the binaries shipped with MATLAB. I only debugged the free and open glibc-binaries of Fedora 20 that MATLAB were using to dynamically load the libs.

对于记录:为了不违反MATLAB的许可,我没有调试、反编译或分解用MATLAB提供的二进制文件的任何部分。我只调试了Fedora 20的免费和开放的glibc-binaries,这是MATLAB用来动态加载libs的。

What can be done, to solve this problem?

我们能做些什么来解决这个问题呢?

There are 3 options:

有三个选项:

(a) Rebuild MATLAB and do not dynamically load those libs (with initial-exec tls model) instead link against them (then the linker can count the required slots!)

(a)重建MATLAB,并不能动态加载这些libs(带有initial-exec tls模型),而是链接到它们(然后链接器可以计算所需的槽数!)

(b) Rebuild those libs and ensure they are NOT using the initial-exec tls model.

(b)重建这些libs并确保它们不使用initial-exec tls模型。

(c) Rebuild glibc and increase DTV_SURPLUS in glibc/sysdeps/generic/ldsodefs.h

(c)重建glibc并在glibc/sysdeps/generic/ldsodefs.h中增加dtv_盈余。

Obviously options (a) and (b) can only be done by mathworks.

显然选项(a)和(b)只能由mathworks完成。

For option (c) no source of MATLAB is needed and thus can be done without mathworks.

对于选项(c),没有必要的MATLAB源代码,因此可以在没有mathworks的情况下完成。

What is the status at mathworks?

mathworks的状态是什么?

I really tried to explain this to the "MathWorks Technical Support Department". But my impression is: they don't understand me. They closed my support ticket and suggested a telephone(!) conversation in January 2014 with a technical support manager.

我真的试图向“MathWorks Technical Support Department”解释这个问题。但我的印象是:他们不了解我。他们关闭了我的支持票,并建议在2014年1月与一位技术支持经理进行电话交谈。

I'll do my very best to explain this, but to be honest: I'm not very confident.

我将尽我最大的努力来解释这一点,但说实话:我不是很有信心。

Update (2014/01/10): Currently mathworks is trying option (b).

更新(2014/01/10):目前mathworks正在尝试选项(b)。

Update (2014/03/19): For the file libiomp5.so you can download a newly compiled version (without static TLS) at mathworks, bug report 961964. And the other libs? No improvement there. So don't be suprised to get "dlopen: cannot load any more object with static TLS" with "doc", e.g. see bug report 1003952.

更新(2014/03/19):文件libiomp5。所以您可以在mathworks中下载一个新编译的版本(没有静态TLS), bug报告961964。和其他填词吗?没有改善。因此,不要让“dlopen:不能用静态TLS加载任何更多的对象”,比如“doc”,例如,查看bug报告1003952。

#2


26  

Restarting Matlab solved the problem for me.

重新启动Matlab解决了我的问题。

#3


6  

long story short: in the directory that you start matlab from create a file startup.m with content ones(10)*ones(10);. Restart matlab and it will be taken care of.

长话短说:在您启动matlab的目录中创建一个文件启动。与内容的(10)*的m(10);。重启matlab,它会被处理的。

#4


4  

http://www.mathworks.de/support/bugreports/961964 has been updated on 30/01/2014. There is a zip file attached with libiomp5.so I tested it on Mageia 4 x86_64 with Matlab R2013b. I can now use the Documentation of Matlab to open a demo without any problem.

http://www.mathworks.de/support/bugreports/961964已于2014年1月30日更新。有一个带有libiomp5的zip文件。所以我用Matlab R2013b在Mageia 4 x86_64上测试了它。我现在可以使用Matlab的文档来打开一个演示,没有任何问题。

#5


4  

This is, as I find, an age-old problem yet unsolved by MathWorks.

正如我所发现的,这是一个古老的问题,但仍未被MathWorks解决。

Here are my two cents, which worked for me (when I wanted IT++ external libraries, with MEX).

这是我的两美分,它为我工作(当我想要它+外部库,和MEX)。


Let the library that you found to be the cause of the problem be "libXYZ.so", and that you know where it lies on your system.

让您发现的库是问题的原因是“libXYZ”。所以,你知道它在你的系统上。

The solution is to inform MATLAB to load the specific library at the earliest of its startup. The reason for this error is apparently due to the lack of slots for this thread local storage aka tls purpose (due to they already been filled-up).

解决方案是让MATLAB在其启动时加载特定的库。这个错误的原因很明显是由于缺少该线程本地存储的槽(因为它们已经被过滤了)。

Because the latest compilations suddenly required a new library that was not loaded earlier during its startup, MATLAB throws up this error.

因为最新编译突然需要一个新的图书馆,不是早在启动时加载,MATLAB抛出这个错误。

Pity that MATLAB never cared to resolve this problem so long.

可惜的是,MATLAB从来没有想过要解决这个问题。

Fortunately, the solution is a single, very simple terminal command.

幸运的是,解决方案是一个简单的、非常简单的终端命令。


Typical steps on a linux-machine should be as follows:

linux-machine的典型步骤如下:

  1. Open command prompt (Ctrl+Alt+T in Ubuntu)
  2. 打开命令提示符(Ctrl+Alt+T)
  3. Issue the following command

    export LD_PRELOAD=<PATH-TO-libxyz.so>

    出口LD_PRELOAD = < PATH-TO-libxyz.so >

e.g.: export LD_PRELOAD=/usr/local/lib/libitpp.so

例如:出口LD_PRELOAD = / usr /地方/ lib / libitpp.so

  1. Start matlab from the same terminal

    matlab &

    matlab &

Running your program now should resolve the issue, as it is for my case.

现在运行您的程序应该解决这个问题,就像我的情况一样。

Good luck!

好运!


Reference:

参考:

[1] http://au.mathworks.com/matlabcentral/answers/125117-openmp-mex-files-static-tls-problem

[1]http://au.mathworks.com/matlabcentral/answers/125117-openmp-mex-files-static-tls-problem

#6


3  

I had the same problem and I think I just solved it.

我有同样的问题,我想我刚刚解决了。

When installing matlab use the custom installation (I did not do this the first time). Choose to create symbolic links to matlab scripts in the predefined folder (/usr/local/bin). This did the trick for me!

在安装matlab时使用自定义安装(我第一次没有这样做)。选择在预定义文件夹(/usr/local/bin)中创建与matlab脚本的符号链接。这对我有好处!

#7


3  

I had the same problem with both Matlab 2013b and Matlab 2014a. The fix provided by mathworks for libiomp5.so only removed the problem of LAPACK not working. However, I could not use external libraries which are using OpenMp (such as VL_FEAT): I still get the error "dlopen: cannot load any more object with static TLS."

我在Matlab 2013b和Matlab 2014a都有同样的问题。mathworks为libiomp5提供的修复。因此,只解决了LAPACK不工作的问题。但是,我不能使用使用OpenMp的外部库(如VL_FEAT):我仍然会得到“dlopen:不能用静态TLS加载任何更多对象”的错误。

The only thing which worked for me was downgrading to Matlab 2012b.

对我来说,唯一有效的是对Matlab 2012b的降级。

#8


2  

I came across this problem after "bar" (for bar plots) with a an array gives me just a single blue block, with no errors thrown. Reboot at first solved the problem. But after a memory error (after processing a very large file), I just cannot get past this blue block problem.

我在“bar”(用于条状图)之后遇到了这个问题,一个数组只给了我一个蓝色的块,没有抛出任何错误。重新启动首先解决了这个问题。但是在内存错误之后(处理一个很大的文件之后),我就是无法克服这个蓝色块的问题。

Using "hist" on a matrix input gives me the "BLAS loading error" problem and led me to this thread. The Mathwork workaround fixed the hist and bar problems.

使用“嘘”一个矩阵输入给我“布拉斯特区加载错误”的问题,让我这个线程。Mathwork方法固定嘘和酒吧的问题。

Just wanted to bring recognition to the extent of this bug's influence.

只是想让人们认识到这个bug的影响。

#9


0  

I had the same problem and solved it by increasing my Java Heap memory. Go to Preferences > General > Java-Heap Memory, and increase the allocated memory.

我有同样的问题,通过增加Java堆内存来解决它。转到Preferences >通用> java堆内存,并增加分配的内存。

#10


0  

Increasing Java heap memory (to 512 mb) also worked for me on R2013b/Ubuntu 12.04. The "BLAS loading error" began when I processed an 11 GB file (with 16 GB RAM), and has not recurred after increasing java heap memory and restarting matlab.

增加Java堆内存(到512mb)也适用于R2013b/Ubuntu 12.04。当我处理一个1gb的文件(有16gb RAM)时,“BLAS加载错误”就开始了,并且在增加java堆内存和重新启动matlab之后,没有再返回。