【问题标题】:gcc compiler error when building on raspbian在 raspbian 上构建时出现 gcc 编译器错误
【发布时间】:2018-01-16 12:04:55
【问题描述】:

我正在尝试构建openvibe! raspbian上的源代码,我已经手动安装了所有需要的依赖项,但最后似乎出现编译错误。

所以在编写构建文件后它说:

-- Build files have been written to: /home/pi/Desktop/openvibe-2.0.0-src/build/sdk-Release
Generation succeeded!
Building project...

和:

[1/340] Building CXX object build-tool...
[some dirty code here]

然后停止构建 sdk

返回这个:

c++: error: unrecognized command line option ‘-msse2’
ninja: build stopped: subcommand failed.
ERROR: Build failed
Error while building sdk

我想明确表示,我到处搜索,SOF 是我最后的选择!因此,我们将不胜感激任何帮助!

【问题讨论】:

  • -msse2GCC 的特定于 x86 的优化标志。你需要删除它,因为它在 ARM 上没有意义。
  • 你的意思是从整个源代码?
  • 顺便说一句,我建议在 OpenVIBE forum 上询问更多详细信息(解释您输入的每个命令)。您可能需要更改一些构建配置(例如,OpenVIBE 使用的 build automation 工具;我不知道它是什么;一般来说,ninjameson 之类的生成器一起使用)
  • 我已经在那儿发帖了,但是那个论坛根本没有回应我的紧急时间表!
  • 是的,您需要花几天时间了解 OpenVibe 软件是如何构建的。问问自己他们的build.ninja 文件是如何生成的。也许-msse2 在那个文件里面。

标签: c++ gcc build compiler-errors raspbian


【解决方案1】:

从输出判断,您正在使用 cmake 构建库。

-msse2 是 gcc 编译标志,它启用 x86 sse 矢量化。由于您正在为 raspbian 进行编译,因此您需要禁用它。

通常,编译标志设置在CMakeLists.txt 文件中。找到,设置的地方:

find . -name CMakeLists.txt | xargs grep msse2

你会发现类似的东西:

# Switch -msse2 enables vectorization. Remove if your CPU/compiler doesn't support it.
SET(OV_EIGEN_FLAGS "-msse2")

按照指导,删除每一个次,就完成了。

【讨论】:

  • 非常感谢。我删除了那些SET(OV_EIGEN_FLAGS "-msse2"),它确实很神奇!
  • 嘿@ivaigult,我正在构建,它几乎是[147/360]的一半,它只是遇到了一个致命的错误,不会从这里继续! fatal error: Eigen/Eigen: No such file or directory #include <Eigen/Eigen> compilation terminated. ninja: build stopped: subcommand failed. ERROR: Build failed Error while building sdk 如果我必须再次将它放回代码中,我应该如何修改 SET(OV_EIGEN_FLAGS "-msse2")
  • @ali2569 这是一个不同的问题。您没有安装 Eigen 库。使用你的包管理器安装一个。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-01-20
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多