Hy, i’m including CUDA in my derivation so that StarPU can enable CUDA features. The problem is that it fails to build. The current version relates an error with GCC 14.3 which is know with CUDA.
/nix/store/82kmz7r96navanrc2fgckh2bamiqrgsw-gcc-14.3.0/include/c++/14.3.0/type_traits(1610): error: "__is_nothrow_new_constructible" is not a function or static da>
constexpr bool __is_nothrow_new_constructible
^
/nix/store/82kmz7r96navanrc2fgckh2bamiqrgsw-gcc-14.3.0/include/c++/14.3.0/type_traits(1610): error: "constexpr" is not valid here
constexpr bool __is_nothrow_new_constructible
^
CC datawizard/data_deinitialize.o
/nix/store/82kmz7r96navanrc2fgckh2bamiqrgsw-gcc-14.3.0/include/c++/14.3.0/bits/stl_pair.h(1190): error: "__is_pair" is not a function or static data member
inline constexpr bool __is_pair = false;
^
/nix/store/82kmz7r96navanrc2fgckh2bamiqrgsw-gcc-14.3.0/include/c++/14.3.0/bits/stl_pair.h(1190): error: "constexpr" is not valid here
inline constexpr bool __is_pair = false;
^
/nix/store/82kmz7r96navanrc2fgckh2bamiqrgsw-gcc-14.3.0/include/c++/14.3.0/bits/stl_pair.h(1193): error: __is_pair is not a template
inline constexpr bool __is_pair<pair<_Tp, _Up>> = true;
^
/nix/store/82kmz7r96navanrc2fgckh2bamiqrgsw-gcc-14.3.0/include/c++/14.3.0/bits/stl_pair.h(1193): error: "constexpr" is not valid here
inline constexpr bool __is_pair<pair<_Tp, _Up>> = true;
^
In file included from /nix/store/gf3wh0x0rzb1dkx0wx1jvmipydwfzzd5-glibc-2.40-66-dev/include/bits/libc-header-start.h:33,
from /nix/store/gf3wh0x0rzb1dkx0wx1jvmipydwfzzd5-glibc-2.40-66-dev/include/stdio.h:28,
from datawizard/data_deinitialize.c:18:
Sadly i do not have the option to build with gcc15Stdenv because StarPU doesn’t build with it.
Reading the Nix Cuda Docs it says to not build with cudaPackages.cudatoolkit. But then i don’t know which packages should i use. What is the base CUDA package to use? By using any of them as a stub, i get the error of a missing cuda.h, which package provides that?
Any help is of help, here i’ve attached the derivation followed by the flake that invokes it.
{
# derivation dependencies
lib,
fetchurl,
stdenv,
writableTmpDirAsHomeHook,
autoreconfHook,
# starpu dependencies
hwloc,
libuuid,
libX11,
fftw,
fftwFloat, # Same than previous but with float precision
pkg-config,
libtool,
simgrid,
mpi,
cudaPackages,
python313,
fxt,
# Options
buildMode ? "debug",
maxBuffers ? 8,
enableSimgrid ? false,
enableMPI ? false,
enableCUDA ? false,
enableTrace ? false,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "StarPU";
system = "x86_64-linux";
version = "1.4.7";
inherit buildMode;
inherit maxBuffers;
inherit enableSimgrid;
inherit enableMPI;
inherit enableCUDA;
inherit enableTrace;
src = fetchurl {
url = "http://files.inria.fr/starpu/starpu-${finalAttrs.version}/starpu-${finalAttrs.version}.tar.gz";
hash = "sha256-HrPfVRCJFT/m4LFyrZURhDS0qB6p6qWiw4cl0NtTsT4=";
};
nativeBuildInputs = [
pkg-config
hwloc
libtool
writableTmpDirAsHomeHook
autoreconfHook
python313
]
++ lib.optional finalAttrs.enableSimgrid simgrid
++ lib.optional finalAttrs.enableMPI mpi
++ lib.optional finalAttrs.enableCUDA cudaPackages.cudatoolkit;
buildInputs = [
libuuid
libX11
fftw
fftwFloat
hwloc
fxt
]
++ lib.optional finalAttrs.enableSimgrid simgrid
++ lib.optional finalAttrs.enableMPI mpi
++ lib.optional finalAttrs.enableCUDA cudaPackages.cudatoolkit;
configureFlags = [
(lib.enableFeature true "quick-check")
(lib.enableFeature false "build-examples")
(lib.enableFeature finalAttrs.enableSimgrid "simgrid")
(lib.enableFeature false "starpupy")
# Static linking is mandatory for smpi
(lib.enableFeature finalAttrs.enableMPI "mpi")
(lib.enableFeature finalAttrs.enableMPI "mpi-check")
(lib.enableFeature (!finalAttrs.enableMPI) "shared")
(lib.optional finalAttrs.enableTrace "--with-fxt=${fxt}")
] ++ (
if finalAttrs.buildMode == "debug" then
[ "--enable-debug" "--enable-verbose" "--enable-spinlock-check" ]
else
if finalAttrs.buildMode == "release" then
[ "--enable-fast" ]
else builtins.throw "unrecognized build mode"
) ++ (lib.optional (finalAttrs.maxBuffers != 8) "--enable-maxbuffers=${toString finalAttrs.maxBuffers}");
# No need to add flags for CUDA, it should be detected by ./configure
patchPhase = ''
# Patch shebangs recursively because a lot of scripts are used
shopt -s globstar
patchShebangs --build **/*.in
'';
postConfigure = ''
# Patch shebangs recursively because a lot of scripts are used
shopt -s globstar
patchShebangs --build **/*.sh
'';
enableParallelBuilding = true;
doCheck = true;
})
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
starpuOverlay = f: p: {
StarPU = p.callPackage ./starpu.nix { enableCUDA = true; };
};
fxtOverlay = f: p: {
fxt = p.callPackage ./fxt.nix { static = true; };
};
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [ starpuOverlay fxtOverlay ];
};
in
{
packages.${system}.default = pkgs.StarPU;
devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [
pkg-config
StarPU
hwloc
# for bash to work properlly inside vscode
bashInteractive
gdb
gcc
valgrind
];
# export StarPU and hwloc store locations
# for use in vscode intellisence
GCC_STORE_PATH = "${pkgs.gcc}";
STARPU_STORE_PATH = "${pkgs.StarPU}";
HWLOC_STORE_PATH = "${pkgs.hwloc.dev}";
shellHook = ''
export SHELL=/run/current-system/sw/bin/bash
echo Added StarPU, Hwloc and gcc to ENV
echo ${pkgs.fxt}
'';
};
};
}