lol
1{ stdenv, fetchurl, pkgconfig, cairo, expat, ncurses, libX11
2, pciutils, numactl }:
3
4stdenv.mkDerivation rec {
5 name = "hwloc-1.6";
6
7 src = fetchurl {
8 url = "http://www.open-mpi.org/software/hwloc/v1.6/downloads/${name}.tar.bz2";
9 sha256 = "0y561bryiqp1f5af5lm432dcw93xwp1jw55si7wa6skxnd6ch25w";
10 };
11
12 # XXX: libX11 is not directly needed, but needed as a propagated dep of Cairo.
13 nativeBuildInputs = [ pkgconfig ];
14
15 # Filter out `null' inputs. This allows users to `.override' the
16 # derivation and set optional dependencies to `null'.
17 buildInputs = stdenv.lib.filter (x: x != null)
18 ([ expat ncurses ]
19 ++ (stdenv.lib.optionals (!stdenv.isCygwin) [ cairo libX11 ])
20 ++ (stdenv.lib.optionals stdenv.isLinux [ numactl ]));
21
22 propagatedBuildInputs =
23 # Since `libpci' appears in `hwloc.pc', it must be propagated.
24 stdenv.lib.optional stdenv.isLinux pciutils;
25
26 enableParallelBuilding = true;
27
28 postInstall =
29 stdenv.lib.optionalString (stdenv.isLinux && numactl != null)
30 '' if [ -d "${numactl}/lib64" ]
31 then
32 numalibdir="${numactl}/lib64"
33 else
34 numalibdir="${numactl}/lib"
35 test -d "$numalibdir"
36 fi
37
38 sed -i "$out/lib/libhwloc.la" \
39 -e "s|-lnuma|-L$numalibdir -lnuma|g"
40 '';
41
42 # XXX: A test hangs on Cygwin, see
43 # <http://hydra.bordeaux.inria.fr/build/51474/nixlog/1/raw>.
44 doCheck = !stdenv.isCygwin;
45
46 meta = with stdenv.lib; {
47 description = "Portable abstraction of hierarchical architectures for high-performance computing";
48
49 longDescription = ''
50 hwloc provides a portable abstraction (across OS,
51 versions, architectures, ...) of the hierarchical topology of
52 modern architectures, including NUMA memory nodes, sockets,
53 shared caches, cores and simultaneous multithreading. It also
54 gathers various attributes such as cache and memory
55 information. It primarily aims at helping high-performance
56 computing applications with gathering information about the
57 hardware so as to exploit it accordingly and efficiently.
58
59 hwloc may display the topology in multiple convenient
60 formats. It also offers a powerful programming interface to
61 gather information about the hardware, bind processes, and much
62 more.
63 '';
64
65 # http://www.open-mpi.org/projects/hwloc/license.php
66 license = licenses.bsd3;
67
68 homepage = http://www.open-mpi.org/projects/hwloc/;
69
70 maintainers = [ ];
71 platforms = platforms.all;
72 };
73}