Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux: libdxcompiler.so dependency on libncurses5 library #4892

Closed
turanszkij opened this issue Dec 17, 2022 · 6 comments · Fixed by #4908
Closed

Linux: libdxcompiler.so dependency on libncurses5 library #4892

turanszkij opened this issue Dec 17, 2022 · 6 comments · Fixed by #4908

Comments

@turanszkij
Copy link

Hello, when I updated the libdxcompiler.so recently, I got this error when trying to load the dynamic library:

libtinfo.so.5: cannot open shared object file: No such file or directory

dlopen() was used to load the libdxcompiler.so, and the error was retrieved by dlerror(). I'm not sure when this was introduced, because I updated a quite old version to this commit: 2c3d965

The error can be resolved by installing the libncurses5 library, but this was not required by an older version of the compiler.

Best regards,
Janos

@vettoreldaniele
Copy link
Collaborator

The library is brought in by LLVM here: https://github.com/microsoft/DirectXShaderCompiler/blob/main/lib/Support/CMakeLists.txt#L14. You can try setting -DLLVM_ENABLE_TERMINFO=0 in the CMake command to disable it.

I quickly tried it and I can confirm this works:

$ ldd lib/libdxcompiler.so
        linux-vdso.so.1 (0x00007ffed65f8000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fb9a0400000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fb9a2001000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fb9a1fe1000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb9a0000000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fb9a2101000)

@turanszkij
Copy link
Author

Thank you, but I am not building DXC myself, but using the downloadable binaries, so I was hoping that this could be fixed inside the official repo.

@vettoreldaniele
Copy link
Collaborator

@llvm-beanz

Hey Chris, I'm not too familiar with that terminfo support enables that DXC can benefit from (this comes from the LLVMSupport library). Any opinion on changing the default for releases?

@llvm-beanz
Copy link
Collaborator

This change is likely the result of changes to the VM image that we built the release binaries on.

I don't know that we get much (or any) benefit from linking terminfo at the moment because of how DXC manages output. The feature in LLVM that is driven with it is colorized error messages (which would be awesome to get working).

@Jasper-Bekkers
Copy link

I don't know that we get much (or any) benefit from linking terminfo at the moment because of how DXC manages output. The feature in LLVM that is driven with it is colorized error messages (which would be awesome to get working).

I'm not sure if the .so needs colorized output support though 😉

@llvm-beanz
Copy link
Collaborator

I'm not sure if the .so needs colorized output support though 😉

The architecture of DXC requires that for the dxc executable to support colorized output the .so needs to supply that support since dxc is just a thin wrapper around the library.

That said, making dxc provide colorized output is likely a non-trivial amount of work since DXC's output writing system is... complicated. It is probably reasonable to set LLVM_ENABLE_TERMINFO to Off in the PredefinedParams.cmake file so that we don't bring in the curses dependency.

Keenuts added a commit to Keenuts/DirectXShaderCompiler that referenced this issue Jan 3, 2023
Having this enabled makes dxc depends on ncurses5. This is required by
LLVM when supporting colored message output, but DXC doesn't supports it
for now.

Fixes microsoft#4892
Keenuts added a commit that referenced this issue Jan 3, 2023
Having this enabled makes dxc depends on ncurses5. This is required by
LLVM when supporting colored message output, but DXC doesn't supports it
for now.

Fixes #4892
pow2clk pushed a commit that referenced this issue Feb 27, 2023
Having this enabled makes dxc depends on ncurses5. This is required by
LLVM when supporting colored message output, but DXC doesn't supports it
for now.

Fixes #4892

(cherry picked from commit 88a2888)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants