<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/91263>91263</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [MLIR] Installation/Packaging does not include libraries for tblgen-lsp-server and mlir-pdll-lsp-server when building with shared libs
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            mlir
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          UtkarshKunwar
      </td>
    </tr>
</table>

<pre>
    I was setting up my workspace to use a pre-compiled installation of the MLIR project. The rest of the tools are working fine as far as I have tested. The only issue I saw was with the executables for `tblgen-lsp-server` and `mlir-pdll-lsp-server` which I discovered while setting up LSP support for neovim.

**TL;DR:** When installing the MLIR project and building as shared libraries, the libraries `libMLIRPdllLspServerLib.so` and `libTableGenLspServerLib.so` aren't installed. The same behaviour is observe when packaging the project with `cpack`.

# Steps to reproduce

Checkout to the current latest stable tag at `llvmorg-18.1.5`.

## Build

![Screenshot_20240507_004628](https://github.com/llvm/llvm-project/assets/14164924/ee3b61d5-e8e4-4b91-89af-1397d2ef1e33)
I followed more or less the same instructions as [the official documentation](https://mlir.llvm.org/getting_started/). I only added where it should be installed and that I need to build shared libraries to reduce the size of the resulting installation due to space issues.

## Post compilation scenario

![Screenshot_20240507_004806](https://github.com/llvm/llvm-project/assets/14164924/8ce180e8-760e-41fb-99cb-b27bd68539b1)

The executables are built in `build/bin/` and the libraries `libMLIRPdllLspServerLib.so` and `libTableGenLspServerLib.so` are built in `build/lib/` and the binaries run just fine.

## Post installation scenario

![2024-05-07_01-03](https://github.com/llvm/llvm-project/assets/14164924/23d01d9d-ee0b-4950-8af8-14a7bd18fcb2)

![Screenshot_20240507_004918](https://github.com/llvm/llvm-project/assets/14164924/b8b821a6-e0a1-406c-b802-5ba37f384975)

The executables can't find the `.so`s because they aren't installed.

## Packaging scenario

![Screenshot_20240507_005913](https://github.com/llvm/llvm-project/assets/14164924/9e3dc5ff-fc62-43d5-9042-d67d6f2df198)

Packaging using CPack also shows the same behaviour. The same libraries are absent from the package but other libraries are present.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0Vk1v4zgS_TX0pUCDpD4sHXzYdOCFsVmg0clijw1SLFns0KJAUvFkfv2AVD7cbvfMNJABAhkRKVbVe68eS4ZgDiPillQ3pLpdyTkOzm__Fx-lD8N_5vEk_Uo5_bzdw0kGCBijGQ8wT3B8hpPzj2GSHUJ0MAcECZNH2rnjZCxqMGOI0loZjRvB9RAHhP_e7b_A5N037OIaHgYEjyG-rkbnbADpMZ-dIvVmRJABeunTzx4G-YQQMUTUy_dutM9gQpgR9hDkKSd6MnHIJ-Jv2M1RKosBeueB1Cwqe8CR2jDRgP4JPakZyFGntaM1nk7a2ovl02C6AfagTejcE3rU6ZXFc0Tu7j9DmKfJ-ZhDjeiezHFN2C1h_3p5ivT3cEeKm9svpHj5H_4_4PiKVjrsEqicnZqN1Wk18TDIlII1yktvMBDxKX_09iLVYo1Kh3zW1t6F6T7XcmfUOrizgq1RDwmdf-N4bZPHkYhNfE3uFfMgjwgKB_lk3OzBBHAqgwWnVMoku0d5eK3ktYjMCalZl5ZJzS6QKeA-4hSSljxO3um5w_MdnwbsHt0c04Z0bDd7j2MEK5MaIGSSIcoDyJgrs09H5w-UN2u-rq7ESyFvEqjfv-ekurnvPOIYBhe_CiZKVrHNV8bKWjSkuiWiGWKcQuZvR8TuYOIwq3XnjkTsUtiXH_pSORE7GQLGQMSOl7wuW1ESsUMsVM11RbHBkpaq5bRpZU950W60wJ5jURDRLnntoXfWuhNqODqP4DxYDCEjkdlIDPm5S70WkkRIdZPWXN-bzkgL2nXzEceYu_FaFUn665T22vlDqmpR9tcQpY-o86Z2Dful4aTWuQfQI5gIYXCz1aDwXSlZYXGQEfYwIurEW9bwD-pdKE98L-WY3_HVEDyG2eYG-85M9Jw9ZzGf3PvhGrufXYiw2NHyX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