Hi everyone. I’m trying to compile tangerine using Nix, and am stuck in the compiling phase. It seems the parallel execution strategies in std::execution
are missing from libc++
in my build.
What I tried
I first tried a very simple nix file:
{
cmake,
SDL2,
stdenv,
}:
stdenv.mkDerivation {
name = "tangerine";
src = ./.;
nativeBuildInputs = [cmake];
buildInputs = [SDL2];
}
Which resulted in the following error:
/tmp/nix-build-tangerine.drv-0/tangerine/third_party/naive-surface-nets/src/surface_nets.cpp:1175:14: error: no member named 'execution' in namespace 'std'; did you mean 'exception'?
std::execution::par,
~~~~~^~~~~~~~~
exception
(full log)
Since the build instructions specify using llvm 17, I tried with that:
{
cmake,
SDL2,
llvmPackages_17,
stdenv,
}:
stdenv.mkDerivation {
name = "tangerine";
src = ./.;
nativeBuildInputs = [cmake llvmPackages_17.clang];
buildInputs = [SDL2];
}
Which slightly changed the error:
/tmp/nix-build-tangerine.drv-0/tangerine/third_party/naive-surface-nets/src/surface_nets.cpp:1175:25: error: no member named 'par' in namespace 'std::execution'
1175 | std::execution::par,
| ~~~~~~~~~~~~~~~~^
(full log)
Newer versions of clang do not seem to change the behavior.
Possible Cause
I haven’t found much online about this problem, but this issue seems to imply that libc++
needs to be compiled using LIBCXX_ENABLE_PARALLEL_ALGORITHMS
.
On the other hand, I am not even sure I am using the correct libc++
in the first place. Does Nix automatically set --libstd=
?