Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenMP with clang

I was trying an openmp code with clang compiler as specified in

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

I downloaded the code via git and did make and make install. It successfully installed the clang compiler with openmp support. 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

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.

$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. Can someone please tell me how to resolve this?

like image 507
sarda Avatar asked Dec 30 '13 07:12

sarda


People also ask

Does clang support OpenMP?

Clang fully supports OpenMP 4.5. Clang supports offloading to X86_64, AArch64, PPC64[LE] and has basic support for Cuda devices.

Does GCC support OpenMP?

Since GCC 11, OpenMP 4.5 is fully supported for Fortran and OpenMP 5.0 support has been extended for C, C++ and Fortran. GCC 12 has the initial support of OpenMP 5.1 and extends the OpenMP 5.0 coverage.

What is Llvm OpenMP?

llvm-openmp/12.0. 1 The OpenMP (Open Multi-Processing) specification is a standard for a set of compiler directives\, library routines\, and environment variables that can be used to specify shared memory parallelism in Fortran and C/C++ programs. This is the LLVM implementation.

Can you use OpenMP in C++?

The C++ compiler currently supports the OpenMP 2.0 standard. However, Visual Studio 2019 also now offers SIMD functionality. To use SIMD, compile by using the /openmp:experimental option.


1 Answers

At first you need to build openmp library libiomp5. You can take the latest source code here http://llvm.org/svn/llvm-project/openmp/trunk/

like image 137
Alexey Bataev Avatar answered Oct 15 '22 10:10

Alexey Bataev