PPCG does not build well on Ubuntu 24.04 LTS

132 views
Skip to first unread message

alex....@gmail.com

unread,
Jul 5, 2024, 9:50:46 AM7/5/24
to isl Development
  Hello.
    I have an Ubuntu 24.04 LTS installation, with clang and llvm version 18.1.3.

    I cloned today the PPCG source code from git://repo.or.cz/ppcg.git. I followed the instructions from the README. Everything works OK until I give make, which fails with the following error:
  <<extract_interface.cc:413:41: error: no matching function for call to ‘clang::SourceManager::createFileID(const clang::FileEntry*&, clang::SourceLocation, clang::SrcMgr::CharacteristicK
ind)’
        413 |         SM.setMainFileID(SM.createFileID(file, SourceLocation(),
            |                          ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
        414 |                                         SrcMgr::C_User));
            |                                         ~~~~~~~~~~~~~~~
      In file included from /usr/lib/llvm-18/include/clang/Frontend/CompilerInstance.h:14,
                       from extract_interface.cc:67:
      /usr/lib/llvm-18/include/clang/Basic/SourceManager.h:911:10: note: candidate:     ‘clang::FileID clang::SourceManager::createFileID(clang::FileEntryRef, clang::SourceLocation, clang::SrcMgr::CharacteristicKind, int, clang::SourceLocation::UIntTy)’
      911 |   FileID createFileID(FileEntryRef SourceFile, SourceLocation IncludePos,
            |          ^~~~~~~~~~~~
      /usr/lib/llvm-18/include/clang/Basic/SourceManager.h:911:36: note:   no known conversion for argument 1 from ‘const clang::FileEntry*’ to ‘clang::FileEntryRef’>>

    Did anybody else encounter this error?

    I changed the file extract_interface.cc and was able to get past this error, but another error appeared:
  <<extract_interface.cc: In function ‘void set_lang_defaults(clang::CompilerInstance*)’:
    extract_interface.cc:441:29: error: ‘setLangDefaults’ is not a member of ‘clang::CompilerInvocation’
        441 |         CompilerInvocation::setLangDefaults(Clang->getLangOpts(), IK_C,>>
    I'm currently trying to fix this error.

    Any help is appreciated.

  Thank you,
     Alex

Dmitry N. Mikushin

unread,
Jul 5, 2024, 6:44:31 PM7/5/24
to alex....@gmail.com, isl Development
Hi Alex,

FWIW: LLVM maintains an Ubuntu repository with different versions of LLVM. You may find it easier to use, instead of distro-provided Clang: https://apt.llvm.org/ Since clang-18 appears to be incompatible with PPCG, it's worth trying clang-17 from LLVM repo.

Kind regards,
Dmitry.

пт, 5 июл. 2024 г. в 13:50, alex....@gmail.com <alex....@gmail.com>:
--

---
You received this message because you are subscribed to the Google Groups "isl Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isl-developme...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isl-development/02540bed-95d2-4645-bd91-f077404a8b5cn%40googlegroups.com.

leeking leeking

unread,
Jul 7, 2024, 6:01:11 AM7/7/24
to isl Development
I have created a patch for this problem, https://github.com/lijinpei/isl-mirror/commit/b40431550f8352fb0a72629f3f811081b061dfc7 , but I don't know how to get it reviewed/submitted.

leeking leeking

unread,
Jul 7, 2024, 6:01:11 AM7/7/24
to isl Development
I created a patch for this problem https://github.com/lijinpei/isl-mirror/commit/b40431550f8352fb0a72629f3f811081b061dfc7 , but I don't know where I can get it reviewed/submitted.

Sven Verdoolaege

unread,
Jul 7, 2024, 6:03:06 AM7/7/24
to leeking leeking, isl Development
On Sun, Jul 07, 2024 at 02:34:52AM -0700, leeking leeking wrote:
> I created a patch for this problem
> https://github.com/lijinpei/isl-mirror/commit/b40431550f8352fb0a72629f3f811081b061dfc7
> , but I don't know where I can get it reviewed/submitted.

You should post it here.
Note that I have been working on a fix myself,
which should be out soon.

skimo

leeking leeking

unread,
Jul 7, 2024, 7:53:17 AM7/7/24
to isl Development
I noticed pet also has this problem, besides it uses clang::ArrayType:Static, which has been moved to another place in llvm-18. I created a patch for this problem https://github.com/lijinpei/pet-mirror/commit/2863bd4b6967d0174bd7834654aabe45361e8e39 .

Also I found polylib needs this patch to compile on my machine(it becomes werror on some machines):
```
commit 36765e47787f9370a52304052f07d2493b836f59
Author: Vincent Loechner <loec...@icps.u-strasbg.fr>
Date:   Thu Feb 4 12:49:10 2016 +0100

    function pre-declaration to remove warnings

diff --git a/applications/testCompressParms.c b/applications/testCompressParms.c
index 41f1a25..0fca2d9 100644
--- a/applications/testCompressParms.c
+++ b/applications/testCompressParms.c
@@ -42,6 +42,11 @@
 
 #define maxRays 200
 
+int test_Constraints_Remove_parm_eqs(Matrix * A, Matrix * B);
+int test_Polyhedron_Remove_parm_eqs(Matrix * A, Matrix * B);
+int test_Constraints_fullDimensionize(Matrix * A, Matrix * B,
+                                     unsigned int nbSamples);
+
```
It was created on 2016 while the polylib bundled with barvinok is from 2010.

Sven Verdoolaege

unread,
Jul 7, 2024, 5:11:50 PM7/7/24
to leeking leeking, isl Development
On Sun, Jul 07, 2024 at 04:53:17AM -0700, leeking leeking wrote:
> I noticed pet also has this problem, besides it uses
> clang::ArrayType:Static, which has been moved to another place in llvm-18.
> I created a patch for this problem
> https://github.com/lijinpei/pet-mirror/commit/2863bd4b6967d0174bd7834654aabe45361e8e39

For future reference, you should post the commit(s) here
(e.g., using git send-email), not a link to them.

> It was created on 2016 while the polylib bundled with barvinok is from 2010.

Updated.

skimo

Alex Susu

unread,
Jul 10, 2024, 2:57:06 PM7/10/24
to isl Development

  Hello.

    Skimo, when will you post your fix? (Will you post it at git://repo.or.cz/ppcg.git ?)

  Thank you,

     Alex

Sven Verdoolaege

unread,
Jul 10, 2024, 2:59:07 PM7/10/24
to Alex Susu, isl Development
On Wed, Jul 10, 2024 at 05:35:40AM -0700, Alex Susu wrote:
>
>
> Hello.
>
> Skimo, when will you post your fix? (Will you post it at git://repo.or.cz/ppcg.git
> ?)

It should be there already. Is it not working for you?

skimo

Alex Susu

unread,
Jul 11, 2024, 8:27:53 AM7/11/24
to isl Development
  Hello.
    Skimo, unfortunately, it's not working for me. I got away from the previous errors, but now I get linker errors:
libtool: link: g++ -std=c++11 -I/usr/lib/llvm-18/include -std=c++17 -fno-exceptions -funwind-tables -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -g -O2 -o extract_interface extract_interface-generator.o extract_interface-python.o extract_interface-cpp.o extract_interface-cpp_conversion.o extract_interface-plain_cpp.o extract_interface-template_cpp.o extract_interface-extract_interface.o  -L/usr/lib/llvm-18/lib -lclangFrontend -lclangSerialization -lclangParse -lclangSema -lclangEdit -lclangAnalysis -lclangAST -lclangLex -lclangDriver -lclangBasic -lclangSupport -lLLVM-18 -Wl,-rpath -Wl,/usr/lib/llvm-18/lib
/usr/bin/ld: /usr/lib/llvm-18/lib/libclangFrontend.a(CompilerInstance.cpp.o): in function `clang::CompilerInstance::createSema(clang::TranslationUnitKind, clang::CodeCompleteConsumer*)':
(.text._ZN5clang16CompilerInstance10createSemaENS_19TranslationUnitKindEPNS_20CodeCompleteConsumerE+0xef): undefined reference to `clang::api_notes::APINotesManager::loadCurrentModuleAPINotes(clang::Module*, bool, llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)'
/usr/bin/ld: /usr/lib/llvm-18/lib/libclangSema.a(Sema.cpp.o): in function `clang::Sema::Sema(clang::Preprocessor&, clang::ASTContext&, clang::ASTConsumer&, clang::TranslationUnitKind, clang::CodeCompleteConsumer*)':
(.text._ZN5clang4SemaC2ERNS_12PreprocessorERNS_10ASTContextERNS_11ASTConsumerENS_19TranslationUnitKindEPNS_20CodeCompleteConsumerE+0x19d): undefined reference to `clang::api_notes::APINotesManager::APINotesManager(clang::SourceManager&, clang::LangOptions const&)'
/usr/bin/ld: /usr/lib/llvm-18/lib/libclangSema.a(Sema.cpp.o): in function `clang::Sema::~Sema()':
(.text._ZN5clang4SemaD2Ev+0x15ae): undefined reference to `clang::api_notes::APINotesManager::~APINotesManager()'
/usr/bin/ld: /usr/lib/llvm-18/lib/libclangAnalysis.a(UnsafeBufferUsage.cpp.o): in function `clang::ast_matchers::internal::matcher_ignoringImpCasts0Matcher::matches(clang::Expr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const':
(.text._ZNK5clang12ast_matchers8internal32matcher_ignoringImpCasts0Matcher7matchesERKNS_4ExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal32matcher_ignoringImpCasts0Matcher7matchesERKNS_4ExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x55): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const'
/usr/bin/ld: /usr/lib/llvm-18/lib/libclangAnalysis.a(UnsafeBufferUsage.cpp.o): in function `clang::ast_matchers::internal::matcher_ignoringParenImpCasts0Matcher::matches(clang::Expr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const':
(.text._ZNK5clang12ast_matchers8internal37matcher_ignoringParenImpCasts0Matcher7matchesERKNS_4ExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal37matcher_ignoringParenImpCasts0Matcher7matchesERKNS_4ExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x55): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const'
/usr/bin/ld: /usr/lib/llvm-18/lib/libclangAnalysis.a(UnsafeBufferUsage.cpp.o): in function `clang::ast_matchers::internal::matcher_ignoringParens1Matcher::matches(clang::Expr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const':
(.text._ZNK5clang12ast_matchers8internal30matcher_ignoringParens1Matcher7matchesERKNS_4ExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal30matcher_ignoringParens1Matcher7matchesERKNS_4ExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x55): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const'
/usr/bin/ld: /usr/lib/llvm-18/lib/libclangAnalysis.a(UnsafeBufferUsage.cpp.o): in function `clang::ast_matchers::internal::matcher_hasCanonicalType0Matcher::matches(clang::QualType const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const':
(.text._ZNK5clang12ast_matchers8internal32matcher_hasCanonicalType0Matcher7matchesERKNS_8QualTypeEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal32matcher_hasCanonicalType0Matcher7matchesERKNS_8QualTypeEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x48): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const'
/usr/bin/ld: /usr/lib/llvm-18/lib/libclangAnalysis.a(UnsafeBufferUsage.cpp.o): in function `clang::ast_matchers::internal::VariadicOperatorMatcher<clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_hasType0Matcher, void (clang::ast_matchers::internal::TypeList<clang::Expr, clang::FriendDecl, clang::TypedefNameDecl, clang::ValueDecl, clang::CXXBaseSpecifier>), clang::ast_matchers::internal::Matcher<clang::QualType> >, clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_hasType0Matcher, void (clang::ast_matchers::internal::TypeList<clang::Expr, clang::FriendDecl, clang::TypedefNameDecl, clang::ValueDecl, clang::CXXBaseSpecifier>), clang::ast_matchers::internal::Matcher<clang::QualType> > >::operator clang::ast_matchers::internal::Matcher<clang::Expr><clang::Expr>() &&':
(.text._ZNO5clang12ast_matchers8internal23VariadicOperatorMatcherIJNS1_18PolymorphicMatcherINS1_23matcher_hasType0MatcherEFvNS1_8TypeListIJNS_4ExprENS_10FriendDeclENS_15TypedefNameDeclENS_9ValueDeclENS_16CXXBaseSpecifierEEEEEJNS1_7MatcherINS_8QualTypeEEEEEESG_EEcvNSD_IT_EEIS6_EEv[_ZNO5clang12ast_matchers8internal23VariadicOperatorMatcherIJNS1_18PolymorphicMatcherINS1_23matcher_hasType0MatcherEFvNS1_8TypeListIJNS_4ExprENS_10FriendDeclENS_15TypedefNameDeclENS_9ValueDeclENS_16CXXBaseSpecifierEEEEEJNS1_7MatcherINS_8QualTypeEEEEEESG_EEcvNSD_IT_EEIS6_EEv]+0x45): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::constructVariadic(clang::ast_matchers::internal::DynTypedMatcher::VariadicOperator, clang::ASTNodeKind, std::vector<clang::ast_matchers::internal::DynTypedMatcher, std::allocator<clang::ast_matchers::internal::DynTypedMatcher> >)'
/usr/bin/ld: (.text._ZNO5clang12ast_matchers8internal23VariadicOperatorMatcherIJNS1_18PolymorphicMatcherINS1_23matcher_hasType0MatcherEFvNS1_8TypeListIJNS_4ExprENS_10FriendDeclENS_15TypedefNameDeclENS_9ValueDeclENS_16CXXBaseSpecifierEEEEEJNS1_7MatcherINS_8QualTypeEEEEEESG_EEcvNSD_IT_EEIS6_EEv[_ZNO5clang12ast_matchers8internal23VariadicOperatorMatcherIJNS1_18PolymorphicMatcherINS1_23matcher_hasType0MatcherEFvNS1_8TypeListIJNS_4ExprENS_10FriendDeclENS_15TypedefNameDeclENS_9ValueDeclENS_16CXXBaseSpecifierEEEEEJNS1_7MatcherINS_8QualTypeEEEEEESG_EEcvNSD_IT_EEIS6_EEv]+0x55): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::dynCastTo(clang::ASTNodeKind) const'
/usr/bin/ld: /usr/lib/llvm-18/lib/libclangAnalysis.a(UnsafeBufferUsage.cpp.o): in function `clang::ast_matchers::internal::matcher_to0Matcher::matches(clang::DeclRefExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const':
(.text._ZNK5clang12ast_matchers8internal18matcher_to0Matcher7matchesERKNS_11DeclRefExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal18matcher_to0Matcher7matchesERKNS_11DeclRefExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x53): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const'
/usr/bin/ld: /usr/lib/llvm-18/lib/libclangAnalysis.a(UnsafeBufferUsage.cpp.o): in function `clang::ast_matchers::internal::matcher_hasSingleDecl0Matcher::matches(clang::DeclStmt const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const':
(.text._ZNK5clang12ast_matchers8internal29matcher_hasSingleDecl0Matcher7matchesERKNS_8DeclStmtEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal29matcher_hasSingleDecl0Matcher7matchesERKNS_8DeclStmtEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x53): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const'
/usr/bin/ld: /usr/lib/llvm-18/lib/libclangAnalysis.a(UnsafeBufferUsage.cpp.o): in function `clang::ast_matchers::internal::matcher_hasInitializer0Matcher::matches(clang::VarDecl const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const':
(.text._ZNK5clang12ast_matchers8internal30matcher_hasInitializer0Matcher7matchesERKNS_7VarDeclEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal30matcher_hasInitializer0Matcher7matchesERKNS_7VarDeclEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x61): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const'
/usr/bin/ld: /usr/lib/llvm-18/lib/libclangAnalysis.a(UnsafeBufferUsage.cpp.o): in function `clang::ast_matchers::internal::matcher_hasThen0Matcher::matches(clang::IfStmt const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const':
(.text._ZNK5clang12ast_matchers8internal23matcher_hasThen0Matcher7matchesERKNS_6IfStmtEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal23matcher_hasThen0Matcher7matchesERKNS_6IfStmtEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x73): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const'
/usr/bin/ld: /usr/lib/llvm-18/lib/libclangAnalysis.a(UnsafeBufferUsage.cpp.o): in function `clang::ast_matchers::internal::matcher_hasElse0Matcher::matches(clang::IfStmt const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const':
(.text._ZNK5clang12ast_matchers8internal23matcher_hasElse0Matcher7matchesERKNS_6IfStmtEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal23matcher_hasElse0Matcher7matchesERKNS_6IfStmtEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x76): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const'
/usr/bin/ld: /usr/lib/llvm-18/lib/libclangAnalysis.a(UnsafeBufferUsage.cpp.o):(.text._ZNK5clang12ast_matchers8internal24matcher_hasIndex0Matcher7matchesERKNS_18ArraySubscriptExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal24matcher_hasIndex0Matcher7matchesERKNS_18ArraySubscriptExprEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0xf4): more undefined references to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const' follow
/usr/bin/ld: /usr/lib/llvm-18/lib/libclangAnalysis.a(UnsafeBufferUsage.cpp.o): in function `findGadgets(clang::Decl const*, clang::UnsafeBufferUsageHandler const&, bool)':
(.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0x48): undefined reference to `clang::ast_matchers::MatchFinder::MatchFinder(clang::ast_matchers::MatchFinder::MatchFinderOptions)'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0x253): undefined reference to `clang::ast_matchers::unaryOperator'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0x2c7): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::tryBind(llvm::StringRef) const'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0x2db): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::dynCastTo(clang::ASTNodeKind) const'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0x46e): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::tryBind(llvm::StringRef) const'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0x482): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::dynCastTo(clang::ASTNodeKind) const'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0x508): undefined reference to `clang::ast_matchers::allOf'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0x694): undefined reference to `clang::ast_matchers::unaryOperator'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0x708): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::tryBind(llvm::StringRef) const'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0x71c): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::dynCastTo(clang::ASTNodeKind) const'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0x8b4): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::tryBind(llvm::StringRef) const'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0x8c8): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::dynCastTo(clang::ASTNodeKind) const'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0x943): undefined reference to `clang::ast_matchers::allOf'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0x997): undefined reference to `clang::ast_matchers::anyOf'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0xb29): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::dynCastTo(clang::ASTNodeKind) const'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0xb93): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::trueMatcher(clang::ASTNodeKind)'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0xba7): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::dynCastTo(clang::ASTNodeKind) const'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0xc20): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::dynCastTo(clang::ASTNodeKind) const'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0xc82): undefined reference to `clang::ast_matchers::anyOf'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0xd2b): undefined reference to `clang::ast_matchers::unless'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0xd6a): undefined reference to `clang::ast_matchers::arraySubscriptExpr'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0xde5): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::tryBind(llvm::StringRef) const'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0xdf9): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::dynCastTo(clang::ASTNodeKind) const'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0x100f): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::tryBind(llvm::StringRef) const'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0x1023): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::dynCastTo(clang::ASTNodeKind) const'
/usr/bin/ld: (.text._ZL11findGadgetsPKN5clang4DeclERKNS_24UnsafeBufferUsageHandlerEb+0x109e): undefined reference to `clang::ast_matchers::allOf'

    And so on. Can somebody help me here?
  Thank you,
     Alex

Sven Verdoolaege

unread,
Jul 11, 2024, 3:26:40 PM7/11/24
to Alex Susu, isl Development
On Thu, Jul 11, 2024 at 05:27:51AM -0700, Alex Susu wrote:
> Hello.
> Skimo, unfortunately, it's not working for me. I got away from the
> previous errors, but now I get linker errors:
> libtool: link: g++ -std=c++11 -I/usr/lib/llvm-18/include -std=c++17
> -fno-exceptions -funwind-tables -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS
> -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -g -O2 -o extract_interface
> extract_interface-generator.o extract_interface-python.o
> extract_interface-cpp.o extract_interface-cpp_conversion.o
> extract_interface-plain_cpp.o extract_interface-template_cpp.o
> extract_interface-extract_interface.o -L/usr/lib/llvm-18/lib
> -lclangFrontend -lclangSerialization -lclangParse -lclangSema -lclangEdit
> -lclangAnalysis -lclangAST -lclangLex -lclangDriver -lclangBasic
> -lclangSupport -lLLVM-18 -Wl,-rpath -Wl,/usr/lib/llvm-18/lib

Are you using libclang from a distribution (which one?) or
did you compile it yourself?
Usually, it is configured to produce a libclang-cpp.
Do you have that?
If so, have a look in interface/config.log to see why it wasn't found.

skimo

Alex Susu

unread,
Jul 22, 2024, 10:38:10 AM7/22/24
to isl Development
  Hello.
    Sorry for the late reply.
    Skimo, I'm using libclang from Ubuntu 24.04 LTS - I used sudo apt get install libclang-18-dev.

    I looked in ppcg/isl/interface/config.log and found this error message:
        configure:20727: checking for main in -lclang-cpp
        configure:20749: g++ -std=c++11 -o conftest -g -O2 -I/usr/lib/llvm-18/include -std=c++17   -fno-exceptions -funwind-tables -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I.  -L/usr/lib/llvm-18/lib   conftest.cpp -lclang-cpp   >&5
        /usr/bin/ld: cannot find -lclang-cpp: No such file or directory
    But there is a file /usr/lib/llvm-18/lib/libclang-cpp.so (and libclang-cpp.so.18.1) - I installed libclang-cpp through sudo apt get install clang. So the above g++ command shouldn't have given an error in my opinion.

    Please help.

  Thank you very much,
    Alex

Sven Verdoolaege

unread,
Jul 22, 2024, 3:51:53 PM7/22/24
to Alex Susu, isl Development
On Mon, Jul 22, 2024 at 07:38:08AM -0700, Alex Susu wrote:
> Hello.
> Sorry for the late reply.
> Skimo, I'm using libclang from Ubuntu 24.04 LTS - I used sudo apt get
> install libclang-18-dev.

Hmm... can you try installing libclang-cpp18-dev as well?

> I looked in ppcg/isl/interface/config.log and found this error message:
> configure:20727: checking for main in -lclang-cpp
> configure:20749: g++ -std=c++11 -o conftest -g -O2
> -I/usr/lib/llvm-18/include -std=c++17 -fno-exceptions -funwind-tables
> -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
> -D__STDC_LIMIT_MACROS -I. -L/usr/lib/llvm-18/lib conftest.cpp
> -lclang-cpp >&5
> /usr/bin/ld: cannot find -lclang-cpp: No such file or directory
> But there is a file /usr/lib/llvm-18/lib/libclang-cpp.so (and

What does

ls -l /usr/lib/llvm-18/lib/libclang-cpp.so

say?

> libclang-cpp.so.18.1) - I installed libclang-cpp through sudo apt get
> install clang. So the above g++ command shouldn't have given an error in my
> opinion.

Can you reproduce it from the command line?

In the mean time, I've been trying to get it to work without libclang-cpp
as well, so you could also try the attached patch.

skimo
diff

Alex Susu

unread,
Jul 23, 2024, 10:59:08 AM7/23/24
to isl Development
  Hello.
    Skimo, you can find my answers inlined in your reply.

On Monday, July 22, 2024 at 10:51:53 PM UTC+3 Sven Verdoolaege wrote:
On Mon, Jul 22, 2024 at 07:38:08AM -0700, Alex Susu wrote:
> Hello.
> Sorry for the late reply.
> Skimo, I'm using libclang from Ubuntu 24.04 LTS - I used sudo apt get
> install libclang-18-dev.

Hmm... can you try installing libclang-cpp18-dev as well?

I installed libclang-cpp18-dev. And after that I did a fresh install of PPCG (and its submodules) - and now it worked.

 
> I looked in ppcg/isl/interface/config.log and found this error message:
> configure:20727: checking for main in -lclang-cpp
> configure:20749: g++ -std=c++11 -o conftest -g -O2
> -I/usr/lib/llvm-18/include -std=c++17 -fno-exceptions -funwind-tables
> -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
> -D__STDC_LIMIT_MACROS -I. -L/usr/lib/llvm-18/lib conftest.cpp
> -lclang-cpp >&5
> /usr/bin/ld: cannot find -lclang-cpp: No such file or directory
> But there is a file /usr/lib/llvm-18/lib/libclang-cpp.so (and

What does

ls -l /usr/lib/llvm-18/lib/libclang-cpp.so

say?
 
    ls -l /usr/lib/llvm-18/lib/libclang-cpp.so says:
     ... libclang-cpp.so -> libclang-cpp.so.18.1
    In fact, libclang-cpp.so is a sym-link to libclang-cpp.so.18.1 - I created manually the sym-link.

> libclang-cpp.so.18.1) - I installed libclang-cpp through sudo apt get
> install clang. So the above g++ command shouldn't have given an error in my
> opinion.

Can you reproduce it from the command line?
 
    No, because I'm not able to recreate the source file conftest.cpp.

In the mean time, I've been trying to get it to work without libclang-cpp
as well, so you could also try the attached patch.

    I don't have the file m4/ax_detect_clang.m4. How can I generate this file? So I can't apply the attached patch.
 
 
skimo

  Thank you,
    Alex 

Sven Verdoolaege

unread,
Jul 24, 2024, 3:01:30 PM7/24/24
to Alex Susu, isl Development
On Tue, Jul 23, 2024 at 07:59:06AM -0700, Alex Susu wrote:
> On Monday, July 22, 2024 at 10:51:53 PM UTC+3 Sven Verdoolaege wrote:
>
> On Mon, Jul 22, 2024 at 07:38:08AM -0700, Alex Susu wrote:
> > Hello.
> > Sorry for the late reply.
> > Skimo, I'm using libclang from Ubuntu 24.04 LTS - I used sudo apt get
> > install libclang-18-dev.
>
> Hmm... can you try installing libclang-cpp18-dev as well?
>
>
> I installed libclang-cpp18-dev. And after that I did a fresh install of
> PPCG (and its submodules) - and now it worked.

OK, then I guess your problem is solved and
the other question are not really relevant anymore.

> > libclang-cpp.so.18.1) - I installed libclang-cpp through sudo apt get
> > install clang. So the above g++ command shouldn't have given an error in
> my
> > opinion.
>
> Can you reproduce it from the command line?
>
>
> No, because I'm not able to recreate the source file conftest.cpp.

touch conftest.cpp

would've been enough.

> In the mean time, I've been trying to get it to work without libclang-cpp
> as well, so you could also try the attached patch.
>
>
> I don't have the file m4/ax_detect_clang.m4. How can I generate this
> file? So I can't apply the attached patch.

It was a patch for isl. Perhaps you didn't cd into isl.

skimo
Reply all
Reply to author
Forward
0 new messages