<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/57736>57736</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[flang-new] libpgmath dependency with LLVM 15.0.0
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ggouaillardet
</td>
</tr>
</table>
<pre>
I am facing a similar problem with `flang-new` built from the `llvm-project-15.0.0.src.tar.xz` tarball on `aarch64`:
```
$ cat test.f90
program foo
complex :: c
c = 2.0
write(*,*) sqrt(c)
end program
$ flang-new test.f90 -L/opt/llvm-15.0.0/lib
/opt/binutils-2.38/bin/ld: /tmp/test-f595ae.o: in function `_QQmain':
/home/rist/r00018/./test.f90:5: undefined reference to `__fc_sqrt_1'
flang-new: error: linker command failed with exit code 1 (use -v to see invocation)
```
A workaround is to manally build `libpgmath` and add it to the link command line
```
$ flang-new test.f90 -L/opt/llvm-15.0.0/lib -L$HOME/local/libpgmath/lib -lpgmath
$
```
One disturbing (at least for me) part is that `libpgmath` is not part of the `llvm-project-15.0.0.src.tar.xz` tarball.
Should `libpgmath` be part of LLVM 15 (and `flang-new` automatically links to it)?
This issue has been discussed in #57670 and #57602 and it is best to follow up in its own ticket.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVVU2P2zgM_TX2hYjhjzgeH3yYdjboAlMURRd7HUg2bWtHtlxJnszsry8pJ5Ogu9hFk8AQRZF8fHxypOnemt9BTNCLVs0DCHBqUlpYWKyRGic4KT9CdEh7LeZhN-OJ1iBXpT301kzgR2S31i_TjmL-wtbvsjJJ6etsm3hhk9e_OYZWUmgNZubzQth2POxpFRX3UfoQpZcn7Wy_zcz30AoPHp1P-jqFbZsqDZZhG3MbDPRpzbRofAXOW9xDe-OhvQfIk_S6dbLKY5TfRTlV-hieNbjv1tNeS-vb5Dh3cK57xfZOyxXh7jHKj2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