clang_5 experimental headers for c++

112 views
Skip to first unread message

grr...@gmail.com

unread,
Jun 4, 2018, 9:14:43 AM6/4/18
to nix-devel
Hi, List.

I tried to follow clang's C++ coroutines guide [1] to test the new feature, but unfortunately got an error 

'experimental/coroutine' file not found

Looks like the problem is the experimental headers and libs are missing from the package. I've learned that one need to set certain CMake options described here: https://releases.llvm.org/5.0.0/projects/libcxx/docs/BuildingLibcxx.html#libc-experimental-options . The thing I don't understand at the moment is which expression to tweak. We have clang and clang-eabi versions in the tree, which one should I choose? Could someone guide me throw the process of enabling the experimentals?

Regards,
Sergey

Jörg Thalheim

unread,
Jun 8, 2018, 2:37:13 AM6/8/18
to nix-...@googlegroups.com
If you want libcxx instead of gcc's c++ header take a look at clangStdenv
instead of stdenv (unless you are on macOS where this is the default).
Then modify the expression at nixpkgs/pkgs/development/compilers/llvm/5/libc++
to include your cmake flags.

Sergey Mironov

unread,
Jun 10, 2018, 10:45:48 AM6/10/18
to Jörg Thalheim, nix-devel
Jörg, I've found a solution inspired by your answer. Thank you very
much. It turns out that I tried to use clang with libstdc++ from gcc.
Changing my development shell expression from `stdenv.mkDerivation {
name = 'foo'; ... }` to
`pkgs.llvmPackages_5..libcxxStdenv.mkDerivation { name = 'foo'; ... }`
worked for me out of the box. Coroutine header is already included and
I don't need to re-compile clang.

Regards,
Sergey
> --
> You received this message because you are subscribed to a topic in the Google Groups "nix-devel" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/nix-devel/E26ZstxTCcI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to nix-devel+...@googlegroups.com.
> To post to this group, send email to nix-...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/nix-devel/2049751.cpbDQPKsSu%40turingmachine.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages