You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

MacOS High Sierra下gcc无法识别-fopenmp选项,已装组件仍报错

在MacOS High Sierra 10.13.4上编译OpenMP代码的问题

我碰到的问题和之前一个Stack Overflow的老问题一样,但那个问题里的解决方案现在已经不管用了,毕竟距离问题发布已经过去好几年,环境肯定有变化了。

我在MacOS High Sierra 10.13.4上编译OpenMP代码时,执行下面的命令:

gcc -fopenmp omp_accum_sum.cpp

得到了这样的错误:

clang: error: unsupported option '-fopenmp'

根据Mac Ports的指引,我已经安装了gcc、clang和OpenMP的最新可用版本,具体安装情况如下:

$ port installed gcc7
The following ports are currently installed:
  gcc7 @7.3.0_1 (active)

$ port installed libomp
The following ports are currently installed:
  libomp @0.0_246703
  libomp @0.0_261249
  libomp @0.0_264411+universal
  libomp @3.9.0_1+universal
  libomp @3.9.1_0+universal
  libomp @5.0.1_0+universal (active)

$ port installed clang-6.0
The following ports are currently installed:
  clang-6.0 @6.0.0_0+analyzer+libstdcxx (active)

我查资料知道应该把gcc命令指向正确的gcc版本,但我找不到这个gcc的具体路径,有没有人能帮我解决这个问题?

内容的提问来源于stack exchange,提问作者bob.sacamento

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 10:09:27