Which version of clang should be used to build PPCG?

4 views
Skip to first unread message

Leo Yin

unread,
Oct 9, 2025, 4:10:44 AM (7 days ago) Oct 9
to isl Development
When I use clang-21.0.0 to build PPCG, the following errors are reported:

../../../ppcg/isl/interface/extract_interface.cc: In function 'clang::TextDiagnosticPrinter* construct_printer()':
../../../ppcg/isl/interface/extract_interface.cc:309:79: error: no matching function for call to 'clang::TextDiagnosticPrinter::TextDiagnosticPrinter(llvm::raw_fd_ostream&, clang::DiagnosticOptions*)'
  309 |         return new TextDiagnosticPrinter(llvm::errs(), new DiagnosticOptions());
      |                                                                               ^
In file included from ../../../ppcg/isl/interface/extract_interface.cc:75:
/home/yinle/dev/project/std/ppcg/install_llvm/include/clang/Frontend/TextDiagnosticPrinter.h:41:3: note: candidate: 'clang::TextDiagnosticPrinter::TextDiagnosticPrinter(llvm::raw_ostream&, clang::DiagnosticOptions&, bool)'
   41 |   TextDiagnosticPrinter(raw_ostream &os, DiagnosticOptions &DiagOpts,
      |   ^~~~~~~~~~~~~~~~~~~~~
/home/yinle/dev/project/std/ppcg/install_llvm/include/clang/Frontend/TextDiagnosticPrinter.h:41:61: note:   no known conversion for argument 2 from 'clang::DiagnosticOptions*' to 'clang::DiagnosticOptions&'
   41 |   TextDiagnosticPrinter(raw_ostream &os, DiagnosticOptions &DiagOpts,
      |                                          ~~~~~~~~~~~~~~~~~~~^~~~~~~~
../../../ppcg/isl/interface/extract_interface.cc: In function 'void create_diagnostics(clang::CompilerInstance*)':
../../../ppcg/isl/interface/extract_interface.cc:358:33: error: no matching function for call to 'clang::CompilerInstance::createDiagnostics(int, NULL, clang::TextDiagnosticPrinter*)'
  358 |         Clang->createDiagnostics(0, NULL, construct_printer());
      |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../../ppcg/isl/interface/extract_interface.cc:68:
/home/yinle/dev/project/std/ppcg/install_llvm/include/clang/Frontend/CompilerInstance.h:677:3: note: candidate: 'static llvm::IntrusiveRefCntPtr<clang::DiagnosticsEngine> clang::CompilerInstance::createDiagnostics(llvm::vfs::FileSystem&, clang::DiagnosticOptions&, clang::DiagnosticConsumer*, bool, const clang::CodeGenOptions*)'
  677 |   createDiagnostics(llvm::vfs::FileSystem &VFS, DiagnosticOptions &Opts,
      |   ^~~~~~~~~~~~~~~~~
/home/yinle/dev/project/std/ppcg/install_llvm/include/clang/Frontend/CompilerInstance.h:677:44: note:   no known conversion for argument 1 from 'int' to 'llvm::vfs::FileSystem&'
  677 |   createDiagnostics(llvm::vfs::FileSystem &VFS, DiagnosticOptions &Opts,
      |                     ~~~~~~~~~~~~~~~~~~~~~~~^~~
/home/yinle/dev/project/std/ppcg/install_llvm/include/clang/Frontend/CompilerInstance.h:654:8: note: candidate: 'void clang::CompilerInstance::createDiagnostics(llvm::vfs::FileSystem&, clang::DiagnosticConsumer*, bool)'
  654 |   void createDiagnostics(llvm::vfs::FileSystem &VFS,
      |        ^~~~~~~~~~~~~~~~~
/home/yinle/dev/project/std/ppcg/install_llvm/include/clang/Frontend/CompilerInstance.h:654:49: note:   no known conversion for argument 1 from 'int' to 'llvm::vfs::FileSystem&'
  654 |   void createDiagnostics(llvm::vfs::FileSystem &VFS,
      |                          ~~~~~~~~~~~~~~~~~~~~~~~^~~
../../../ppcg/isl/interface/extract_interface.cc: In function 'void set_invocation(clang::CompilerInstance*, clang::CompilerInvocation*)':
../../../ppcg/isl/interface/extract_interface.cc:465:16: error: 'class clang::CompilerInstance' has no member named 'setInvocation'; did you mean 'getInvocation'?
  465 |         Clang->setInvocation(invocation);
      |                ^~~~~~~~~~~~~
      |                getInvocation

The high versions of clang (such as 18.0.0 ~ 21.0.0) cannot be used to build PPCG, because clang APIs in ISL are too old.

My questions are:
1) which proper version of clang should be used to build PPCG.
2) is there any plan to upgrade PPCG/ISL/PET to use the newest clang APIs?
-- The newest clang has many advantages, such as it supports bfloat16, float16 types in C++ besides float32.

Thanks very much.
-Leo

Sven Verdoolaege

unread,
Oct 9, 2025, 12:38:54 PM (6 days ago) Oct 9
to Leo Yin, isl Development
On Wed, Oct 08, 2025 at 08:42:04PM -0700, Leo Yin wrote:
> The high versions of clang (such as 18.0.0 ~ 21.0.0) cannot be used to
> build PPCG, because clang APIs in ISL are too old.

What problem do you run into with 18.0.0? It should work.

> My questions are:
> 1) which proper version of clang should be used to build PPCG.

See pet/README for the latest known supported version.

> 2) is there any plan to upgrade PPCG/ISL/PET to use the newest clang APIs?

I'll try and have a look over the weekend.

skimo
Reply all
Reply to author
Forward
0 new messages