1{ fetchurl, stdenv, cmake, perl, ruby, boost, lua5_1, graphviz, libsigcxx
2, libunwind, elfutils
3}:
4
5stdenv.mkDerivation rec {
6 version = "3.11.1";
7 name = "simgrid-${version}";
8
9 src = fetchurl {
10 url = "https://gforge.inria.fr/frs/download.php/33686/${name}.tar.gz";
11 sha256 = "0mkrzxpf42lmn96khfl1791vram67r2nqsgmppd2yil889nyz5kp";
12 };
13
14 buildInputs = [ cmake perl ruby boost lua5_1 graphviz libsigcxx libunwind
15 elfutils
16 ];
17
18 preConfigure =
19 # Make it so that libsimgrid.so will be found when running programs from
20 # the build dir.
21 '' export LD_LIBRARY_PATH="$PWD/src/.libs"
22 export cmakeFlags="-Dprefix=$out"
23
24 export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE
25 -isystem $(echo "${libsigcxx}/lib/"sigc++*/include)
26 -isystem $(echo "${libsigcxx}/include"/sigc++* )
27 "
28 export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH:$(echo "${libsigcxx}/lib/"sigc++*)"
29
30 # Enable more functionality.
31 export cmakeFlags="$cmakeFlags -Denable_tracing=on -Denable_jedule=on
32 -Denable_latency_bound_tracking=on -Denable_lua=on
33 -Denable_ns3=on -Denable_gtnets=on
34 "
35 '';
36
37 makeFlags = "VERBOSE=1";
38
39 preBuild =
40 /* Work around this:
41
42 [ 20%] Generating _msg_handle_simulator.c, _msg_handle_client.c, _msg_handle_server.c
43 cd /tmp/nix-build-7yc8ghmf2yb8zi3bsri9b6qadwmfpzhr-simgrid-3.5.drv-0/simgrid-3.5/build/teshsuite/gras/msg_handle && ../../../bin/gras_stub_generator msg_handle /tmp/nix-build-7yc8ghmf2yb8zi3bsri9b6qadwmfpzhr-simgrid-3.5.drv-0/simgrid-3.5/teshsuite/gras/msg_handle/msg_handle.xml
44 ../../../bin/gras_stub_generator: error while loading shared libraries: libsimgrid.so.3.5: cannot open shared object file: No such file or directory
45 make[2]: *** [teshsuite/gras/msg_handle/_msg_handle_simulator.c] Error 127
46 make[2]: Leaving directory `/tmp/nix-build-7yc8ghmf2yb8zi3bsri9b6qadwmfpzhr-simgrid-3.5.drv-0/simgrid-3.5/build'
47
48 */
49 '' export LD_LIBRARY_PATH="$PWD/lib:$LD_LIBRARY_PATH"
50 echo "\$LD_LIBRARY_PATH is \`$LD_LIBRARY_PATH'"
51 '';
52
53 patchPhase =
54 '' for i in "src/smpi/"*
55 do
56 test -f "$i" &&
57 sed -i "$i" -e's|/bin/bash|/bin/sh|g'
58 done
59
60 for i in $(grep -rl /usr/bin/perl .)
61 do
62 sed -i "$i" -e's|/usr/bin/perl|${perl}/bin/perl|g'
63 done
64 '';
65
66 # Fixing the few tests that fail is left as an exercise to the reader.
67 doCheck = false;
68
69 meta = {
70 description = "Simulator for distributed applications in heterogeneous environments";
71
72 longDescription =
73 '' SimGrid is a toolkit that provides core functionalities for the
74 simulation of distributed applications in heterogeneous distributed
75 environments. The specific goal of the project is to facilitate
76 research in the area of distributed and parallel application
77 scheduling on distributed computing platforms ranging from simple
78 network of workstations to Computational Grids.
79 '';
80
81 homepage = http://simgrid.gforge.inria.fr/;
82
83 license = stdenv.lib.licenses.lgpl2Plus;
84
85 maintainers = [ ];
86 platforms = stdenv.lib.platforms.gnu; # arbitrary choice
87 };
88}