unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: fis trivial <ybbs.daans@hotmail.com>
To: Tim Gesthuizen <tim.gesthuizen@yahoo.de>
Cc: "32773@debbugs.gnu.org" <32773@debbugs.gnu.org>
Subject: bug#32773: clang: missing default include paths for C++
Date: Mon, 8 Oct 2018 13:51:59 +0000	[thread overview]
Message-ID: <BLUPR16MB0500CA2820DDABDB7DE7B95A92E60@BLUPR16MB0500.namprd16.prod.outlook.com> (raw)
In-Reply-To: <85ba1fc6-e4cc-2989-14d6-bb152aa2dde4@yahoo.de>


Tim Gesthuizen writes:

> On 19.09.2018 20:33, Pjotr Prins wrote:
>> Hi Tim,
>>
>> I am not sure this helps but in a project I have I use
>>
>>   CPPFLAGS= -std=c++11
>>
>> and
>>
>>   CPPFLAGS += -I$(GUIX)/include/c++ -I$(GUIX)/include/c++/x86_64-unknown-linux-gnu
>>
>> to find include files in Guix context with clang. Where $(GUIX) is the
>> profile.
>>
>> Similar to yours. Glad to hear of a better way.
>
> Yes, that seems to be quite the same to my workaround.
> Its just that this is  a workaround that is difficult to get working in
> some contexts: I want to use emacs-irony-mode through guix which is not
> really useable because it won't autocomplete any std::* stuff.
> If you take all packages that might want to use libclang and other
> features of clang it might be a better solution to find a proper fix for
> this problem. Also both workarounds need a user profile that is
> cluttered with all include files.
> I had a quick look into clangs source code how C_INCLUDE_DIRS is
> implemented. It should be more or less easy to add the same option for
> C++ (even C_INCLUDE_DIRS seems to be tinkered in to me).
> I just wanted to file a bug about this because fixing this is not
> trivial and I am not sure whether I will find the time right away to fix it.
> Fixing it would also have the benefit that I could send the patch to the
> LLVM mailing list and we might see the change upstream in the next LLVM
> version.
>
> Tim.

Just put everything into `C_INCLUDE_DIRS' should make it work, see:

https://github.com/trivialfis/guixpkgs/blob/c8a6871d2757557581640d7a14b4c9167459cb14/llvm.scm#L100

Using clang/clang++ from above link to compile a single translation unit should
work.  And there is `cquery' in `code.scm' within that repository, which relies
on clang to work, you can try it out.

It shouldn't take long to make LLVM and Clang in there ready to be merge in
core-update or staging (I don't know yet), it's just I don't feel comfortable
with the `clang-from-llvm' in guix, maybe someone could help carrying it out.

Jiaming

  reply	other threads:[~2018-10-08 13:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19 18:23 bug#32773: clang: missing default include paths for C++ Tim Gesthuizen
2018-09-19 18:33 ` Pjotr Prins
2018-09-19 18:47   ` Tim Gesthuizen
2018-10-08 13:51     ` fis trivial [this message]
2018-09-22  0:58 ` Robin Templeton
2018-09-23 17:10   ` Tim Gesthuizen
2019-11-13 16:56 ` bug#32773: [PATCH] Fix clang libstdc++ header location search David Truby
2019-11-13 19:50   ` Carl Dong
2019-11-14 10:30   ` Mathieu Othacehe
2019-11-14 13:22     ` David Truby
2019-11-14 13:40       ` Mathieu Othacehe
2019-11-14 16:16         ` David Truby
2019-11-14 16:54           ` Mathieu Othacehe
2019-11-14 17:03             ` David Truby
2019-11-15  8:42               ` Mathieu Othacehe
2019-11-17 11:21                 ` Mathieu Othacehe
2019-11-19 13:08                   ` David Truby
2019-11-19 15:30                     ` Mathieu Othacehe
2019-11-17 19:29         ` Ludovic Courtès
2019-11-17 19:23     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BLUPR16MB0500CA2820DDABDB7DE7B95A92E60@BLUPR16MB0500.namprd16.prod.outlook.com \
    --to=ybbs.daans@hotmail.com \
    --cc=32773@debbugs.gnu.org \
    --cc=tim.gesthuizen@yahoo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).