-
Notifications
You must be signed in to change notification settings - Fork 39
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
Can't build (linking issues) on Intel/Ubuntu 20.04 #98
Comments
Possibly different gcc used to build clang vs c2ffi, or trying to build c2ffi with libc++ when clang was built with libstdc++, etc. |
I tried linking libc++ and libstdc++. Still the same problem. Then I removed llvm-12 and installed llvm/clang-10 from apt on Ubuntu to see if it makes a difference. Got the llvm-10 branch of c2ffi and now I get a different link error: /home/linuxbrew/.linuxbrew/bin/ld: cannot find -lclang-cpp libclang-cpp-dev is installed on my system, so I have no idea what's going on. Are you saying that I need to build llvm/clang from source to build c2ffi? |
Ok, I solved the issue, which was really pretty basic. First, I was compiling with the gnu compiler all along instead of clang. sudo update-alternatives --config c++ For good measure I made clang the default c compiler too (probably not needed): sudo update-alternatives --config cc That still did not work, so I had to install the libclang-cpp-10-dev package to compile (I had already installed all other dev packages). See error message in my previous post. That did the trick. I know this is pretty basic, but there are lots of lisp people using this tool and not all of them may be intimately familiar with C++/C tooling, so maybe we should add this information to the section describing the build process. I think lot of people quietly give up on using this tool (and cl-autowrap) due to these issues. |
@mustiboost , I agree with you about the difficulty with llvm. I was able to build c2ffi by using the command below:
I could only get c2ffi to link if I used clang/clang++ and the libraries provided by Ubuntu. I had tried to build LLVM 11.1.0 with gcc and with clang, but I would hit the same type of linking error. Debian 10 with gcc/g++ (8.3.0-6) and LLVM 11.1.0: @rpav , have you been able to link c2ffi with a llvm built from source or are you using the libraries provided by Ubuntu? If you are building it, can you provide how you are building it. Thanks. |
I've rarely had luck with Ubuntu-provided llvm. The real key seems to be using whatever you built llvm/clang with, because you're linking to it and it's expecting the same C++ version/ABI. E.g., if you built with g++ and libstdc++, use that. I will often build clang with g++, then rebuild with itself and libc++ .. in that case building c2ffi with clang/libc++ is necessary. |
I didn't have any luck with building on Debian 10. I had built llvm with g++ and then rebuilt with clang, but that didn't work. The only thing that I didn't try was rebuilding libc++. I ended up installing the packages from https://apt.llvm.org/ and that did work with clang++. |
Hey guys,
I get following errors during the linking stage:
I installed llvm/clang 12 via linuxbrew. Any idea what's going on?
The text was updated successfully, but these errors were encountered: