- A copy of Windows 10 64-bit
- Knowledge of Python (and its virtual environments), Git and software development
- The OpenQuake Python distribution for Windows. You can download a nightly snapshot from here: https://downloads.openquake.org/pkgs/windows/oq-engine/nightly/
Unzip the downloaded zip file, which has a name like OpenQuake_Engine_3.10.1_2003311327.zip
to any location in your filesystem; at this step the extracted folder can be also moved to a different location or renamed after the extraction.
PLEASE NOTE: The following commands must be executed from the oq-console.bat
console available into the root folder.
The extracted OpenQuake Engine distribution contains a 'nightly' copy of the OpenQuake Engine code. This 'nightly' copy must be uninstalled first to avoid conflicts with the development installation that we are going to set up in the following steps. To uninstall the 'nightly' copy of the OpenQuake Engine, use pip
:
pip uninstall openquake.engine
To be able to download the OpenQuake source code you must have Git installed and available in the system PATH
. If the git
command is not available in
the oq-console.bat
terminal, please use Git Bash
to run this step and then switch back to oq-console.bat
.
Considering that the complete repository is quite large given its long history, we recommend shallow cloning the repository to download only the latest revision.
mkdir src && cd src
git clone https://github.com/gem/oq-engine.git --depth=1
In case you needed the source code with the full history of the repository, you
can convert the shallow clone into a full repository with the command
git fetch --unshallow
.
The OpenQuake Engine source code must be installed via pip
using the --editable
flag. See pip install --help
for further help.
pip install -e oq-engine/[dev]
python -m compileall .
The dev
extra feature will install some extra dependencies that will help in debugging the code. Not all the features are available on Windows, see 1.
Now it is possible to run the OpenQuake Engine with oq engine
. Any change made to the oq-engine
code will be reflected in the environment.
Continue on How to run the OpenQuake Engine
You can pull all the latest changes to the source code running
cd oq-engine
git pull
cd ..
If any other installation of the Engine exists on the same machine, like a system-wide installation made with packages, you must change the DbServer port from the default one (1908) to any other unused port. Using a DbServer started from a different codebase (which may be out-of-sync) could lead to unexpected behaviours and errors. To change the DbServer port oq-engine/openquake/engine/openquake.cfg
must be updated:
[dbserver] | [dbserver]
## cut ## | ## cut ##
port = 1908 > port = 1985
authkey = changeme | authkey = changeme
## cut ## | ## cut ##
or the OQ_DBSERVER_PORT
enviroment variable must be set in oq-console.bat
and in oq-server.bat
:
set OQ_DBSERVER_PORT=1985
To uninstall the OpenQuake development environment remove the folder where it has been extracted.
It is possible to install, as an example, the Silx HDF5 viewer in the same environment as the OpenQuake Engine. To make that happen run the following commands via the oq-console.bat
prompt:
pip install PyQt5==5.7.1 silx==0.10
Silx viewer can be then run as
silx view calc_NNN.hdf5
[1]: extra features, like celery and pam support are not available on Windows.
If you need help or have questions/comments/feedback for us, you can:
- Subscribe to the OpenQuake users mailing list: https://groups.google.com/g/openquake-users
- Contact us on IRC: irc.freenode.net, channel #openquake