2019-11-15 16:13:02 +01:00
|
|
|
Introduction
|
|
|
|
============
|
|
|
|
|
|
|
|
This is the Python MsSpec version with support for Python 3.x and dynamic memory allocation for Phagen and Spec
|
|
|
|
|
|
|
|
|
2021-02-22 15:49:57 +01:00
|
|
|
Installation of the devel package
|
|
|
|
=================================
|
2019-11-15 16:13:02 +01:00
|
|
|
|
2021-02-22 15:49:57 +01:00
|
|
|
Requirements
|
|
|
|
------------
|
2019-11-15 11:16:06 +01:00
|
|
|
|
2021-02-22 15:49:57 +01:00
|
|
|
To compile MsSpec shared libraries, you need:
|
|
|
|
|
2021-02-22 15:52:42 +01:00
|
|
|
- Python >= 3.6
|
|
|
|
- gfortran compiler
|
|
|
|
- cairo library (runtime files and header files)
|
2021-02-22 15:49:57 +01:00
|
|
|
|
|
|
|
Depending on your OS and Python version, you may need all the requirements (runtime libraries
|
|
|
|
and header files) to build wxPython (please consult your distribution's package list for the
|
|
|
|
appropriate package names) and their dependencies:
|
|
|
|
|
2021-02-22 15:52:42 +01:00
|
|
|
- python-dev (for your version of python)
|
|
|
|
- gtk (preferably version 3, but depends on your needs)
|
|
|
|
- gstreamer
|
|
|
|
- gstreamer-plugins-base
|
|
|
|
- glut
|
|
|
|
- libwebkitgtk (matching your gtk version)
|
|
|
|
- libjpeg
|
|
|
|
- libpng
|
|
|
|
- libtiff
|
|
|
|
- libsdl
|
|
|
|
- libnotify
|
|
|
|
- libsm
|
2021-02-22 15:49:57 +01:00
|
|
|
|
|
|
|
You also need a tool to create and manage Python virtual environments. For now only
|
|
|
|
*virtualenv* is supported. So if you plan to install msspec with the one-step command,
|
|
|
|
you need to install it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fetching the code
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
You first need to clone the devel branch with either 2 commands below:
|
2020-03-31 18:29:41 +02:00
|
|
|
|
|
|
|
```Bash
|
|
|
|
git clone https://git.ipr.univ-rennes1.fr/epsi/msspec_python3.git
|
2021-02-22 15:49:57 +01:00
|
|
|
git checkout devel
|
2020-03-31 18:29:41 +02:00
|
|
|
```
|
|
|
|
|
2020-04-14 09:31:28 +02:00
|
|
|
```Bash
|
|
|
|
git clone --branch devel https://git.ipr.univ-rennes1.fr/epsi/msspec_python3.git
|
|
|
|
```
|
|
|
|
|
2021-02-22 15:49:57 +01:00
|
|
|
This will create a msspec\_python3 folder with a local copy of the repository.
|
2020-04-14 09:31:28 +02:00
|
|
|
|
2019-12-06 13:26:22 +01:00
|
|
|
|
|
|
|
|
2021-02-22 15:49:57 +01:00
|
|
|
One step install
|
|
|
|
----------------
|
|
|
|
|
|
|
|
The command below will do all the stuff to install msspec in its dedicated Python
|
|
|
|
virtual environment provided all the above requirements are fullfilled
|
2019-12-06 13:26:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
```Bash
|
2021-02-22 15:49:57 +01:00
|
|
|
cd msspec_python3
|
|
|
|
make devel
|
2019-12-06 13:26:22 +01:00
|
|
|
```
|
|
|
|
|
2021-02-22 15:49:57 +01:00
|
|
|
This will:
|
2021-02-22 15:52:42 +01:00
|
|
|
|
|
|
|
- Create a Python virtual environment in the "\_venv" folder inside the msspec\_python3 folder.
|
|
|
|
- Install all the required Python packages in this virtual environment.
|
|
|
|
- Install (or even maybe build) wxPython for your OS and Python version in this virtual environment.
|
|
|
|
- Build the msspec shared librarires.
|
|
|
|
- Install msspec in *edit mode* in this virtual environment.
|
2019-12-06 13:26:22 +01:00
|
|
|
|
2021-02-22 15:49:57 +01:00
|
|
|
You can tweak the process by specifying space separated key=value pairs on the command line.
|
|
|
|
Allowed keys are:
|
2019-12-06 13:26:22 +01:00
|
|
|
|
2021-02-22 15:52:42 +01:00
|
|
|
- PYTHON, to give the executable name of the python interpreter to use rather than the default (python)
|
|
|
|
- VERBOSE, set to 1 if you want the install process to be more verbose
|
|
|
|
- NO\_VENV, set to 1 to not create a virtual environment
|
|
|
|
- VENV\_PATH, specify the path to a virtual environment root folder
|
|
|
|
- DEBUG, set to 1 to add debugging symbols
|
|
|
|
- BUILDDIR, to set a different name than the default to store building artifacts (./build)
|
|
|
|
- FC, the Fortran compiler to use (gfortran)
|
|
|
|
- F2PY
|
2019-12-06 13:26:22 +01:00
|
|
|
|
|
|
|
|
2021-02-22 15:49:57 +01:00
|
|
|
Work with msspec
|
|
|
|
----------------
|
|
|
|
|
|
|
|
All you need to do each time you want to work with msspec is activating the virtual environment.
|
|
|
|
|
|
|
|
For example, if *virtualenv* was used to create the virtual environment:
|
2019-12-06 13:26:22 +01:00
|
|
|
|
|
|
|
```Bash
|
2021-02-22 15:49:57 +01:00
|
|
|
source msspec_python3/_venv/bin/activate
|
2019-12-06 13:26:22 +01:00
|
|
|
```
|
|
|
|
|
2021-02-22 15:49:57 +01:00
|
|
|
Then you can launch your script with
|
2019-12-06 13:26:22 +01:00
|
|
|
|
|
|
|
```Bash
|
2021-02-22 15:49:57 +01:00
|
|
|
python myscript.py
|
2019-12-06 13:26:22 +01:00
|
|
|
```
|
|
|
|
|
2021-02-22 15:49:57 +01:00
|
|
|
See the online [tutorials](https://msspec.cnrs.fr/tutorials/index.html) for more information on how to use msspec.
|
|
|
|
|
|
|
|
When you're done, you can deactivate the virtual environment with
|
2019-12-06 13:26:22 +01:00
|
|
|
|
|
|
|
```Bash
|
2021-02-22 15:49:57 +01:00
|
|
|
deactivate
|
2019-12-06 13:26:22 +01:00
|
|
|
```
|
|
|
|
|
2021-02-22 15:49:57 +01:00
|
|
|
Uninstall MsSpec
|
|
|
|
----------------
|
|
|
|
|
|
|
|
When Installed in "devel mode", nothing is created outside the msspec\_python3 folder, so you just have to remove
|
|
|
|
that folder to get rid of msspec on your computer
|
|
|
|
|
|
|
|
|
|
|
|
Manual control over the install
|
|
|
|
-------------------------------
|
|
|
|
|
|
|
|
If for any reason you want to control each step of the building process (for example you do not have *virtualenv* but you
|
|
|
|
are using *conda*), here is how:
|
|
|
|
|
2021-02-22 15:55:04 +01:00
|
|
|
- Create a virtual environment or use an existing one and activate it
|
|
|
|
- Install the list of requirements that are listed in the src/pip.freeze file
|
|
|
|
- Install wxPython
|
|
|
|
- Build the msspec shared librarires with the command "make pybinding"
|
|
|
|
- Install the msspec Python package with "pip install -e src/"
|
2021-02-22 15:49:57 +01:00
|
|
|
|
|
|
|
The last step can be replaced by adding the src/ path to your PYTHONPATH, but bear in mind that the package will then
|
|
|
|
be also visible to other virtual environments no matter they fit the msspec requirements.
|