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

p3-ex4 does not compile on llvm/clang 16.05 #4

Open
Kevin-Delnoije opened this issue Jun 9, 2023 · 2 comments
Open

p3-ex4 does not compile on llvm/clang 16.05 #4

Kevin-Delnoije opened this issue Jun 9, 2023 · 2 comments

Comments

@Kevin-Delnoije
Copy link

I am using the apt installed llvm 16 version on ubuntu 22.04

-- Found supported version: LLVM 16.0.5
-- Using LLVMConfig.cmake in: /usr/lib/llvm-16/cmake
-- Found supported version: Clang 16.0.5
-- Using ClangConfig.cmake in: /usr/lib/cmake/clang-16

the following functions are not found.

[  0%] Built target intrinsics_gen
[ 16%] Building CXX object examples/p3-ex1/CMakeFiles/p3-ex1.dir/p3-ex1.cpp.o
[ 33%] Linking CXX executable ../../bin/p3-ex1
[ 33%] Built target p3-ex1
[ 50%] Building CXX object examples/p3-ex4/CMakeFiles/p3-ex4-lib.dir/p3-ex4-lib.cpp.o
/home/kevin/Code/thirdparty/pldi-tutorials-2023/examples/p3-ex4/p3-ex4-lib.cpp: In function ‘std::unique_ptr<clang::Interpreter> CreateInterpreter()’:
/home/kevin/Code/thirdparty/pldi-tutorials-2023/examples/p3-ex4/p3-ex4-lib.cpp:49:6: error: ‘class clang::IncrementalCompilerBuilder’ has no member named ‘SetCompilerArgs’
   49 |   CB.SetCompilerArgs({"-resource-dir", ResourceDir.c_str(), "-std=c++20"});
      |      ^~~~~~~~~~~~~~~
/home/kevin/Code/thirdparty/pldi-tutorials-2023/examples/p3-ex4/p3-ex4-lib.cpp:53:21: error: ‘class clang::IncrementalCompilerBuilder’ has no member named ‘CreateCpp’; did you mean ‘create’?
   53 |   CI = ExitOnErr(CB.CreateCpp());
      |                     ^~~~~~~~~
      |                     create
/home/kevin/Code/thirdparty/pldi-tutorials-2023/examples/p3-ex4/p3-ex4-lib.cpp: In function ‘FnAddr_t Clang_GetFunctionAddress(Decl_t)’:
/home/kevin/Code/thirdparty/pldi-tutorials-2023/examples/p3-ex4/p3-ex4-lib.cpp:96:16: error: request for member ‘getValue’ in ‘* Addr.llvm::Expected<long unsigned int>::operator->()’, which is of non-class type ‘std::remove_reference_t<long unsigned int>’ {aka ‘long unsigned int’}
   96 |   return Addr->getValue();
      |                ^~~~~~~~
make[2]: *** [examples/p3-ex4/CMakeFiles/p3-ex4-lib.dir/build.make:76: examples/p3-ex4/CMakeFiles/p3-ex4-lib.dir/p3-ex4-lib.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:351: examples/p3-ex4/CMakeFiles/p3-ex4-lib.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

these seem to have been added 2 weeks ago in clang/Interpreter/Interpreter.h

@vgvassilev
Copy link
Contributor

vgvassilev commented Jun 9, 2023

Yes, unfortunately most examples we don’t support llvm 16 or any llvm older than two weeks :(

PS: I need to adjust the supported llvm version in cmake.

@Kevin-Delnoije
Copy link
Author

no problem, will try out the apt development branch of llvm17 later today.

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

No branches or pull requests

2 participants