1 { lib, stdenv, fetchurl, pkg-config, expat, ncurses, pciutils, numactl
2 , x11Support ? false, libX11 ? null, cairo ? null
5 assert x11Support -> libX11 != null && cairo != null;
9 stdenv.mkDerivation rec {
14 url = "https://www.open-mpi.org/software/hwloc/v${versions.majorMinor version}/downloads/hwloc-${version}.tar.bz2";
15 sha256 = "sha256-NIpy/NSMMqgj7h2hSa6ZIgPnrQM1SeZK7W6m7rAfQsE=";
19 "--localstatedir=/var"
23 # XXX: libX11 is not directly needed, but needed as a propagated dep of Cairo.
24 nativeBuildInputs = [ pkg-config ];
26 # Filter out `null' inputs. This allows users to `.override' the
27 # derivation and set optional dependencies to `null'.
28 buildInputs = lib.filter (x: x != null)
30 ++ (optionals x11Support [ cairo libX11 ])
31 ++ (optionals stdenv.isLinux [ numactl ]));
33 propagatedBuildInputs =
34 # Since `libpci' appears in `hwloc.pc', it must be propagated.
35 optional stdenv.isLinux pciutils;
37 enableParallelBuilding = true;
40 optionalString (stdenv.isLinux && numactl != null)
41 '' if [ -d "${numactl}/lib64" ]
43 numalibdir="${numactl}/lib64"
45 numalibdir="${numactl}/lib"
49 sed -i "$lib/lib/libhwloc.la" \
50 -e "s|-lnuma|-L$numalibdir -lnuma|g"
53 # Checks disabled because they're impure (hardware dependent) and
54 # fail on some build machines.
57 outputs = [ "out" "lib" "dev" "doc" "man" ];
60 description = "Portable abstraction of hierarchical architectures for high-performance computing";
62 hwloc provides a portable abstraction (across OS,
63 versions, architectures, ...) of the hierarchical topology of
64 modern architectures, including NUMA memory nodes, sockets,
65 shared caches, cores and simultaneous multithreading. It also
66 gathers various attributes such as cache and memory
67 information. It primarily aims at helping high-performance
68 computing applications with gathering information about the
69 hardware so as to exploit it accordingly and efficiently.
71 hwloc may display the topology in multiple convenient
72 formats. It also offers a powerful programming interface to
73 gather information about the hardware, bind processes, and much
77 # https://www.open-mpi.org/projects/hwloc/license.php
78 license = licenses.bsd3;
79 homepage = "https://www.open-mpi.org/projects/hwloc/";
80 maintainers = with maintainers; [ fpletz markuskowa ];
81 platforms = platforms.all;