<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/59101>59101</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
LLVM still and will not support for static link openmp?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
TaoTao-real
</td>
</tr>
</table>
<pre>
every one.
I am curious about did clang can't static link the openmp library when compliling. When i try to build spec2017 intspeed benchmarks, I found when i try to build them staticly, will failed with error `cannot find -lomp`.
```console
/usr/lib/llvm-10/bin/clang -m64 -z muldefs -pthread -static -DSPEC_LINUX_X64 -DSPEC_OPENMP -fopenmp -Wno -return-type -DUSE_OPENMP -I /usr/lib/lib/libomp_oss/exports/common/include av.o caretx.o deb.o doio.o doop.o dum p.o globals.o gv.o hv.o keywords.o locale.o mg.o numeric.o op.o pad.o perl.o perlapi.o perlio.o perlmain.o perly.o pp.o pp_ctl.o pp_hot.o pp_pack.o pp_sort.o pp_sys.o regcomp.o regexec.o run.o scope.o sv.o taint.o toke.o univers al.o utf8.o util.o reentr.o mro_core.o mathoms.o specrand/specrand.o dist/PathTools/Cwd.o dist/Data-Dumper/Dumper. o ext/Devel-Peek/Peek.o cpan/Digest-MD5/MD5.o cpan/Digest-SHA/SHA.o DynaLoader.o dist/IO/IO.o dist/IO/poll.o cpan/ MIME-Base64/Base64.o Opcode.o dist/Storable/Storable.o ext/Sys-Hostname/Hostname.o cpan/Time-HiRes/HiRes.o ext/XS- Typemap/stdio.o ext/attributes/attributes.o cpan/HTML-Parser/Parser.o ext/mro/mro.o ext/re/re.o ext/re/re_comp.o e xt/re/re_exec.o ext/arybase/arybase.o ext/PerlIO-scalar/scalar.o ext/PerlIO-via/via.o ext/File-Glob/bsd_glob.o ext /File-Glob/Glob.o ext/Hash-Util/Util.o ext/Hash-Util-FieldHash/FieldHash.o ext/Tie-Hash-NamedCapture/NamedCapture. o cpan/Scalar-List-Utils/ListUtil.o -lm -fopenmp -L/usr/lib/lib/libomp_oss/exports/lin_32e/lib -o perlbench_s
/usr/local/bin/ld: cannot find -lomp
```
So, i searched the llvm lib for omp, only find libomp.so, but no omp realated `.a` file. Then found the posted mail of wheather need static openmp library, seem like LLVM developers reject this opinion.
https://lists.llvm.org/pipermail/openmp-dev/2016-January/001051.html
Did i miss something, or is there someway can link openmp staticly i not found?
Thanks for your suggestions.
I did build those spec benchmarks use llvm10 and llvm15 with dynamic link on ubuntu20.04, all found the -lomp, build successfully.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVFstyIjnsa-CiaqqbV8KBw0wIm2wlk9RCduZGubsFeHHbXX4kw379SnYDeZyWotSyZettSaWpj3N8RXsEo3HQyxe9_FuC9yAaqIKVJjgQpQkeallDpYTeQSV0b3jlwXnhZQVK6gP4PYJpUTctrUsriOfbHjVUpmmVpCO7AfzkDQmeaN5AGaSqwbVYDfPiCqT2hGMNJepq3wh7cL3hDdzD1gRdJ2af7pLMplNCHfnwm1QKtkIqYvMm_R7QWmOhN81JZW08bCWxyhTpRHsD6Cye5ulfGe2MwrQL0Bsug7MEySCG6rXJipywUpL9y-SLrJmOAbJ_oQmqxq0D_mWt31sUJKpzEe8tVs-3N5uH-x8vvza_-NJp6-n59sfjM2Tbzn_ZT22IaNEHqzN_bJFOvqxuzwfvv6h2gmTYxjhy3BJ_t8Z6xigCjWGFpa5UqBFAvA4MBZEE_CakxpKhkSZ-TMuf0AAwslOmFMoxxpf2DA54fDO25k1lKqGQkGZHQIcGrawIi0xaUTNEq7qPaGWHRVmMNELqDj3Sl4TGm-2m8iohe-MT0orqkDBHlnXYkbWwuOM0Sxj-RtbABubrKvIpf1lvT7L4njcH3gtaUupTwARLCn57HT9SRT6ovWW7rNlUxkYThd-bhuVxzlqha_LpCWWfSedp55mOrY1R7Pqbt3eEhfAiW4SGbOVVRAYABvB3JNNDVNkz4oGZ0Idj1PJLWy7kDp3P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