问题描述
我有一组(以前工作和编译了几个月)的MEX文件.我用pacman -Syu更新了3个月大的软件包(在GCC/G ++之前可以正常工作),现在是我的结果:
对于
晦涩的编译器问题不是我的专长.任何人对这里可能出现的问题有任何建议吗?
切换到 TDM-GCC 解决了使用-O0编译时mex文件无效的问题.显然没什么(尽管我注意到其他差异).
我的错误(我认为)是我将G ++换成TDM-G ++,但也没有换成GCC,并且仓库中有几个C文件.
对于使用MEX
进行编译,该问题也在链接的问题中得到了解决,因此也是一种选择.
问题似乎在于随着时间的推移更新了GCC.无论如何,使用-o0仍会创建无效的mex文件.使用-o1-2很好,使用-o3可以省略代码的重要部分,除非添加了伪打印语句.我发现最好的平衡是将其设置为使用TDM-GCC/G ++编译DEBUG,并将GCC的最新版本用于所有其他方面.
I had a (previously working and compiling for months) set of MEX files. I updated my 3-month-old packages (which worked fine before with GCC/G++) with a pacman -Syu, and now here are my results:
For
Obscure compiler issue is not my specialty. Anyone have any suggestions as to what might be the issue here?
Switching to TDM-GCC fixed the issue with mex files being invalid when compiled with -O0. Nothing else (despite the other differences I noticed) apparently mattered.
My mistake (I think) is that I swapped out G++ for TDM-G++, but did not also do so for GCC, and there are several C files in the repo.
As for compiling with MEX
, that issue is also solved in the linked question, so it's an option as well.
EDIT: The issue seems to lie with GCC being updated over time. In any case, with -o0 it still creates an invalid mex file. With -o1-2 it's fine, with -o3 it omits important parts of the code unless a dummy print statement is added. I've found that the best balance is to set it to compile DEBUG with TDM-GCC/G++, and use GCC's latest for all else.
这篇关于更新了软件包,现在用-O0编译的Mex文件是“无效的mex文件"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!