Rah*_*ahn 3 macos homebrew gcc g++
我已经拥有gcc并g++安装:
$ which gcc
/usr/bin/gcc
$ which g++
/usr/bin/g++
$ brew install gcc
Warning: gcc-6.2.0 already installed
Run Code Online (Sandbox Code Playgroud)
我按照在 OS X Yosemite 上使用 gcc 编译器编译 OpenMP 程序来gcc通过 HomeBrew 重新安装:
$ brew reinstall gcc --without-multilib
Run Code Online (Sandbox Code Playgroud)
然后
$ /usr/bin/g++ openmp.cpp
openmp.cpp:12:10: fatal error: 'omp.h' file not found
#include <omp.h>
^
1 error generated.
Run Code Online (Sandbox Code Playgroud)
和-fopenmp
$ /usr/bin/g++ openmp.cpp -fopenmp
clang: error: unsupported option '-fopenmp'
clang: error: unsupported option '-fopenmp'
Run Code Online (Sandbox Code Playgroud)
这个重定向发生了什么?我该如何使用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.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3723 次 |
| 最近记录: |