From mboxrd@z Thu Jan 1 00:00:00 1970 From: fis trivial Subject: bug#32773: clang: missing default include paths for C++ Date: Mon, 8 Oct 2018 13:51:59 +0000 Message-ID: References: <19ece273-ea75-fc9d-4e4b-aa3a68deab6d@yahoo.de> <20180919183357.7xvaed2dwoxmecp7@thebird.nl> <85ba1fc6-e4cc-2989-14d6-bb152aa2dde4@yahoo.de> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9W4Z-0000Dj-0K for bug-guix@gnu.org; Mon, 08 Oct 2018 09:59:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g9Vy2-0001lD-Jy for bug-guix@gnu.org; Mon, 08 Oct 2018 09:53:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:35776) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g9Vy2-0001kp-AD for bug-guix@gnu.org; Mon, 08 Oct 2018 09:53:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g9Vy2-0001Wp-6J for bug-guix@gnu.org; Mon, 08 Oct 2018 09:53:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <85ba1fc6-e4cc-2989-14d6-bb152aa2dde4@yahoo.de> Content-Language: en-US List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Tim Gesthuizen Cc: "32773@debbugs.gnu.org" <32773@debbugs.gnu.org> 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=3D -std=3Dc++11 >> >> and >> >> CPPFLAGS +=3D -I$(GUIX)/include/c++ -I$(GUIX)/include/c++/x86_64-unkno= wn-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/c8a6871d2757557581640d7a14b4c91= 67459cb14/llvm.scm#L100 Using clang/clang++ from above link to compile a single translation unit sh= ould work. And there is `cquery' in `code.scm' within that repository, which re= lies 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 comfortab= le with the `clang-from-llvm' in guix, maybe someone could help carrying it ou= t. Jiaming