Page MenuHomeSolus

clang: enable openmp, fixes T6671

Authored by mati865 on Aug 3 2018, 3:10 PM.



This adds openmp support for clang.

Test Plan

Save example from and test with clang -fopenmp omp_test.c && ./a.out, it should create number of threads equal to the number of logical CPUs.
Do the same for 32 bit platform with clang -fopenmp -m32 omp_test.c && ./a.out.

Diff Detail

R1972 llvm
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mati865 created this revision.Aug 3 2018, 3:10 PM
mati865 requested review of this revision.Aug 3 2018, 3:10 PM
mati865 added inline comments.Aug 3 2018, 3:15 PM

Not sure if it's expected


The same as above

sunnyflunk requested changes to this revision.Aug 4 2018, 12:09 AM
sunnyflunk added a subscriber: sunnyflunk.

It still includes /usr/lib64/ in the llvm package, which I believe is a symlink to or, so it is correct that the symlink in llvm requires llvm-clang installed to resolve the file. That is ypkg working correctly by adding it as a dependency. They don't need to exist in a pattern to be included as everything ends up in the base package not matching a pattern within the package.yml or preset patterns in ypkg internally. Deleting libgomp's will fix it up.

I do have some big plans for LLVM/Clang, doing a full proper PGO build using it's own tooling, libc++ etc and making clang builds default to its own tools and libs. Then it will be a real option in solbuild to compete against GCC builds. However, since it will more than double the build time and take many many tries to get it right, it is awaiting something more powerful than my i3-6100U to sort it out on.


Lets remove this comment and use it later.


Either find a clang build option to disable libgomp symlinks, or need to add

# Do NOT include libgomp*, it will conflict with libgomp
rm $installdir/usr/lib{32,64}/libgomp.*

It is because...


He's still here. Once this is gone, so will the new dependency. Ditto for the 32bit packages

This revision now requires changes to proceed.Aug 4 2018, 12:09 AM

Do we need openmp for emul32 here? It seems to me it can be disabled like lld and lldb for emul32.

mati865 updated this revision to Diff 8604.Aug 4 2018, 11:16 AM

Addressing review comments

mati865 marked 6 inline comments as done.Aug 4 2018, 11:23 AM

Do we need openmp for emul32 here? It seems to me it can be disabled like lld and lldb for emul32.

I think it's good to have, those libs together are below 800 KiB and without them you cannot build 32 bit programs using openmp with clang.

sunnyflunk accepted this revision.Aug 7 2018, 2:09 AM
sunnyflunk edited the test plan for this revision. (Show Details)


This revision is now accepted and ready to land.Aug 7 2018, 2:11 AM
This revision was automatically updated to reflect the committed changes.