14 enableCuda ? config.cudaSupport,
18 stdenv.mkDerivation rec {
23 url = "https://www.open-mpi.org/software/hwloc/v${lib.versions.majorMinor version}/downloads/hwloc-${version}.tar.bz2";
24 hash = "sha256-9/iP7K4GcQDxoakVtlit0PT3FWEllIKRCmm66iL+hAk=";
28 "--localstatedir=/var"
32 # XXX: libX11 is not directly needed, but needed as a propagated dep of Cairo.
33 nativeBuildInputs = [ pkg-config ] ++ lib.optionals enableCuda [ cudaPackages.cuda_nvcc ];
40 ++ lib.optionals x11Support [
44 ++ lib.optionals stdenv.hostPlatform.isLinux [ numactl ]
45 ++ lib.optionals enableCuda [ cudaPackages.cuda_cudart ];
47 # Since `libpci' appears in `hwloc.pc', it must be propagated.
48 propagatedBuildInputs = lib.optional stdenv.hostPlatform.isLinux pciutils;
50 enableParallelBuilding = true;
52 postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
53 if [ -d "${numactl}/lib64" ]; then
54 numalibdir="${numactl}/lib64"
56 numalibdir="${numactl}/lib"
60 sed -i "$lib/lib/libhwloc.la" \
61 -e "s|-lnuma|-L$numalibdir -lnuma|g"
64 # Checks disabled because they're impure (hardware dependent) and
65 # fail on some build machines.
77 description = "Portable abstraction of hierarchical architectures for high-performance computing";
79 hwloc provides a portable abstraction (across OS,
80 versions, architectures, ...) of the hierarchical topology of
81 modern architectures, including NUMA memory nodes, sockets,
82 shared caches, cores and simultaneous multithreading. It also
83 gathers various attributes such as cache and memory
84 information. It primarily aims at helping high-performance
85 computing applications with gathering information about the
86 hardware so as to exploit it accordingly and efficiently.
88 hwloc may display the topology in multiple convenient
89 formats. It also offers a powerful programming interface to
90 gather information about the hardware, bind processes, and much
93 # https://www.open-mpi.org/projects/hwloc/license.php
94 license = lib.licenses.bsd3;
95 homepage = "https://www.open-mpi.org/projects/hwloc/";
96 maintainers = with lib.maintainers; [
100 platforms = lib.platforms.all;