poniedziałek, 21 grudnia 2015

Installing meep under Windows

I have decided to start some FDTD calculations or at least to learn how to calculate this. In order to omit all the problems with developing my own algorithms I have decided to search for a (preferably python) library doing FDTD stuff and found meep. The only problem with that is that it needs Linux and so I decided to use Cygwin instead. I was using this tutorial with some minor differences.

Firstly I installed Cygwin, as described in the tutorial. This was done without any difficulties. I've installed also Notepad++.

After that I've started to work on h5utils. This was more difficult, as the writepng.c in the h5utils package is developed for an older version of libpng, that is supplied with Cygwin. In order to make it work two changes had to be made in the writepng.c:

In line 312:

  // if (setjmp(png_ptr->jmpbuf)) {  
    if (setjmp(png_jmpbuf(png_ptr))) {  

In line 438:

 //  free(info_ptr->palette);  
    png_free_data(png_ptr, info_ptr, PNG_FREE_PLTE, -1);  

Next to install was the harminv, which needed a quick file exchange (config.guess from cygwin instead of the original one) and highly recommended libctl, that I will need, as I want to use meep with python, not C++. Finally meep was installed without any problems. As a test I've calculated one of the examples supplied with meep - a ring oscillator. The results (after some 1000something seconds of calculations) look promising:

Next step? Try to integrate the cygwin-based meep in python with pure windows based PyCharm. This will be fun.

2 komentarze:

  1. Thank you for sharing the fix for h5utils. I'm very grateful! -Shervin