Installing Meep On windows 8

Meep is a powerful and flexible FDTD simulation in wide use,
written for Linux. In principle, you need to know next to nothing about Linux
to run Meep. However, you do need a dedicated Linux machine. But if you're
anything like me, you might not like the Linux working enviornment so much and
look for a better workaround, which doesn't require having two machines (one
Linux and one Windows) or switching operating systems on a frequent
basis.
The following is a walkthorugh guide to installing Meep on a Windows 8 machine. It assumes minimal knowledge of Linux and little technical skill.
Take into account however, that such an installation is nothing like pressing "next-next-next". It takes time and a nontrivial effort to install everything, so if you just want to "try Meep out" this might not be the best course of action. It is also possible that the instructions below are not 100% up-to-date because of updates to Meep, Cygwin or what-not. When you do run into errors, I can recommend that you google around and try to use common sense to resolve any issues. In my experience, such installation issues can be fixed with enough hard work. Please don't email me with requests for support, if only because I am not an expert on Meep or Cygwin and almost certainly wouldn't be able to help you.
On the plus side, after the installation is done, Meep works like a charm! As far as I can tell, Meep on Cygwin runs nearly as fast as it does on Linux and has all the funcionalities of the Linux version. I have used it for memory\CPU intensive simulations and have never had any issues.
In preparing this guide, I was assisted by :
· http://www.physics.uc.edu/~thang/mm-cygwin.txt
· ftp://wsdetcp.upct.es/FelixM/Cristales_Fotonicos/MPB/MPBonCygwin.pdf
Preliminaries
Loosely speaking, Cygwin is a program which allows you to install and run Linux programs from a Linux-like terminal on your Windows machine. To install, you will need to copy commands from this manual (using ctrl+c, as usual) and paste them in the Cygwin terminal (which is done with shift+insert, not ctrl+v).
For this installation, you will also need the following :
Installing Cygwin
Download Cygwin (https://cygwin.com/install.html) and install. The initial download\installation can take a lot of time, depending on connection speed and such. After the initial install, you can rerun the installation file (setup-x86.exe) and install any packages you left out during your initial install. You can do this as many times as you need and installing the extra packages is quick.
You must install the following list of packages. For every item, type its name in the search window and click on “default“ until it says “install” :
Installing Meep
From Meep’s website, download h5utils, harminv, libctl and meep.
Unzip all of them and untar (i.e. unzip again) each file.
Start CYGWIN as administrator (right click on the Cygwin program icon and choose the run as admin option). Go to your download directory by typing cd c: and then cd User/username/… (where c and the library path should be replaced by the relevant drive and path).
The following is a walkthorugh guide to installing Meep on a Windows 8 machine. It assumes minimal knowledge of Linux and little technical skill.
Take into account however, that such an installation is nothing like pressing "next-next-next". It takes time and a nontrivial effort to install everything, so if you just want to "try Meep out" this might not be the best course of action. It is also possible that the instructions below are not 100% up-to-date because of updates to Meep, Cygwin or what-not. When you do run into errors, I can recommend that you google around and try to use common sense to resolve any issues. In my experience, such installation issues can be fixed with enough hard work. Please don't email me with requests for support, if only because I am not an expert on Meep or Cygwin and almost certainly wouldn't be able to help you.
On the plus side, after the installation is done, Meep works like a charm! As far as I can tell, Meep on Cygwin runs nearly as fast as it does on Linux and has all the funcionalities of the Linux version. I have used it for memory\CPU intensive simulations and have never had any issues.
In preparing this guide, I was assisted by :
· http://www.physics.uc.edu/~thang/mm-cygwin.txt
· ftp://wsdetcp.upct.es/FelixM/Cristales_Fotonicos/MPB/MPBonCygwin.pdf
Preliminaries
Loosely speaking, Cygwin is a program which allows you to install and run Linux programs from a Linux-like terminal on your Windows machine. To install, you will need to copy commands from this manual (using ctrl+c, as usual) and paste them in the Cygwin terminal (which is done with shift+insert, not ctrl+v).
For this installation, you will also need the following :
- A program that can unzip .tar and .gz files (http://www.izarc.org/ did the job for me).
- Notepad++ (http://notepad-plus-plus.org/download/v6.1.4.html), an improved notepad. You can use any text editor, of course, but I found this one to be extremely handy for coding in scheme. Notepad++ doesn’t recognize .ctl files by default, but can easily be made to recognize .ctl as a Scheme script (http://todd.ropog.com/get-notepad-to-recognize-any-file-extension/).
Installing Cygwin
Download Cygwin (https://cygwin.com/install.html) and install. The initial download\installation can take a lot of time, depending on connection speed and such. After the initial install, you can rerun the installation file (setup-x86.exe) and install any packages you left out during your initial install. You can do this as many times as you need and installing the extra packages is quick.
You must install the following list of packages. For every item, type its name in the search window and click on “default“ until it says “install” :
- gcc (devel)
- gnuplot (all)
- make
- automake (all)
- lapack (all)
- hdf5(all)
- guile(all)
- gsl (devel)
- indent
- gmp (all)
- libunistring (all)
- pkg-config (all)
- ffi (all)
- bdw (all)
- libgc (all)
- libpng (all)
Installing Meep
From Meep’s website, download h5utils, harminv, libctl and meep.
Unzip all of them and untar (i.e. unzip again) each file.
Start CYGWIN as administrator (right click on the Cygwin program icon and choose the run as admin option). Go to your download directory by typing cd c: and then cd User/username/… (where c and the library path should be replaced by the relevant drive and path).
Install h5utils
In the library you extracted h5utilz into, type : ./configure make make check (doesn't do anything, as far as I can tell) make install Important note – For some reason, installing h5utilz failed for some machines and worked flawlessly for others. If it doesn’t work for you, skip it. Matlab is more than capable of reading h5 files and can do a much better job in creating and customizing figures than h5topng, so you can work around this installation very easily. Install harminv Replace the the file "config.guess" in the harminv install lib with the one in C:\cygwin64\usr\share\automake-1.9. Here 1.9 is the automake version, you can verify the version you have with "automake --version". ./configure make make check make install Install libctl ./configure make make check make install Some users reported that for the libctl installation, the configure file might be missing. In that case, a solution is to run the command: sh autogen.sh This creates configure file. After that is done, running the ./configure && make && make install should be possible. Install Meep Go to cygwin64/usr/local/lib and run the following : ranlib libctl.a ranlib libharminv.a ranlib libctlgeom.a Go back to the the Meep install lib and /.configure --prefix=/usr/local make make check make install Congratulations ! You have just installed Meep. You should be able to run the examples from the tutorial (except for possible issues with h5topng, as mentioned above). |
Important note – For some reason, installing h5utilz fails for some machines and worked flawlessly for others. If it doesn’t work for you, skip it. Matlab is more than capable in reading h5 files and can do a much better job in creating and customizing figures than h5topng, so you can work around this installation very easily.
Install harminv
Replace the the file "config.guess" in the harminv install lib with the one in C:\cygwin64\usr\share\automake-1.9. Here 1.9 is the automake version, you can verify the version you have with "automake --version").
./configure
make
make check
make install
Install libctl
./configure
make
make check
make install
Install meep
go to cygwin64/usr/local/lib and run the following :
ranlib libctl.a
ranlib libharminv.a
ranlib libctlgeom.a
go back to the Meep install lib and
/.configure --prefix=/usr/local
make
make check
make install
Congratulations ! You have just installed meep. You should be able to run the examples from the tutorial (except for possible issues with h5topng, as mentioned above).
evel), gnuplot (all), make, automake (all), lapack, hdf5(all), guile(all), gsl (devel), indent, gmp (all), libunistring (all), pkg-config (all), ffi (all), bdw (all), libgc (all), libpng (all)
Install harminv
Replace the the file "config.guess" in the harminv install lib with the one in C:\cygwin64\usr\share\automake-1.9. Here 1.9 is the automake version, you can verify the version you have with "automake --version").
./configure
make
make check
make install
Install libctl
./configure
make
make check
make install
Install meep
go to cygwin64/usr/local/lib and run the following :
ranlib libctl.a
ranlib libharminv.a
ranlib libctlgeom.a
go back to the Meep install lib and
/.configure --prefix=/usr/local
make
make check
make install
Congratulations ! You have just installed meep. You should be able to run the examples from the tutorial (except for possible issues with h5topng, as mentioned above).
evel), gnuplot (all), make, automake (all), lapack, hdf5(all), guile(all), gsl (devel), indent, gmp (all), libunistring (all), pkg-config (all), ffi (all), bdw (all), libgc (all), libpng (all)
Installing MPB on cygwin
I also managed to install MPB on Cygwin, but since I am not an MPB user at the moment, I did not thoroughly check the installation process below. In order to install MPB, you will need to go through the same process listed above (except for the Meep installation) and then :
Install FFTW
Replace the file "config.guess" in the FFTW install lib with the one in C:\cygwin64\usr\share\automake-1.9. Here 1.9 is the automake version, you can verify the version you have with "automake --version".
./configure --prefix=/usr/local
make
make check
make install
Install MPB
Go to cygwin64/usr/local/lib and run the following :
ranlib libfftw.a
ranlib librfftw.a
./configure --prefix=/usr/local LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include
Now it gets tricky. Go (in Windows) to the folder "src\util" inside your install library. Open the file in a text editor and replace "sphere-quad.h: sphere_quad" with "sphere-quad.h: sphere_quad$(EXEEXT)". Save the new makefile as "makefile" (without an extension). Afterwards run :
make
make check
make install
Congragulations ! You just finished installing MPB on Cygwin.
Install FFTW
Replace the file "config.guess" in the FFTW install lib with the one in C:\cygwin64\usr\share\automake-1.9. Here 1.9 is the automake version, you can verify the version you have with "automake --version".
./configure --prefix=/usr/local
make
make check
make install
Install MPB
Go to cygwin64/usr/local/lib and run the following :
ranlib libfftw.a
ranlib librfftw.a
./configure --prefix=/usr/local LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include
Now it gets tricky. Go (in Windows) to the folder "src\util" inside your install library. Open the file in a text editor and replace "sphere-quad.h: sphere_quad" with "sphere-quad.h: sphere_quad$(EXEEXT)". Save the new makefile as "makefile" (without an extension). Afterwards run :
make
make check
make install
Congragulations ! You just finished installing MPB on Cygwin.