clang:错误:不支持的选项'-fopenmp'。更改默认的编译器?

时间:2019-07-17 16:08:46

标签: macos gcc cmake clang

我在Mac上,但不是Mac用户。我需要运行make命令(实际上是make makewisdom)来编译软件,但是我的编译器无法识别某些命令:

$ make makewisdom
gcc -I/Users/username/presto/include -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -I/opt/local/include -I -I/opt/local/include -DUSEFFTW -DUSEMMAP -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -Wall -W -fPIC -O3 -ffast-math -Wno-unused-result -Wno-unused-but-set-variable -Wno-unused-but-set-parameter -fopenmp -o makewisdom makewisdom.c -L/opt/local/lib -lfftw3f

clang: error: unsupported option '-fopenmp'
clang: error: unsupported option '-fopenmp'
make: *** [makewisdom] Error 1

我知道问题出在clang上。我正在阅读许多讨论(例如thisthis等),并试图解决该问题,但还没有走运。也许我只需要设置一个不同的默认编译器? (例如,gcc,无论我安装了什么版本):

$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

0 个答案:

没有答案