gpt4 book ai didi

macos - OS X : installed gcc links to clang

转载 作者:行者123 更新时间:2023-12-04 02:09:31 25 4
gpt4 key购买 nike

我已经安装了 gccg++:

$ which gcc
/usr/bin/gcc

$ which g++
/usr/bin/g++

$ brew install gcc
Warning: gcc-6.2.0 already installed

我关注 Compile OpenMP programs with gcc compiler on OS X Yosemite通过 HomeBrew 重新安装 gcc:

$ brew reinstall gcc --without-multilib

然后

$ /usr/bin/g++ openmp.cpp
openmp.cpp:12:10: fatal error: 'omp.h' file not found
#include <omp.h>
^
1 error generated.

使用-fopenmp

$ /usr/bin/g++ openmp.cpp -fopenmp
clang: error: unsupported option '-fopenmp'
clang: error: unsupported option '-fopenmp'

这个重定向发生了什么?我如何使用 gcc/g++


虽然涉及,但与 OpenMP 无关。

最佳答案

brew/usr/local/bin 中安装工具。使用/usr/local/bin/g++6:

$ /usr/local/bin/g++-6 --version
g++-6 (Homebrew gcc 6.2.0) 6.2.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

关于macos - OS X : installed gcc links to clang,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40034457/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com