本文介绍了clang-omp在Xcode下El Capitan的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我喜欢在C ++项目中使用openmp,使用Xcode作为IDE。不幸的是,Apple的Clang编译器不支持openmp( ),因此我安装了。我完全按照网站上的指示使用它在Xcode中,但我得到错误消息 c / c> 在项目的构建阶段下添加 /usr/local/lib/libiomp5.dylib 到链接二进制
- Install clang-omp using homebrew: brew install clang-omp
- Create a new Xcode project
- Add a new user-defined setting CC with the value /usr/local/bin/clang-omp under the project's build settings
- Add -fopenmp to Other C Flags under the project's build settings
- Add /usr/local/include to Header Search Paths under the project's build settings
- Add /usr/local/lib to Library Search Paths under the project's build settings
- Set Enable Modules (C and Objective-C) to No under the project's build settings
- Add /usr/local/lib/libiomp5.dylib to Link Binary With Libraries under the project's build phases
- Make a symbolic link via sudo ln -s /usr/local/bin/clang-omp++ /usr/local/bin/clang++-omp using the terminal
- Use #include <libiomp/omp.h> to be able to use openmp in your project
这篇关于clang-omp在Xcode下El Capitan的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!