简体   繁体   English

OpenMP with clang

[英]OpenMP with clang

I was trying an openmp code with clang compiler as specified in 我正在尝试使用clang编译器的openmp代码

http://clang-omp.github.io/ http://clang-omp.github.io/

I downloaded the code via git and did make and make install . 我通过git下载了代码并做了makemake install It successfully installed the clang compiler with openmp support. 它成功安装了具有openmp支持的clang编译器。 But when I try to compile a sample code (specified in the above link), I get the following error : 但是当我尝试编译示例代码(在上面的链接中指定)时,我收到以下错误:

/usr/bin/ld: cannot find -liomp5 / usr / bin / ld:找不到-liomp5

I did not specify path to include and lib as mentioned in the site, but I intend to specify them while compiling on command line with -L and -I options. 我没有指定网站中提到的包含和lib的路径,但我打算在使用-L-I选项在命令行上编译时指定它们。

$ clang -I/usr/lib/gcc/i686-linux-gnu/4.6/include -fopenmp test.c -o test $ clang -I/usr/lib/gcc/i686-linux-gnu/4.6/include -fopenmp test.c -o test

However, I could not find path for iomp5 lib and hence I got the above error. 但是,我找不到iomp5 lib的路径,因此我得到了上述错误。 Can someone please tell me how to resolve this? 有人可以告诉我如何解决这个问题?

At first you need to build openmp library libiomp5. 首先,您需要构建openmp库libiomp5。 You can take the latest source code here http://llvm.org/svn/llvm-project/openmp/trunk/ 您可以在这里获取最新的源代码http://llvm.org/svn/llvm-project/openmp/trunk/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM