2022-02-20 05:27:41 +00:00
|
|
|
{ stdenv, lib, fetchFromGitLab, cmake, perl, python3, boost
|
2020-04-24 23:36:52 +00:00
|
|
|
, fortranSupport ? false, gfortran
|
2022-02-20 05:27:41 +00:00
|
|
|
, buildDocumentation ? false, fig2dev, ghostscript, doxygen
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildJavaBindings ? false, openjdk
|
2022-02-20 05:27:41 +00:00
|
|
|
, buildPythonBindings ? true, python3Packages
|
2020-04-24 23:36:52 +00:00
|
|
|
, modelCheckingSupport ? false, libunwind, libevent, elfutils # Inside elfutils: libelf and libdw
|
2022-03-30 09:31:56 +00:00
|
|
|
, bmfSupport ? true, eigen
|
2022-02-20 05:27:41 +00:00
|
|
|
, minimalBindings ? false
|
2020-04-24 23:36:52 +00:00
|
|
|
, debug ? false
|
2022-02-20 05:27:41 +00:00
|
|
|
, optimize ? (!debug)
|
2020-04-24 23:36:52 +00:00
|
|
|
, moreTests ? false
|
2022-02-20 05:27:41 +00:00
|
|
|
, withoutBin ? false
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
with lib;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
optionOnOff = option: if option then "on" else "off";
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "simgrid";
|
2022-03-30 09:31:56 +00:00
|
|
|
version = "3.31";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "framagit.org";
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-03-30 09:31:56 +00:00
|
|
|
sha256 = "sha256-K6YkkCMxc2lqxHIwyuLiwcp3m49sqbEtOlwZh4L1YJg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
propagatedBuildInputs = [ boost ];
|
2022-02-20 05:27:41 +00:00
|
|
|
nativeBuildInputs = [ cmake perl python3 ]
|
|
|
|
++ optionals fortranSupport [ gfortran ]
|
|
|
|
++ optionals buildJavaBindings [ openjdk ]
|
|
|
|
++ optionals buildPythonBindings [ python3Packages.pybind11 ]
|
|
|
|
++ optionals buildDocumentation [ fig2dev ghostscript doxygen ]
|
2022-03-30 09:31:56 +00:00
|
|
|
++ optionals bmfSupport [ eigen ]
|
2022-02-20 05:27:41 +00:00
|
|
|
++ optionals modelCheckingSupport [ libunwind libevent elfutils ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
outputs = [ "out" ]
|
|
|
|
++ optionals buildPythonBindings [ "python" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
# "Release" does not work. non-debug mode is Debug compiled with optimization
|
2020-04-24 23:36:52 +00:00
|
|
|
cmakeBuildType = "Debug";
|
|
|
|
cmakeFlags = [
|
|
|
|
"-Denable_documentation=${optionOnOff buildDocumentation}"
|
|
|
|
"-Denable_java=${optionOnOff buildJavaBindings}"
|
2022-02-20 05:27:41 +00:00
|
|
|
"-Denable_python=${optionOnOff buildPythonBindings}"
|
|
|
|
"-DSIMGRID_PYTHON_LIBDIR=./" # prevents CMake to install in ${python3} dir
|
|
|
|
"-Denable_msg=${optionOnOff buildJavaBindings}"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-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"
|
2022-02-20 05:27:41 +00:00
|
|
|
"-Dminimal-bindings=${optionOnOff minimalBindings}"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-Denable_smpi_ISP_testsuite=${optionOnOff moreTests}"
|
|
|
|
"-Denable_smpi_MPICH3_testsuite=${optionOnOff moreTests}"
|
2022-02-20 05:27:41 +00:00
|
|
|
"-Denable_compile_warnings=off"
|
|
|
|
"-Denable_compile_optimizations=${optionOnOff optimize}"
|
|
|
|
"-Denable_lto=${optionOnOff optimize}"
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
# RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/
|
|
|
|
"-DCMAKE_SKIP_BUILD_RPATH=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
makeFlags = optional debug "VERBOSE=1";
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
# needed to run tests and to ensure correct shabangs in output scripts
|
2020-04-24 23:36:52 +00:00
|
|
|
preBuild = ''
|
|
|
|
patchShebangs ..
|
|
|
|
'';
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
# needed by tests (so libsimgrid.so is found)
|
|
|
|
preConfigure = ''
|
|
|
|
export LD_LIBRARY_PATH="$PWD/build/lib"
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
doCheck = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
preCheck = ''
|
2022-02-20 05:27:41 +00:00
|
|
|
# prevent the execution of tests known to fail
|
2020-04-24 23:36:52 +00:00
|
|
|
cat <<EOW >CTestCustom.cmake
|
|
|
|
SET(CTEST_CUSTOM_TESTS_IGNORE smpi-replay-multiple)
|
|
|
|
EOW
|
2021-07-21 07:28:18 +00:00
|
|
|
|
|
|
|
# make sure tests are built in parallel (this can be long otherwise)
|
|
|
|
make tests -j $NIX_BUILD_CORES
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
postInstall = lib.optionalString withoutBin ''
|
|
|
|
# remove bin from output if requested.
|
|
|
|
# having a specific bin output would be cleaner but it does not work currently (circular references)
|
|
|
|
rm -rf $out/bin
|
|
|
|
'' + lib.optionalString buildPythonBindings ''
|
|
|
|
# manually install the python binding if requested.
|
|
|
|
mkdir -p $python/lib/python${lib.versions.majorMinor python3.version}/site-packages/
|
|
|
|
cp ./lib/simgrid.cpython*.so $python/lib/python${lib.versions.majorMinor python3.version}/site-packages/
|
|
|
|
'';
|
|
|
|
|
|
|
|
# improve debuggability if requested
|
|
|
|
hardeningDisable = lib.optionals debug [ "fortify" ];
|
|
|
|
dontStrip = debug;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
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
|
|
|
|
environments. The specific goal of the project is to facilitate
|
|
|
|
research in the area of distributed and parallel application
|
|
|
|
scheduling on distributed computing platforms ranging from simple
|
|
|
|
network of workstations to Computational Grids.
|
|
|
|
'';
|
|
|
|
homepage = "https://simgrid.org/";
|
|
|
|
license = licenses.lgpl2Plus;
|
|
|
|
maintainers = with maintainers; [ mickours mpoquet ];
|
2021-04-05 15:23:46 +00:00
|
|
|
platforms = platforms.all;
|
2022-02-20 05:27:41 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|