Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does it work with python 3? #12

Open
shinong opened this issue May 24, 2018 · 3 comments
Open

Does it work with python 3? #12

shinong opened this issue May 24, 2018 · 3 comments

Comments

@shinong
Copy link

shinong commented May 24, 2018

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

Thanks a lot!

@FilipDominec
Copy link
Owner

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

@FilipDominec
Copy link
Owner

FilipDominec commented May 25, 2018

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants