summary refs log tree commit diff
path: root/pkgs/applications/science/misc/simgrid
diff options
context:
space:
mode:
authorMERCIER Michael <michael.mercier@inria.fr>2017-11-27 17:50:25 +0100
committerMERCIER Michael <michael.mercier@inria.fr>2017-11-27 17:50:25 +0100
commit0cace1fbd2cf3f25e61051e4b8f9d9768bc628fd (patch)
treef30617587a7f6d6bd14612e785e4ab0b5037007a /pkgs/applications/science/misc/simgrid
parent6158563b4524fe268c1d5133e8a79c44e310fb0d (diff)
downloadnixlib-0cace1fbd2cf3f25e61051e4b8f9d9768bc628fd.tar
nixlib-0cace1fbd2cf3f25e61051e4b8f9d9768bc628fd.tar.gz
nixlib-0cace1fbd2cf3f25e61051e4b8f9d9768bc628fd.tar.bz2
nixlib-0cace1fbd2cf3f25e61051e4b8f9d9768bc628fd.tar.lz
nixlib-0cace1fbd2cf3f25e61051e4b8f9d9768bc628fd.tar.xz
nixlib-0cace1fbd2cf3f25e61051e4b8f9d9768bc628fd.tar.zst
nixlib-0cace1fbd2cf3f25e61051e4b8f9d9768bc628fd.zip
simgrid: 3.15 -> 3.17 + clean + add options
Diffstat (limited to 'pkgs/applications/science/misc/simgrid')
-rw-r--r--pkgs/applications/science/misc/simgrid/default.nix148
1 files changed, 88 insertions, 60 deletions
diff --git a/pkgs/applications/science/misc/simgrid/default.nix b/pkgs/applications/science/misc/simgrid/default.nix
index 8a3645705ab5..7b01d4399e1b 100644
--- a/pkgs/applications/science/misc/simgrid/default.nix
+++ b/pkgs/applications/science/misc/simgrid/default.nix
@@ -1,75 +1,106 @@
-{ fetchurl, stdenv, cmake, perl, ruby, boost, lua5_3, graphviz, libsigcxx
-, libunwind, elfutils, python3, doxygen
+{ stdenv, fetchFromGitHub, cmake, elfutils, perl, python3, boost, valgrind
+# Optional requirements
+# Lua 5.3 needed and not available now
+#, luaSupport ? false, lua5
+, fortranSupport ? false, gfortran
+, buildDocumentation ? false, transfig, ghostscript, doxygen
+, buildJavaBindings ? false, openjdk
+, modelCheckingSupport ? false, libunwind, libevent # Inside elfutils - , libelf, libevent, libdw
+, debug ? false
+, moreTests ? false
 }:
 
-stdenv.mkDerivation rec {
-  version = "3.15";
-  name = "simgrid-${version}";
+# helpers for options
+let optionals       = stdenv.lib.optionals;
+    optionalString = stdenv.lib.optionalString;
+    optionOnOff = option: "${if option then "on" else "off"}";
+in
 
-  src = fetchurl {
-    url = "https://gforge.inria.fr/frs/download.php/36621/${name}.tar.gz";
-    sha256 = "1s595wc4z8hkvim3ypfdxy16pply6ckjg10v84cc0lx9pz6i3r6i";
+stdenv.mkDerivation rec {
+  major_version = "3";
+  minor_version = "17";
+  version = "v${major_version}.${minor_version}";
+  tagged_version = "${major_version}_${minor_version}";
+  name = "simgrid";
+
+  src = fetchFromGitHub {
+    owner = "simgrid";
+    repo = "simgrid";
+    rev = "v3_17";
+    sha256 = "0ffs9w141qhw571jsa9sch1cnr332vs4sgj6dsiij2mc24m6wpb4";
+    #rev = "master";
+    #sha256 = "0qvh1jzc2lpnp8234kjx1x4g1a5kfdn6kb15vhk160qgvj98nyqm";
   };
 
-  buildInputs = [ cmake perl ruby boost lua5_3 graphviz libsigcxx libunwind
-    elfutils python3 doxygen
-    ];
+  nativeBuildInputs = [ cmake perl elfutils python3 boost valgrind]
+      ++ optionals fortranSupport [gfortran]
+      ++ optionals buildJavaBindings [openjdk]
+      ++ optionals buildDocumentation [transfig ghostscript doxygen]
+      ++ optionals modelCheckingSupport [libunwind libevent];
+
+  #buildInputs = optional luaSupport lua5;
 
   preConfigure =
     # Make it so that libsimgrid.so will be found when running programs from
     # the build dir.
-    '' export LD_LIBRARY_PATH="$PWD/src/.libs"
-       export cmakeFlags="-Dprefix=$out"
-
-       export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE
-         -isystem $(echo "${libsigcxx}/lib/"sigc++*/include)
-	 -isystem $(echo "${libsigcxx}/include"/sigc++* )
-	 "
-       export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH:$(echo "${libsigcxx}/lib/"sigc++*)"
-
-       # Enable more functionality.
-       export cmakeFlags="$cmakeFlags -Denable_tracing=on -Denable_jedule=on
-         -Denable_latency_bound_tracking=on -Denable_lua=on
-	 -Denable_ns3=off -Denable_gtnets=on
-	 "
+    ''
+    export LD_LIBRARY_PATH="$PWD/build/lib"
     '';
 
-  makeFlags = "VERBOSE=1";
+  # Release mode is not supported in SimGrid
+  cmakeBuildType = "Debug";
+
+  # Disable/Enable functionality
+  # Note: those packages are not packaged in Nixpkgs yet so some options
+  # are disabled:
+  # - papi:   for enable_smpi_papi
+  # - ns3:    for enable_ns3
+  # - lua53:  for enable_lua
+  #
+  # For more information see:
+  # http://simgrid.gforge.inria.fr/simgrid/latest/doc/install.html#install_cmake_list
+  cmakeFlags= ''
+       -Denable_documentation=${optionOnOff buildDocumentation}
+       -Denable_java=${optionOnOff buildJavaBindings}
+       -Denable_fortran=${optionOnOff fortranSupport}
+       -Denable_model-checking=${optionOnOff modelCheckingSupport}
+       -Denable_ns3=off
+       -Denable_lua=off
+       -Denable_lib_in_jar=off
+       -Denable_maintainer_mode=off
+       -Denable_mallocators=on
+       -Denable_debug=on
+       -Denable_smpi=on
+       -Denable_smpi_ISP_testsuite=${optionOnOff moreTests}
+       -Denable_smpi_MPICH3_testsuite=${optionOnOff moreTests}
+       -Denable_compile_warnings=${optionOnOff debug}
+       -Denable_compile_optimizations=${optionOnOff (!debug)}
+       -Denable_lto=${optionOnOff (!debug)}
+       '';
+       #-Denable_lua=${optionOnOff luaSupport}
+       #-Denable_smpi_papi=${optionOnOff moreTests}
+
+  makeFlags = optionalString debug "VERBOSE=1";
 
   preBuild =
-    /* Work around this:
-
-      [ 20%] Generating _msg_handle_simulator.c, _msg_handle_client.c, _msg_handle_server.c
-      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
-      ../../../bin/gras_stub_generator: error while loading shared libraries: libsimgrid.so.3.5: cannot open shared object file: No such file or directory
-      make[2]: *** [teshsuite/gras/msg_handle/_msg_handle_simulator.c] Error 127
-      make[2]: Leaving directory `/tmp/nix-build-7yc8ghmf2yb8zi3bsri9b6qadwmfpzhr-simgrid-3.5.drv-0/simgrid-3.5/build'
-
-    */
-    '' export LD_LIBRARY_PATH="$PWD/lib:$LD_LIBRARY_PATH"
-       echo "\$LD_LIBRARY_PATH is \`$LD_LIBRARY_PATH'"
+    ''
+       # Some perl scripts are called to generate test during build which
+       # is before the fixupPhase of nix, so do this manualy here:
+       patchShebangs ..
     '';
 
-  patchPhase =
-    '' for i in "src/smpi/"*
-       do
-         test -f "$i" &&
-         sed -i "$i" -e's|/bin/bash|/bin/sh|g'
-       done
+  doCheck = true;
+  checkPhase = ''
+    runHook preCheck
 
-       for i in $(grep -rl /usr/bin/perl .)
-       do
-         sed -i "$i" -e's|/usr/bin/perl|${perl}/bin/perl|g'
-       done
-       patchShebangs ./tools/
-    '';
-
-  # Fixing the few tests that fail is left as an exercise to the reader.
-  doCheck = false;
+    ctest --output-on-failure -E smpi-replay-multiple
 
-  meta = {
-    description = "Simulator for distributed applications in heterogeneous environments";
+    runHook postCheck
+    '';
+  enableParallelBuilding = true;
 
+  meta = with stdenv.lib; {
+    description = "Framework for the simulation of distributed applications";
     longDescription =
       '' SimGrid is a toolkit that provides core functionalities for the
          simulation of distributed applications in heterogeneous distributed
@@ -78,12 +109,9 @@ stdenv.mkDerivation rec {
          scheduling on distributed computing platforms ranging from simple
          network of workstations to Computational Grids.
       '';
-
     homepage = http://simgrid.gforge.inria.fr/;
-
-    license = stdenv.lib.licenses.lgpl2Plus;
-
-    maintainers = [ ];
-    platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
+    maintainers = with maitainers; [ ];
+    platforms = platforms.x86_64;
+    license = licenses.lgpl2Plus;
   };
 }