Mar*_*sen 5 11.10 gcc version-control matlab compiler
有没有简单的方法可以在 Oneiric 上安装 gcc-4.3?我真的需要它,因为 matlab 依赖 i 来创建 mex 文件
我尝试将我所有的 resopistories 改回 Maverick 只是为了安装 gcc-4.3,但我收到此错误:
refl_v0p8_linux_and_windows % sudo apt-get install gcc-4.3-multilib libstdc++6-4.3- dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
gcc-4.3-multilib : Depends: gcc-4.3 (= 4.3.5-3ubuntu1) but it is not going to be installed
Depends: libc6-dev-i386 (>= 2.5) but it is not going to be installed
libstdc++6-4.3-dev : Depends: g++-4.3 (= 4.3.5-3ubuntu1) but it is not going to be installed
E: Broken packages
Run Code Online (Sandbox Code Playgroud)
你已经打破了依赖关系。你可以“修复”它们
sudo apt-get -f install
Run Code Online (Sandbox Code Playgroud)
但在说“是”之前,请先看看 apt 尝试卸载什么。
提示:为了获得另一个版本的 gcc 而降级 ubuntu 版本并不是一个好主意。你可以在一台机器上拥有多个版本的 gcc!我会再次回到您尝试降级失败之前的版本,并保留您之前的 gcc 版本。然后拿到gcc 4.3的tar-ball,自己编译一下,并不难。之后你就有了两个 gcc 版本,然后你可以将 matlab 指向另一个版本(在 matlab 中的某处指定 gcc 路径)。
除了ubuntu默认安装的版本外,不建议您使用gcc版本编译其他软件。
可能的解决方法:(修复MATLAB,而不是GCC-4.3)
\n\n\n\n(总之)
\n\n步骤1:
\n\n对于 MATLAB,使用sudo run mex -setup并选择(最新的)GCC 编译器。
\n\n第2步:
\n\nsudo gedit ~/.matlab/R2009b/mexopts.sh\nRun Code Online (Sandbox Code Playgroud)\n\n将CC=\xe2\x80\x99gcc\xe2\x80\x99的所有实例替换为CC=\xe2\x80\x99gcc-4.6\xe2\x80\xb2
\n\n(可选)将-ansi替换为-std=c99,以允许使用 C++ 样式 // 注释。
\n\n注意:如果您稍后重新运行mex -setup,这将覆盖mexopts.sh文件。
\n