33 assert !lapack.isILP64;
35 buildPythonPackage rec {
39 src = fetchFromGitHub {
42 rev = "refs/tags/v${version}";
43 hash = "sha256-TB85obdk8pSWRaz3+3I6P6+dQtCHosWHRnKGck/wG9Q=";
48 # https://github.com/NanoComp/meep/issues/2819
49 postPatch = lib.optionalString (!pythonOlder "3.12") ''
50 substituteInPlace configure.ac doc/docs/setup.py python/visualization.py \
51 --replace-fail "distutils" "setuptools._distutils"
54 # MPI is needed in nativeBuildInputs too, otherwise MPI libs will be missing
77 propagatedBuildInputs =
88 ++ lib.optionals (!pythonOlder "3.12") [
89 setuptools # used in python/visualization.py
92 propagatedUserEnvPkgs = [ mpi ];
94 dontUseSetuptoolsBuild = true;
95 dontUsePipInstall = true;
96 dontUseSetuptoolsCheck = true;
98 enableParallelBuilding = true;
102 export PYTHON=${python}/bin/${python.executable};
110 "--enable-maintainer-mode"
118 This test is taken from the MEEP tutorial "Fields in a Waveguide" at
119 <https://meep.readthedocs.io/en/latest/Python_Tutorials/Basics/>.
120 It is important, that the test actually performs a calculation
121 (calls `sim.run()`), as only then MPI will be initialised and MPI linking
122 errors can be caught.
124 nativeCheckInputs = [
130 export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"
132 # Generate a python test script
135 cell = mp.Vector3(16,8,0)
136 geometry = [mp.Block(mp.Vector3(mp.inf,1,mp.inf),
138 material=mp.Medium(epsilon=12))]
139 sources = [mp.Source(mp.ContinuousSource(frequency=0.15),
141 center=mp.Vector3(-7,0))]
142 pml_layers = [mp.PML(1.0)]
144 sim = mp.Simulation(cell_size=cell,
145 boundary_layers=pml_layers,
148 resolution=resolution)
152 ${mpi}/bin/mpiexec -np 2 python3 test.py
158 description = "Free finite-difference time-domain (FDTD) software for electromagnetic simulations";
159 homepage = "https://meep.readthedocs.io/en/latest/";
160 license = licenses.gpl2Only;
161 platforms = platforms.linux;
162 maintainers = with maintainers; [