Mac os 使用brew 安装 clang-opm
2016-08-26 13:14
1876 查看
地址 https://clang-omp.github.io/ **使用brew安装** Using clang-omp with Xcode Instructions are provided by Sebastian Stenzel. Install clang-omp using homebrew: brew install clang-omp. Create a new Xcode project. Under Build Settings Add a new user-defined setting CC with the value /usr/local/bin/clang-omp Add -fopenmp to Other C Flags Add /usr/local/include to Header Search Paths Set Enable Modules (C and Objective-C) to No. Under Build Phases Add /usr/local/lib/libiomp5.dylib to Link Binary With Libraries Done. You can now #include <libiomp/omp.h> and start using #pragma omp ... in your source code. **源代码安装** http://clang.llvm.org/get_started.html On Unix-like Systems If you would like to check out and build Clang, the current procedure is as follows: Get the required tools. See Getting Started with the LLVM System - Requirements. Note also that Python is needed for running the test suite. Get it at: http://www.python.org/download Standard build process uses CMake. Get it at: http://www.cmake.org/download Check out LLVM: Change directory to where you want the llvm directory placed. svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm Check out Clang: cd llvm/tools svn co http://llvm.org/svn/llvm-project/cfe/trunk clang cd ../.. Check out extra Clang tools: (optional) cd llvm/tools/clang/tools svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra cd ../../../.. Check out Compiler-RT (optional): cd llvm/projects svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt cd ../.. Check out libcxx: (only required to build and run Compiler-RT tests on OS X, optional otherwise) cd llvm/projects svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx cd ../.. Build LLVM and Clang: mkdir build (in-tree build is not supported) cd build cmake -G "Unix Makefiles" ../llvm make This builds both LLVM and Clang for debug mode. Note: For subsequent Clang development, you can just run make clang. CMake allows you to generate project files for several IDEs: Xcode, Eclipse CDT4, CodeBlocks, Qt-Creator (use the CodeBlocks generator), KDevelop3. For more details see Building LLVM with CMake page. If you intend to use Clang's C++ support, you may need to tell it how to find your C++ standard library headers. In general, Clang will detect the best version of libstdc++ headers available and use them - it will look both for system installations of libstdc++ as well as installations adjacent to Clang itself. If your configuration fits neither of these scenarios, you can use the -DGCC_INSTALL_PREFIX cmake option to tell Clang where the gcc containing the desired libstdc++ is installed. Try it out (assuming you add llvm/build/bin to your path): clang --help clang file.c -fsyntax-only (check for correctness) clang file.c -S -emit-llvm -o - (print out unoptimized llvm code) clang file.c -S -emit-llvm -o - -O3 clang file.c -S -O3 -o - (output native machine code) If you encounter problems while building Clang, make sure that your LLVM checkout is at the same revision as your Clang checkout. LLVM's interfaces change over time, and mismatched revisions are not expected to work together. **使用brew安装问题解决** 问题: **➜ ~ brew install clang-omp** Error: You must `brew link cmake` before clang-omp can be installed 解决: **➜ ~ brew link --force cmake** Linking /usr/local/Cellar/cmake/3.4.1... Error: Could not symlink bin/ccmake Target /usr/local/bin/ccmake already exists. You may want to remove it: rm '/usr/local/bin/ccmake' To force the link and overwrite all conflicting files: brew link --overwrite cmake To list all files that would be deleted: brew link --overwrite --dry-run cmake **➜ ~ brew link --overwrite cmake** Linking /usr/local/Cellar/cmake/3.4.1... 28 symlinks created **➜ ~ brew install clang-omp** ==> Installing dependencies for clang-omp: libiomp ==> Installing clang-omp dependency: libiomp ==> Downloading https://homebrew.bintray.com/bottles/libiomp-20150701.el_capitan[/code]
相关文章推荐
- Mac OS上使用brew安装软件,类似ubuntu下的apt-get
- Mac OS使用brew安装Nginx、MySQL、PHP-FPM的LAMP开发环境
- 【Mac OS】brew的安装和使用
- mac os使用brew安装docker
- Mac OS使用brew安装Nginx、MySQL、PHP-FPM的LAMP开发环境
- MAC OS中使用brew安装php拓展
- Mac OS使用brew安装Nginx、MySQL、PHP-FPM的LAMP开发环境
- Mac OS上使用brew安装软件
- MAC上类apt-get工具brew的安装与使用
- mac环境中使用brew安装php5.5.15
- Mac OS安装MySQL(使用二进制PGK包安装)
- mac 安装使用 brew
- 【玩转Mac OS】01. Mac上P4Merge安装和使用
- Mac OS 10.10 下 cvs安装使用
- mac下使用brew安装svn javahl的问题
- 使用Brew安装GDB
- MAC - 使用 brew 安装东西时出现 curl: (7) Failed connect to downloads.sf.net:443; Operation timed out 的解决办法
- 使用brew安装软件
- 使用brew安装软件