How to get correct version of libcxx for certain version of llvm/mlir?

Hi,
I’m building llvm-project from a historical version and trying to build mlir upon it.
I’m trying to use clang+±15 during building, but got error saying lack of libcxx. I assumed it would be needing libcxx15 although I was not sure. But when I started to build mlir after llvm is built, it kept giving errors during linking, so suspecting something to do with libcxx I installed.
So would anyone give advice how should I confirm which version of libcxx that I would be needing?

Thanks.

You don’t need libc++ for using clang: what system are you using? What is your Cmake invocation? What is the error you’re seeing?

Hi, I’m building mlir on ubuntu. I will get back to my computer to paste the commands and errors here. But generally the errors appeared when the .so are built for the mlir, and almost all .so failed to build.