OS X:已安装 gcc 链接到 clang
OS X: installed gcc links to clang
我已经安装了 gcc
和 g++
:
$ which gcc
/usr/bin/gcc
$ which g++
/usr/bin/g++
$ brew install gcc
Warning: gcc-6.2.0 already installed
我按照 通过 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.
我已经安装了 gcc
和 g++
:
$ which gcc
/usr/bin/gcc
$ which g++
/usr/bin/g++
$ brew install gcc
Warning: gcc-6.2.0 already installed
我按照 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.