|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "markdown", |
| 5 | + "metadata": {}, |
| 6 | + "source": [ |
| 7 | + "# Build from Source\n", |
| 8 | + "\n", |
| 9 | + "To install pyOpenMS from `source`, you will first have to compile OpenMS\n", |
| 10 | + "successfully on your platform of choice (note that for MS Windows you\n", |
| 11 | + "will need to match your compiler and Python version). Please follow the\n", |
| 12 | + "[official\n", |
| 13 | + "documentation](https://abibuilder.cs.uni-tuebingen.de/archive/openms/Documentation/release/latest/html/index.html)\n", |
| 14 | + "in order to compile OpenMS for your platform. Next you will need to\n", |
| 15 | + "install the following software packages\n", |
| 16 | + "\n", |
| 17 | + "On Microsoft Windows: you need the 64 bit C++ compiler from Visual\n", |
| 18 | + "Studio 2015 to compile the newest pyOpenMS for Python 3.5, 3.6 or 3.7.\n", |
| 19 | + "This is important, else you get a clib that is different than the one\n", |
| 20 | + "used for building the Python executable, and pyOpenMS will crash on\n", |
| 21 | + "import. The OpenMS wiki has [detailed\n", |
| 22 | + "information](https://github.com/OpenMS/OpenMS/wiki/Build-pyOpenMS-on-Windows)\n", |
| 23 | + "on building pyOpenMS on Windows.\n", |
| 24 | + "\n", |
| 25 | + "You can install all necessary Python packages on which pyOpenMS depends\n", |
| 26 | + "through\n", |
| 27 | + "\n", |
| 28 | + "``` bash\n", |
| 29 | + "pip install -U setuptools\n", |
| 30 | + "pip install -U pip\n", |
| 31 | + "pip install -U autowrap\n", |
| 32 | + "pip install -U pytest\n", |
| 33 | + "pip install -U numpy\n", |
| 34 | + "pip install -U wheel\n", |
| 35 | + "```\n", |
| 36 | + "\n", |
| 37 | + "Depending on your systems setup, it may make sense to do this inside a\n", |
| 38 | + "virtual environment\n", |
| 39 | + "\n", |
| 40 | + "``` bash\n", |
| 41 | + "virtualenv pyopenms_venv\n", |
| 42 | + "source pyopenms_venv/bin/activate\n", |
| 43 | + "```\n", |
| 44 | + "\n", |
| 45 | + "Next, configure OpenMS with pyOpenMS: execute `cmake` as usual, but with\n", |
| 46 | + "parameters `DPYOPENMS=ON`. Also, if using virtualenv or using a specific\n", |
| 47 | + "Python version, add `-DPYTHON_EXECUTABLE:FILEPATH=/path/to/python` to\n", |
| 48 | + "ensure that the correct Python executable is used. Compiling pyOpenMS\n", |
| 49 | + "can use a lot of memory and take some time, however you can reduce the\n", |
| 50 | + "memory consumption by breaking up the compilation into multiple units\n", |
| 51 | + "and compiling in parallel, for example\n", |
| 52 | + "`-DPY_NUM_THREADS=2 -DPY_NUM_MODULES=4` will build 4 modules with 2\n", |
| 53 | + "threads. You can then configure pyOpenMS:\n", |
| 54 | + "\n", |
| 55 | + "``` bash\n", |
| 56 | + "cmake -DPYOPENMS=ON\n", |
| 57 | + "make pyopenms\n", |
| 58 | + "```\n", |
| 59 | + "\n", |
| 60 | + "Build pyOpenMS (now there should be pyOpenMS specific build targets).\n", |
| 61 | + "Afterwards, test that all went well by running the tests:\n", |
| 62 | + "\n", |
| 63 | + "``` bash\n", |
| 64 | + "ctest -R pyopenms\n", |
| 65 | + "```\n", |
| 66 | + "\n", |
| 67 | + "Which should execute all the tests and return with all tests passing.\n", |
| 68 | + "\n", |
| 69 | + "## Further Questions\n", |
| 70 | + "\n", |
| 71 | + "In case the above instructions did not work, please refer to the [Wiki\n", |
| 72 | + "Page](https://github.com/OpenMS/OpenMS/wiki/pyOpenMS), contact the\n", |
| 73 | + "development team on github or send an email to the OpenMS mailing list." |
| 74 | + ], |
| 75 | + "id": "378c8fe3-aa9a-4e23-b61f-89efdd9372a0" |
| 76 | + } |
| 77 | + ], |
| 78 | + "nbformat": 4, |
| 79 | + "nbformat_minor": 5, |
| 80 | + "metadata": {} |
| 81 | +} |
0 commit comments