2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
2022-04-27 09:35:20 +00:00
|
|
|
, anytree
|
2022-12-17 10:02:37 +00:00
|
|
|
, buildPythonPackage
|
2022-04-27 09:35:20 +00:00
|
|
|
, cached-property
|
|
|
|
, cgen
|
|
|
|
, click
|
|
|
|
, codepy
|
2022-12-17 10:02:37 +00:00
|
|
|
, distributed
|
|
|
|
, fetchFromGitHub
|
2022-10-21 18:38:19 +00:00
|
|
|
, gcc
|
|
|
|
, llvmPackages
|
2022-12-17 10:02:37 +00:00
|
|
|
, matplotlib
|
|
|
|
, multidict
|
|
|
|
, nbval
|
|
|
|
, psutil
|
|
|
|
, py-cpuinfo
|
|
|
|
, pyrevolve
|
|
|
|
, pytest-xdist
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, scipy
|
|
|
|
, stdenv
|
|
|
|
, sympy
|
2022-04-27 09:35:20 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "devito";
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "4.8.1";
|
2022-12-17 10:02:37 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "devitocodes";
|
|
|
|
repo = "devito";
|
2022-12-17 10:02:37 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-04-29 16:46:19 +00:00
|
|
|
hash = "sha256-LzqY//205XEOd3/f8k1g4OYndRHMTVplBogGJf5Forw=";
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Removing unecessary dependencies
|
|
|
|
sed -e "s/flake8.*//g" \
|
|
|
|
-e "s/codecov.*//g" \
|
|
|
|
-e "s/pytest.*//g" \
|
|
|
|
-e "s/pytest-runner.*//g" \
|
|
|
|
-e "s/pytest-cov.*//g" \
|
|
|
|
-i requirements.txt
|
|
|
|
|
|
|
|
# Relaxing dependencies requirements
|
|
|
|
sed -e "s/>.*//g" \
|
|
|
|
-e "s/<.*//g" \
|
|
|
|
-i requirements.txt
|
|
|
|
'';
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
anytree
|
|
|
|
cached-property
|
|
|
|
cgen
|
|
|
|
click
|
|
|
|
codepy
|
|
|
|
distributed
|
|
|
|
nbval
|
|
|
|
multidict
|
|
|
|
psutil
|
|
|
|
py-cpuinfo
|
|
|
|
pyrevolve
|
|
|
|
scipy
|
|
|
|
sympy
|
|
|
|
] ++ lib.optionals stdenv.cc.isClang [
|
|
|
|
llvmPackages.openmp
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-12-17 10:02:37 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-xdist
|
|
|
|
matplotlib
|
|
|
|
gcc
|
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
# I've had to disable the following tests since they fail while using nix-build, but they do pass
|
|
|
|
# outside the build. They mostly related to the usage of MPI in a sandboxed environment.
|
|
|
|
disabledTests = [
|
|
|
|
"test_assign_parallel"
|
|
|
|
"test_gs_parallel"
|
|
|
|
"test_if_parallel"
|
|
|
|
"test_if_halo_mpi"
|
|
|
|
"test_cache_blocking_structure_distributed"
|
|
|
|
"test_mpi"
|
|
|
|
"test_codegen_quality0"
|
|
|
|
"test_new_distributor"
|
|
|
|
"test_subdomainset_mpi"
|
|
|
|
"test_init_omp_env_w_mpi"
|
|
|
|
"test_mpi_nocomms"
|
2022-12-17 10:02:37 +00:00
|
|
|
"test_shortcuts"
|
|
|
|
"est_docstrings"
|
|
|
|
"test_docstrings[finite_differences.coefficients]"
|
|
|
|
"test_coefficients_w_xreplace"
|
|
|
|
"test_loop_bounds_forward"
|
2022-04-27 09:35:20 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
"tests/test_pickle.py"
|
|
|
|
"tests/test_benchmark.py"
|
|
|
|
"tests/test_mpi.py"
|
|
|
|
"tests/test_autotuner.py"
|
|
|
|
"tests/test_data.py"
|
|
|
|
"tests/test_dse.py"
|
|
|
|
"tests/test_gradient.py"
|
|
|
|
];
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"devito"
|
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Code generation framework for automated finite difference computation";
|
2022-12-17 10:02:37 +00:00
|
|
|
homepage = "https://www.devitoproject.org/";
|
|
|
|
changelog = "https://github.com/devitocodes/devito/releases/tag/v${version}";
|
2022-04-27 09:35:20 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ atila ];
|
|
|
|
};
|
|
|
|
}
|