FilipDominec / python-meep-install

Robust compilation procedure of latest MEEP and python-meep on Linux
GNU General Public License v2.0
16 stars 19 forks source link

Does it work with python 3? #12

Open shinong opened 6 years ago

shinong commented 6 years ago

Hi, I am wondering that whether this meep will work with python 3 script?

Thanks a lot!

FilipDominec commented 6 years ago

I guess it should! But so far I did not check the compilation procedure.

FilipDominec commented 6 years ago

I was curious, so I tried these trivial changes:

  1. changed in python-meep-install.sh: all python installation commands replaced from "python-something" to "python3-something", excepting "python-argparse" which is nonexistent for python3 so I just deleted it EDIT: now it can be easily changed by setting the $PYTHON variable
  2. I also modified 4 lines in python-meep/make-mpi so that they are preceded with python3
  3. EDIT: setup.py, setup-mpi.pyneed converting the print functions for py3 with:s/print (.*)/print(\1)/g```

Then I ran the standard compilation command (see README.md). Actually it ran well and failed on the very last command (i.e. building a python wrapper using SWIG) with the error message

meep_mpi_wrap.cpp:4474:9: 
error: 'PyFile_Check' was not declared in this scope
...                                                   
error: 'PyInstance_Check' was not declared in this scope

I guess this is due to some incompatibility with Numpy. Maybe it is trivial to fix, maybe it would involve some hacking; now I have to focus on my work. If you proceed any further, keep me posted, please. \

Here is the log file: https://github.com/FilipDominec/python-meep-install/blob/master/logs/180525-Ubuntu_Artful_Aardvark-x86_64-firstPython3.log

FilipDominec commented 6 years ago

Confirmed the same behaviour on Fedora 28 (64-bit)