[cfe-dev] LibTooling CMake Error

Manuel Klimek klimek at google.com
Sun Oct 21 02:13:50 PDT 2012


On Fri, Oct 19, 2012 at 11:09 PM, Mohammad Adil <madil90 at gmail.com> wrote:

> Thnx a lot for your help. Is there any chance this will be resolved soon?
> So, basically, there is absolutely no way in which proper paths for C++ can
> be added without hardcoding right now? I cloned the standard clang
> repository right now. Is there a development branch that might be more
> up-to-date?


clang-tool behave the same way clang does here - they need to find their
builtin includes; by default, the tools find those in
../lib/clang/<version>/include.

There are two ways to solve this problem:
1. copy the tool you wrote next to the clang binary you built from the same
source tree
2. create an "installation" of your tool, where
../lib/clang/<version>/include points to the builtin headers

I'm not sure what else could be done here. Ideas welcome :)

Cheers,
/Manuel


>
>
> On Sat, Oct 20, 2012 at 1:39 AM, Sean Silva <silvas at purdue.edu> wrote:
>
>> > I checked the directories using -v and two directories namely
>> > "../lib/clang/3.2/include" and "/include" were not found. As you can
>> see,
>> > these paths are wrong. They should be "/usr/local/lib/clang.." and
>> > "/usr/include". How can I fix this?
>>
>> This is the issue that I warned you about in the other thread, and it
>> has no solution to my knowledge except for hardcoding the correct
>> path.
>>
>> -- Sean Silva
>>
>> On Fri, Oct 19, 2012 at 11:33 AM, Mohammad Adil <madil90 at gmail.com>
>> wrote:
>> > That problem is resolved using a different CMakeLists. I am having a
>> > slightly different problem now. The tool works now but when it is
>> giving an
>> > error:
>> >
>> > #include <stddef.h> not found
>> >
>> > I checked the directories using -v and two directories namely
>> > "../lib/clang/3.2/include" and "/include" were not found. As you can
>> see,
>> > these paths are wrong. They should be "/usr/local/lib/clang.." and
>> > "/usr/include". How can I fix this?
>> >
>> > The second problem is that I want to run this tool on a source file
>> rather
>> > than code given through command line. How do I do that? I also want to
>> > retain the original locations in the source file so that I can rewrite
>> to
>> > it.
>> >
>> > Regards.
>> > Adil
>> >
>> > On Fri, Oct 19, 2012 at 8:26 PM, David Blaikie <dblaikie at gmail.com>
>> wrote:
>> >>
>> >> On Fri, Oct 19, 2012 at 3:52 AM, madil90 <madil90 at gmail.com> wrote:
>> >> > Hi,
>> >> >    I am trying to setup LibTooling for clang. I have gone through the
>> >> > procedure given at </a>
>> >> > <http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html> . I can
>> >> > succesfully run clang-check for any source file. I am now trying to
>> >> > compile
>> >> > the example at  </a> <
>> http://clang.llvm.org/docs/RAVFrontendAction.html>
>> >> > .
>> >> > When using cmake, I get the following error:
>> >> >
>> >> > Unknown CMake command : add_clang_executable
>> >> >
>> >> >   When using cmake to build clang, I used
>> >> > -DEXPORT_CMAKE_COMPILE_COMMANDS=ON
>> >> > variable as suggested. Then why isn't this command working?
>> >>
>> >> My best guess would be that you don't have a version of cmake that
>> >> supports this command, but I don't really know. This functionality was
>> >> only added (to both Clang an CMake) in the last 6 months or so.
>> >>
>> >> >
>> >> > Regards,
>> >> > Adil
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > View this message in context:
>> >> >
>> http://clang-developers.42468.n3.nabble.com/LibTooling-CMake-Error-tp4027570.html
>> >> > Sent from the Clang Developers mailing list archive at Nabble.com.
>> >> > _______________________________________________
>> >> > cfe-dev mailing list
>> >> > cfe-dev at cs.uiuc.edu
>> >> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>> >
>> >
>> >
>> >
>> > --
>> > Mohammad Adil
>> > LUMS SSE
>> >
>> >
>> > _______________________________________________
>> > cfe-dev mailing list
>> > cfe-dev at cs.uiuc.edu
>> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>> >
>>
>
>
>
> --
> Mohammad Adil
> LUMS SSE
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121021/31c1c873/attachment.html>


More information about the cfe-dev mailing list