Discussion:
[Meep-discuss] SOLVED: Problems in the meep installation process & python bindings
KOHLMANN Hannes
2018-04-18 14:58:52 UTC
Permalink
Ok, sorry for a mistake that I made with the PYTHONPATH.
Now as I set the PYTHONPATH correctly, I got the following ModuleNotFoundError:

ModuleNotFoundError: No module named '_meep'

which I fixed with the suggestion from https://www.mail-archive.com/meep-***@ab-initio.mit.edu/msg05885.html

Now meep.Vector3() works!

Best regards,
Hannes
________________________________________
Von: KOHLMANN Hannes
Gesendet: Mittwoch, 18. April 2018 14:58
An: Christopher Hogan; meep-***@ab-initio.mit.edu
Betreff: Problems in the meep installation process & python bindings

Hello Chris, hello all!

Now I returned to the beginning of the installation process in order to do it following the “building from source” instructions. Still, at the end of having done all that trying around for 3 hours, I am not able to do meep.Vector3(…) or something equivalent (meep has no such attribute) after having done
“import meep” in python3.

My installation steps I will summarize as follows:


1) I installed libpng-dev instead of libpng16-dev, as the latter is deprecated, and the rest of all the packages and libraries

2) I installed libpython3.6-dev, because I only have python27 and python36 on my system

3) I installed harminv via apt-get because there were some errors when trying to build it manually.

4) h5utils from apt

5) mpb I tried to build following the instructions, resulting in the obtrusive error, that BLAS was not found. I tried quite everything to set –with-blas=… or anything for the build process to find the necessary files. No success. Also there was little help asking google, since this MPB BLAS problem usually ends with “what does the config.log say?” without any further treatment.
--> so I ended up installing mpb from apt and continued.

6) pip3 seems to be broken in Ubuntu, when I do pip3 install, I get the error: in from pip import main --> main not found
Then I did all the stuff with pip install instead of pip3 install after having checked which pip version it was, giving as a result:

***@Ubuntu:~$ pip --version

pip 10.0.0 from /usr/local/lib/python3.6/dist-packages/pip (python 3.6)
…which is basically what I want, I guess (as opposed to python 2.7)!

If I don’t do the pip install steps, where will it lead to errors when working with meep later?

7) Last but not least I tried to install meep as described in the Building from source description. First the error came that Fortran 77 compiler was not found. I installed gfortran from apt and the error was gone. After that the error occurred that pympb.h is not found. That was the only thing that somehow made sense to me, since from the apt manager there will be an old version installed, not yet supporting python bindings.
So then I went back to the mpb installation part to install it from hand. And: this time without the BLAS not found error (I guess that it may have found it because of the previously installed mpb from the apt manager).

8) After having successfully built mpb, finally meep also got through without errors.

9) I set the environment variable export PYTHONPATH=/usr/local/lib/python3.6/site-packages in .profile

10) I start python3 in the same shell where I just finished installing meep

11) import meep works

12) meep.Vector3(16,8,0) --> meep has no attribute Vector3()

13) closed shell and reopened & ran python3 again, imported meep --> now meep was not found, although I configured the PYTHONPATH

I thought, that maybe through the installation processes via apt there may be the problem that –enable-shared was not set during the installation.
I just ran the whole building script again where all the lib sharing is enabled --> this time without a single error (no BLAS errors, no fortran errors, etc).
But still, when I start python3, it cannot find meep.

My Ubuntu version is 17.10
Unfortunately my Linux foo is too weak and I have only little ideas where to begin to search for problems. I also don’t know if it can actually work to install first packages via apt and then trying to build everything from hand once again and installing it as I did in the last step …
My goal is actually just to successfully execute:

python3
import meep
cell = meep.Vector3(16,8,0) … for example
I would be very glad, if someone could give me some hints if or where I do something profoundly wrong.

Thank you very much in advance & best regards,
Hannes

Von: Christopher Hogan [mailto:***@simpetus.com]
Gesendet: Mittwoch, 11. April 2018 14:59
An: KOHLMANN Hannes
Cc: meep-***@ab-initio.mit.edu
Betreff: Re: [Meep-discuss] libctlgeom was not found

Hi,

The Python interface requires the shared library, libctlgeom.so. You can build it by adding the "--enable-shared" flag when you run autogen.sh while building libctl.

Full build instructions can be found here: http://meep.readthedocs.io/en/latest/Installation/#building-from-source

Chris

On Wed, Apr 11, 2018 at 7:50 AM, KOHLMANN Hannes <***@ove.at<mailto:***@ove.at>> wrote:
Hello everyone,

I am facing a problem with ./configure after having done ./autoconfig.sh from the official MEEP repository.
The error is the following:
configure: error: libctlgeom was not found, is required for Python interface

I installed the libctl package from https://github.com/stevengj/libctl,
After doing so, I located the directory, where these files are:
***@Ubuntu:~/meep$ locate libctlgeom
/usr/local/lib/libctlgeom.a
/usr/local/lib/libctlgeom.la<http://libctlgeom.la>
…while the install folder (like mentioned on the repository page of libctl) is:
/usr/local/share/libctl

Now I tried to do the following with the configure file of the meep package:
./configure –with-libctl=/usr/local/share/libctl
… but unfortunately without success. The same error occurs. Is is maybe because the libctlgeom.a / .la are in a different directory?
How can I solve this problem?

As I am not such a Linux expert and don’t know how to proceed further, I wanted to ask for help this way.

Thanks a lot in advance & best regards,
Hannes Kohlmann

_______________________________________________
meep-discuss mailing list
meep-***@ab-initio.mit.edu<mailto:meep-***@ab-initio.mit.edu>
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Loading...