unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: Mathieu Othacehe <m.othacehe@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: Clang c++ include path
Date: Mon, 28 Oct 2019 18:58:38 +0100	[thread overview]
Message-ID: <871ruwlpkh.fsf@elephly.net> (raw)
In-Reply-To: <87wocpz2zl.fsf@gmail.com>


Hi Mathieu,

> When running clang on a c++ program, it cannot find c++ std libraries.
> That's because, those libraries path are hardcoded inside g++ compiler
> and clang cannot find them.

Does this patch help?

--8<---------------cut here---------------start------------->8---
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 9efb4a4841..3c59e8d26d 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -204,7 +204,7 @@ compiler.  In LLVM this library is called \"compiler-rt\".")
                            (compiler-rt (assoc-ref inputs "clang-runtime")))
                        (case (string->number ,(version-major
                                                (package-version clang-runtime)))
-                         ((or 6 7)
+                         ((or 6 7 8)
                           ;; Link to libclang_rt files from clang-runtime.
                           (substitute* "lib/Driver/ToolChain.cpp"
                             (("getDriver\\(\\)\\.ResourceDir")
@@ -363,16 +363,15 @@ requirements according to version 1.1 of the OpenCL specification.")
                 "1mf9cpgvix34xlpv0inkgl3qmdvgvp96f7sksqizri0n5xfp1cgp"))
               (file-name (string-append "libomp-" version ".tar.xz"))))
     (build-system cmake-build-system)
-    ;; XXX: Note this gets built with GCC because building with Clang itself
-    ;; fails (missing <atomic>, even when libcxx is added as an input.)
     (arguments
      '(#:configure-flags '("-DLIBOMP_USE_HWLOC=ON"
-                           "-DOPENMP_TEST_C_COMPILER=clang"
-                           "-DOPENMP_TEST_CXX_COMPILER=clang++")
+                           "-DCMAKE_C_COMPILER=clang"
+                           "-DCMAKE_CXX_COMPILER=clang++")
        #:test-target "check-libomptarget"))
     (native-inputs
      `(("clang" ,clang)
        ("llvm" ,llvm)
+       ("libcxx" ,libcxx)
        ("perl" ,perl)
        ("pkg-config" ,pkg-config)))
     (inputs
--8<---------------cut here---------------end--------------->8---


-- 
Ricardo

  reply	other threads:[~2019-10-28 17:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-28  8:30 Clang c++ include path Mathieu Othacehe
2019-10-28 17:58 ` Ricardo Wurmus [this message]
2019-10-28 22:08   ` Mark H Weaver
2019-10-28 22:48     ` Marius Bakke
2019-11-03 14:30     ` Ludovic Courtès
2019-11-07 16:29     ` Danny Milosavljevic
2019-11-07 17:34       ` Danny Milosavljevic
2019-11-07 18:43       ` Carl Dong
2019-11-07 19:52       ` Mark H Weaver
2019-10-29 15:37   ` Mathieu Othacehe
2019-11-11 15:12   ` David Truby
2019-11-11 17:17     ` Mathieu Othacehe
2019-11-13 16:59     ` David Truby
  -- strict thread matches above, loose matches on Subject: below --
2019-11-07  3:17 Protonmail Bridge
2019-10-28  8:19 Mathieu Othacehe

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=871ruwlpkh.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=guix-devel@gnu.org \
    --cc=m.othacehe@gmail.com \
    /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).