Dear Orçun,
Thank you for your interest in running the hazard modeller's
toolkit. I hope I can provide some clarification.
Firstly, if you are starting out with the toolkit I highly
recommend to try it out using the virtual machine option that
Michele pointed out. The hmtk comes already installed on the
virtualbox images available here (
http://www.globalquakemodel.org/openquake/support/documentation/installing-pc/)
so using this would allow you to get started and play around
without the tricky installation procedure.
As you indicate, however, the hmtk (and GMPE toolkit) can be run
on Windows, but to do so will require installation of the
OpenQuake hazard and Nrml libraries (not the full OpenQuake
engine). I will try to explain the process in the following steps,
although some aspects may vary depending on your system.
The best way to start is to install Pythonxy. The windows
installer is available from here (
https://code.google.com/p/pythonxy/wiki/Downloads?tm=2).
Note that OpenQuake is only supported for Python 2.7.x, so the
best option is to download the executable for 2.7.3 or 2.7.6.
Download and follow the instructions. It is best to perform a full
installation as you will need some of the dependencies it pulls
in. We do this so that PythonXY can install most of the critical
dependencies that are needed for running the OpenQuake hazard
library. Installation can take quite a bit of time (half an hour
or so, depending on your system).
Once PythonXY is installed you will need to install manually two
more python dependencies: BaseMap and Lxml. Fortunately Windows
installers are available for both. BaseMap can be downloaded from
here:
http://sourceforge.net/projects/matplotlib/files/matplotlib-toolkits/basemap-1.0.7/.
Lxml can be downloaded from here (
http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml);
however, the choice of installer will depend on your system
(32-bit or 64-bit) and your processor (Intel or amd). I would
start by trying the lxml-3.4.0.win32-py2.7.exe, and if that fails
then try the lxml-3.4.0.win-amd64-py2.7.exe. If successful then
that should install in a few seconds.
The next step is to try to install the OpenQuake hazard library
and NRML library. This is more complex. The first step is to
download the respective zipped directories from here (
https://github.com/gem/oq-hazardlib)
and here (
https://github.com/gem/oq-nrmllib)
- click on the "Download ZIP" button in the bottom left. Unzip
them, ideally so that the folders are somewhere high up in the
system path (I usually put them in C:\oq-hazardlib and
C:\oq-nrmllib). Use PythonXY an open up an "Enhanced Console".
Change directory into the hazard library (e.g cd c:\ then cd
oq-hazardlib). Then type the command:
python setup.py install build --compiler=mingw
This should install the hazard library using the mingw C compiler
(if this fails then install MinGW). Do the same thing for the
nrmllib (i.e. cd c:\ then cd oq-nrmllib). Run the same command:
python setup.py install
If this installs successfully then re-start PythonXY.
The final step is to download the hmtk and add the directory to
the pythonpath. The zipped toolkit can be downloaded from here (
https://github.com/GEMScienceTools/hmtk/),
so just download and unzip somewhere accessible (again I tend to
put it into something like C:\gem-hmtk). When that is done right
click "My Computer" and select "Properties". This will open up the
system properties. Click on the tab labelled "Advanced" and then
open "Environment Variables". Under system variable look for
"PYTHONPATH" and then click on Edit. At the end of the list of
folders in the "Variable Value" bar add "C:\gem-hmtk\hmtk" (i.e
the path to the hmtk folder). Click OK and then you are done.
One way to check is to use PythonXY to open up an IPython terminal
and type "import openquake.hazardlib", "import openquake.nrmllib"
and "import hmtk". If no errors are produced then the toolkits are
installed successfully.
I hope this clarifies the procedure, but as you see it is quite
complex. Installation of OpenQuake hazardlib and nrmllib are not
officially supported by GEM, so this is the only way to do this.
It is also possible that you may find errors due to conflicting
dependencies as PythonXY now pulls in later versions of
Numpy/Scipy than are supported by OpenQuake directly.
Good luck!
Graeme Weatherill