0

I am trying to install MIT's meep from source on my macOS following this recommended procedure: install meep from source on macOs

After the final step, I ran "make check" to ensure that everything went well. However, the following error is shown for python:

============================================================================
Testsuite summary for meep 1.22.0

TOTAL: 23

PASS: 23

SKIP: 0

XFAIL: 0

FAIL: 0

XPASS: 0

ERROR: 0

============================================================================
Making check in scheme
/Applications/Xcode.app/Contents/Developer/usr/bin/make check-am
make[2]: Nothing to be done for check-am'. Making check in libpympb make[1]: Nothing to be done for check'.
Making check in python
/Applications/Xcode.app/Contents/Developer/usr/bin/make check-am
/Applications/Xcode.app/Contents/Developer/usr/bin/make check-TESTS
FAIL: tests/test_3rd_harm_1d.py
FAIL: tests/test_absorber_1d.py
FAIL: tests/test_adjoint_solver.py
FAIL: tests/test_adjoint_cyl.py
FAIL: tests/test_adjoint_jax.py
FAIL: tests/test_antenna_radiation.py
FAIL: tests/test_array_metadata.py
FAIL: tests/test_bend_flux.py
FAIL: tests/test_binary_partition_utils.py
FAIL: tests/test_binary_grating.py
FAIL: tests/test_cavity_arrayslice.py
FAIL: tests/test_cavity_farfield.py
FAIL: tests/test_chunk_balancer.py
FAIL: tests/test_chunk_layout.py
FAIL: tests/test_chunks.py
FAIL: tests/test_conductivity.py
FAIL: tests/test_cyl_ellipsoid.py
FAIL: tests/test_dft_energy.py
FAIL: tests/test_dft_fields.py
FAIL: tests/test_diffracted_planewave.py
FAIL: tests/test_dispersive_eigenmode.py
FAIL: tests/test_divide_mpi_processes.py
FAIL: tests/test_dump_load.py
FAIL: tests/test_eigfreq.py
FAIL: tests/test_faraday_rotation.py
FAIL: tests/test_field_functions.py
FAIL: tests/test_force.py
FAIL: tests/test_fragment_stats.py
FAIL: tests/test_gaussianbeam.py
FAIL: tests/test_geom.py
FAIL: tests/test_get_point.py
FAIL: tests/test_get_epsilon_grid.py
FAIL: tests/test_holey_wvg_bands.py
FAIL: tests/test_holey_wvg_cavity.py
FAIL: tests/test_kdom.py
FAIL: tests/test_ldos.py
FAIL: tests/test_material_dispersion.py
FAIL: tests/test_material_grid.py
FAIL: tests/test_medium_evaluations.py
FAIL: tests/test_mpb.py
FAIL: tests/test_mode_coeffs.py
FAIL: tests/test_mode_decomposition.py
FAIL: tests/test_multilevel_atom.py
FAIL: tests/test_n2f_periodic.py
FAIL: tests/test_oblique_source.py
FAIL: tests/test_physical.py
FAIL: tests/test_prism.py
FAIL: tests/test_pw_source.py
FAIL: tests/test_refl_angular.py
FAIL: tests/test_ring.py
FAIL: tests/test_ring_cyl.py
FAIL: tests/test_simulation.py
FAIL: tests/test_special_kz.py
FAIL: tests/test_source.py
FAIL: tests/test_timing_measurements.py
FAIL: tests/test_user_defined_material.py
FAIL: tests/test_visualization.py
FAIL: tests/test_wvg_src.py

Testsuite summary for meep 1.22.0

TOTAL: 58

PASS: 0

SKIP: 0

XFAIL: 0

FAIL: 58

XPASS: 0

ERROR: 0

============================================================================
See python/test-suite.log

make[4]: *** [test-suite.log] Error 1
make[3]: *** [check-TESTS] Error 2
make[2]: *** [check-am] Error 2
make[1]: *** [check] Error 2
make: *** [check-recursive] Error 1

What could be the possible cause? Also, I have tried to install the same using:

pip install meep

But some attributes in meep are shown as missing. So, could these errors possibly have some correlation?

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [1], in <cell line: 11>()
      9 sx = 16  # size of cell in X direction
     10 sy = 32  # size of cell in Y direction
---> 11 cell = mp.Vector3(sx,sy,0)
     13 dpml = 1.0
     14 pml_layers = [mp.PML(dpml)]

AttributeError: module 'meep' has no attribute 'Vector3'

I looked into some of the log files, and this is one of the errors:

Traceback (most recent call last):
  File "./tests/test_binary_grating.py", line 4, in <module>
    import meep as mp
  File "/Users/pranav/desktop/Nanophotonics-project/MEEP/meep-1.22.0/python/meep/__init__.py", line 4164, in <module>
    from .simulation import (
  File "/Users/pranav/desktop/Nanophotonics-project/MEEP/meep-1.22.0/python/meep/simulation.py", line 5524
    yield from self.left._print(prefix=prefix+ext_l, is_root=False)
             ^
SyntaxError: invalid syntax
FAIL tests/test_binary_grating.py (exit status: 1)

Others follow a similar pattern. In one, it showed the module h5py did not exist, but it does. I installed all python modules using pip, so I'm guessing path mustn't be the issue, but that might explain it.

Pranav
  • 3
  • 4
  • Hi. I did not add that statement and also I could not figure out the problem – Pranav Mar 06 '22 at 17:31
  • Sorry I was unclear. I didn't mean, "did you add that statement". I meant, "did you follow the directions in that statement"; that is, "did you look in `python/test-suite.log`"? The tests (apparently) don't print the reason they failed to the screen, instead they write the reasons to that log file. What does it say about why the tests failed? – MadScientist Mar 06 '22 at 19:59
  • I didn't know that, thanks. The log shows missing modules and invalid syntax, so is the issue with the source? But it seems correct. – Pranav Mar 06 '22 at 21:32
  • `yield from` was added in Python 3.3. If you're seeing a syntax error you're probably using an older version of Python, most likely Python 2. You don't say anything about where you got your version of Python but probably your Mac provides Python 2 by default so unless you installed something newer, that's what you have. Run `python --version` to see. – MadScientist Mar 07 '22 at 00:55
  • Both of the versions exist. Python 2.7.18 and Python 3.9.10 (installed with homebrew) – Pranav Mar 07 '22 at 09:52
  • I've also asked this question in the discussion section of the source GitHub repository. In case it makes things clearer, this is the link to that: [discussion](https://github.com/NanoComp/meep/discussions/1980) – Pranav Mar 07 '22 at 10:12
  • In case python2 was used by default, I used this:`cp /usr/local/bin/python3 /usr/local/bin/python ` to make python3 default. And when I ran make, make check again after configure, I got this error:`unable to open output file '.libs/array_slice.o': 'Operation not permitted.' 1 error generated` – Pranav Mar 07 '22 at 10:58
  • Copying files around in a controlled directory like `/usr/local` is always a bad idea: unless you know exactly what you're doing it's easy to break things. However, I can't really help you with MacOS as I don't use it. You need to find out (a) what Python command your build system is invoking, (b) if there's a way you can change it (make variable or environment variable), and (c) if not, add another directory to the start of `PATH` where you put a symlink to the right python with the right name, or something like that. – MadScientist Mar 07 '22 at 14:20

0 Answers0