simgrid: cleanup

This commit is contained in:
Yegor Timoshenko 2018-05-24 11:02:12 +03:00 committed by Matthew Bauer
parent 543c8c4eb0
commit 4e049b2fd4
1 changed files with 53 additions and 58 deletions

View File

@ -10,41 +10,37 @@
, moreTests ? false , moreTests ? false
}: }:
# helpers for options with stdenv.lib;
let optionals = stdenv.lib.optionals;
optionalString = stdenv.lib.optionalString; let
optionOnOff = option: "${if option then "on" else "off"}"; optionOnOff = option: "${if option then "on" else "off"}";
urlVersion = replaceStrings ["."] ["_"];
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
major_version = "3";
minor_version = "17";
version = "${major_version}.${minor_version}";
name = "simgrid-${version}"; name = "simgrid-${version}";
version = "3.17";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "simgrid"; owner = "simgrid";
repo = "simgrid"; repo = "simgrid";
rev = "v${major_version}_${minor_version}"; rev = "v${urlVersion version}";
sha256 = "0ffs9w141qhw571jsa9sch1cnr332vs4sgj6dsiij2mc24m6wpb4"; sha256 = "0ffs9w141qhw571jsa9sch1cnr332vs4sgj6dsiij2mc24m6wpb4";
#rev = "master";
#sha256 = "0qvh1jzc2lpnp8234kjx1x4g1a5kfdn6kb15vhk160qgvj98nyqm";
}; };
nativeBuildInputs = [ cmake perl elfutils python3 boost valgrind] nativeBuildInputs = [ cmake perl elfutils python3 boost valgrind ]
++ optionals fortranSupport [gfortran] ++ optionals fortranSupport [ gfortran ]
++ optionals buildJavaBindings [openjdk] ++ optionals buildJavaBindings [ openjdk ]
++ optionals buildDocumentation [transfig ghostscript doxygen] ++ optionals buildDocumentation [ transfig ghostscript doxygen ]
++ optionals modelCheckingSupport [libunwind libevent]; ++ optionals modelCheckingSupport [ libunwind libevent ];
#buildInputs = optional luaSupport lua5; #buildInputs = optional luaSupport lua5;
preConfigure = # Make it so that libsimgrid.so will be found when running programs from
# Make it so that libsimgrid.so will be found when running programs from # the build dir.
# the build dir. preConfigure = ''
''
export LD_LIBRARY_PATH="$PWD/build/lib" export LD_LIBRARY_PATH="$PWD/build/lib"
''; '';
# Release mode is not supported in SimGrid # Release mode is not supported in SimGrid
cmakeBuildType = "Debug"; cmakeBuildType = "Debug";
@ -59,58 +55,57 @@ stdenv.mkDerivation rec {
# For more information see: # For more information see:
# http://simgrid.gforge.inria.fr/simgrid/latest/doc/install.html#install_cmake_list # http://simgrid.gforge.inria.fr/simgrid/latest/doc/install.html#install_cmake_list
cmakeFlags= '' cmakeFlags= ''
-Denable_documentation=${optionOnOff buildDocumentation} -Denable_documentation=${optionOnOff buildDocumentation}
-Denable_java=${optionOnOff buildJavaBindings} -Denable_java=${optionOnOff buildJavaBindings}
-Denable_fortran=${optionOnOff fortranSupport} -Denable_fortran=${optionOnOff fortranSupport}
-Denable_model-checking=${optionOnOff modelCheckingSupport} -Denable_model-checking=${optionOnOff modelCheckingSupport}
-Denable_ns3=off -Denable_ns3=off
-Denable_lua=off -Denable_lua=off
-Denable_lib_in_jar=off -Denable_lib_in_jar=off
-Denable_maintainer_mode=off -Denable_maintainer_mode=off
-Denable_mallocators=on -Denable_mallocators=on
-Denable_debug=on -Denable_debug=on
-Denable_smpi=on -Denable_smpi=on
-Denable_smpi_ISP_testsuite=${optionOnOff moreTests} -Denable_smpi_ISP_testsuite=${optionOnOff moreTests}
-Denable_smpi_MPICH3_testsuite=${optionOnOff moreTests} -Denable_smpi_MPICH3_testsuite=${optionOnOff moreTests}
-Denable_compile_warnings=${optionOnOff debug} -Denable_compile_warnings=${optionOnOff debug}
-Denable_compile_optimizations=${optionOnOff (!debug)} -Denable_compile_optimizations=${optionOnOff (!debug)}
-Denable_lto=${optionOnOff (!debug)} -Denable_lto=${optionOnOff (!debug)}
''; '';
#-Denable_lua=${optionOnOff luaSupport} # -Denable_lua=${optionOnOff luaSupport}
#-Denable_smpi_papi=${optionOnOff moreTests} # -Denable_smpi_papi=${optionOnOff moreTests}
makeFlags = optionalString debug "VERBOSE=1"; makeFlags = optionalString debug "VERBOSE=1";
preBuild = # Some Perl scripts are called to generate test during build which
'' # is before the fixupPhase, so do this manualy here:
# Some perl scripts are called to generate test during build which preBuild = ''
# is before the fixupPhase of nix, so do this manualy here: patchShebangs ..
patchShebangs .. '';
'';
doCheck = true; doCheck = true;
checkPhase = '' checkPhase = ''
runHook preCheck runHook preCheck
ctest --output-on-failure -E smpi-replay-multiple ctest --output-on-failure -E smpi-replay-multiple
runHook postCheck runHook postCheck
''; '';
enableParallelBuilding = true; enableParallelBuilding = true;
meta = with stdenv.lib; { meta = {
description = "Framework for the simulation of distributed applications"; description = "Framework for the simulation of distributed applications";
longDescription = longDescription = ''
'' SimGrid is a toolkit that provides core functionalities for the SimGrid is a toolkit that provides core functionalities for the
simulation of distributed applications in heterogeneous distributed simulation of distributed applications in heterogeneous distributed
environments. The specific goal of the project is to facilitate environments. The specific goal of the project is to facilitate
research in the area of distributed and parallel application research in the area of distributed and parallel application
scheduling on distributed computing platforms ranging from simple scheduling on distributed computing platforms ranging from simple
network of workstations to Computational Grids. network of workstations to Computational Grids.
''; '';
homepage = http://simgrid.gforge.inria.fr/; homepage = http://simgrid.gforge.inria.fr/;
license = licenses.lgpl2Plus;
maintainers = with maintainers; [ mickours ]; maintainers = with maintainers; [ mickours ];
platforms = platforms.x86_64; platforms = platforms.x86_64;
license = licenses.lgpl2Plus;
}; };
} }