在OSX上安装具有openMP支持的gcc的一个way是使用Homebrew。然而,当我遵循通常的指令
brew reinstall gcc --without-multilib
它给我一个警告,没有与--without-multilib选项相对应的公式,因此这将不起作用。因此,在此重新安装过程后,我将不再获得openMP支持。下面是详细的终端输出。
poulin8:02-prange-parallel-loops poulingroup$ brew --version
Homebrew 1.3.6
Homebrew/homebrew-core (git revision b5afc; last commit 2017-10-27)
poulin8:02-prange-parallel-loops poulingroup$ brew reinstall gcc --without-multilib
==> Reinstalling gcc
Warning: gcc: this formula has no --without-multilib option so it will be ignored!
==> Downloading https://homebrew.bintray.com/bottles/gcc-7.2.0.el_capitan.bottle
Already downloaded: /Users/poulingroup/Library/Caches/Homebrew/gcc-7.2.0.el_capitan.bottle.tar.gz
==> Pouring gcc-7.2.0.el_capitan.bottle.tar.gz
/usr/local/Cellar/gcc/7.2.0: 1,486 files, 289.8MB
poulin8:02-prange-parallel-loops poulingroup$在将omp.h包含在文件中并进行编译时,我得到以下错误
julia.c:447:10: fatal error: 'omp.h' file not found
#include <omp.h>
^
1 error generated.
error: command 'cc' failed with exit status 1有没有人能帮我在支持openMP的操作系统上安装gcc?
发布于 2018-03-14 04:49:03
如果你能用clang代替gcc,我就能很容易地让clang去编译OpenMP程序了。我构建了最新版本的LLVM/clang,并使用自制软件通过brew install libomp安装了libomp。
完整的步骤类似于:
mkdir omp_clang && cd omp_clang
git clone https://github.com/llvm-mirror/llvm.git -b release_60
git clone https://github.com/llvm-mirror/clang.git llvm/tools/clang -b release_60
mkdir build && cd build
cmake ../llvm
make
brew install libomp
./bin/clang -fopenmp=libomp ~/openmp_program.chttps://stackoverflow.com/questions/46979608
复制相似问题