2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
2023-08-22 20:05:09 +00:00
|
|
|
, stdenv
|
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
|
|
|
|
, pytest-xdist
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2023-08-22 20:05:09 +00:00
|
|
|
, pythonRelaxDepsHook
|
2022-12-17 10:02:37 +00:00
|
|
|
, scipy
|
|
|
|
, sympy
|
2022-04-27 09:35:20 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "devito";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "4.8.6";
|
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-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-unuJLp+zTyGpOk5O78xYbW6Zrzp60WyqgT9mf2YpTG4=";
|
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
|
|
|
|
2023-08-22 20:05:09 +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
|
|
|
|
] ++ lib.optionals stdenv.cc.isClang [
|
|
|
|
llvmPackages.openmp
|
|
|
|
];
|
|
|
|
|
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.
|
|
|
|
disabledTests = [
|
|
|
|
"test_assign_parallel"
|
|
|
|
"test_cache_blocking_structure_distributed"
|
|
|
|
"test_codegen_quality0"
|
2023-08-22 20:05:09 +00:00
|
|
|
"test_coefficients_w_xreplace"
|
|
|
|
"test_docstrings"
|
|
|
|
"test_docstrings[finite_differences.coefficients]"
|
|
|
|
"test_gs_parallel"
|
|
|
|
"test_if_halo_mpi"
|
|
|
|
"test_if_parallel"
|
2022-04-27 09:35:20 +00:00
|
|
|
"test_init_omp_env_w_mpi"
|
2023-08-22 20:05:09 +00:00
|
|
|
"test_loop_bounds_forward"
|
2022-04-27 09:35:20 +00:00
|
|
|
"test_mpi_nocomms"
|
2023-08-22 20:05:09 +00:00
|
|
|
"test_mpi"
|
|
|
|
"test_index_derivative"
|
|
|
|
"test_new_distributor"
|
|
|
|
"test_setupWOverQ"
|
2022-12-17 10:02:37 +00:00
|
|
|
"test_shortcuts"
|
2023-08-22 20:05:09 +00:00
|
|
|
"test_subdomainset_mpi"
|
2024-05-15 15:35:15 +00:00
|
|
|
"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"
|
|
|
|
|
|
|
|
# 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
|
|
|
];
|
|
|
|
|
|
|
|
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"
|
2024-05-15 15:35:15 +00:00
|
|
|
] ++ lib.optionals ((stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin) [
|
|
|
|
"tests/test_dle.py"
|
2022-04-27 09:35:20 +00:00
|
|
|
];
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|