2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
anytree,
|
|
|
|
buildPythonPackage,
|
|
|
|
cached-property,
|
|
|
|
cgen,
|
|
|
|
click,
|
|
|
|
codepy,
|
|
|
|
distributed,
|
|
|
|
fetchFromGitHub,
|
|
|
|
gcc,
|
|
|
|
llvmPackages,
|
|
|
|
matplotlib,
|
|
|
|
multidict,
|
|
|
|
nbval,
|
|
|
|
psutil,
|
|
|
|
py-cpuinfo,
|
|
|
|
pytest-xdist,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
pythonRelaxDepsHook,
|
|
|
|
scipy,
|
|
|
|
sympy,
|
2022-04-27 09:35:20 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "devito";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "4.8.7";
|
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}";
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-UEj3WXRBaEOMX+wIDUjE6AP30QSSBUJHzNh3Kp/2AkE=";
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
pythonRemoveDeps = [
|
|
|
|
"codecov"
|
|
|
|
"flake8"
|
|
|
|
"pytest-runner"
|
|
|
|
"pytest-cov"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonRelaxDeps = true;
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ pythonRelaxDepsHook ];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
dependencies = [
|
2022-12-17 10:02:37 +00:00
|
|
|
anytree
|
|
|
|
cached-property
|
|
|
|
cgen
|
|
|
|
click
|
|
|
|
codepy
|
|
|
|
distributed
|
|
|
|
nbval
|
|
|
|
multidict
|
|
|
|
psutil
|
|
|
|
py-cpuinfo
|
|
|
|
scipy
|
|
|
|
sympy
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ];
|
2022-12-17 10:02:37 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-12-17 10:02:37 +00:00
|
|
|
gcc
|
2023-08-22 20:05:09 +00:00
|
|
|
matplotlib
|
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
2022-12-17 10:02:37 +00:00
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
pytestFlagsArray = [ "-x" ];
|
|
|
|
|
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.
|
2024-06-05 15:53:02 +00:00
|
|
|
disabledTests =
|
|
|
|
[
|
|
|
|
"test_assign_parallel"
|
|
|
|
"test_cache_blocking_structure_distributed"
|
|
|
|
"test_codegen_quality0"
|
|
|
|
"test_coefficients_w_xreplace"
|
|
|
|
"test_docstrings"
|
|
|
|
"test_docstrings[finite_differences.coefficients]"
|
|
|
|
"test_gs_parallel"
|
|
|
|
"test_if_halo_mpi"
|
|
|
|
"test_if_parallel"
|
2024-06-20 14:57:18 +00:00
|
|
|
"test_index_derivative"
|
2024-06-05 15:53:02 +00:00
|
|
|
"test_init_omp_env_w_mpi"
|
|
|
|
"test_loop_bounds_forward"
|
2024-06-20 14:57:18 +00:00
|
|
|
"test_min_max_mpi"
|
2024-06-05 15:53:02 +00:00
|
|
|
"test_mpi"
|
2024-06-20 14:57:18 +00:00
|
|
|
"test_mpi_nocomms"
|
2024-06-05 15:53:02 +00:00
|
|
|
"test_new_distributor"
|
|
|
|
"test_setupWOverQ"
|
|
|
|
"test_shortcuts"
|
2024-06-20 14:57:18 +00:00
|
|
|
"test_stability_mpi"
|
2024-06-05 15:53:02 +00:00
|
|
|
"test_subdomainset_mpi"
|
|
|
|
"test_subdomains_mpi"
|
|
|
|
]
|
|
|
|
++ lib.optionals (stdenv.isLinux && stdenv.isAarch64) [
|
|
|
|
# FAILED tests/test_unexpansion.py::Test2Pass::test_v0 - assert False
|
|
|
|
"test_v0"
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.isDarwin [
|
|
|
|
# FAILED tests/test_caching.py::TestCaching::test_special_symbols - ValueError: not enough values to unpack (expected 3, got 2)
|
|
|
|
"test_special_symbols"
|
2024-05-15 15:35:15 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# FAILED tests/test_unexpansion.py::Test2Pass::test_v0 - codepy.CompileError: module compilation failed
|
|
|
|
"test_v0"
|
|
|
|
]
|
|
|
|
++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
|
|
|
|
# Numerical tests
|
|
|
|
"test_lm_fb"
|
|
|
|
"test_lm_ds"
|
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2024-06-05 15:53:02 +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"
|
|
|
|
]
|
|
|
|
++ lib.optionals ((stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin) [ "tests/test_dle.py" ];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "devito" ];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
meta = {
|
2022-04-27 09:35:20 +00:00
|
|
|
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}";
|
2024-06-20 14:57:18 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ atila ];
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
|
|
|
}
|