- Python 3
- MVS
- A CUDA capable GPU from NVIDIA with compute capability greater or equal to 3.0
- CUDA Toolkit
Tested on
Software | Version |
---|---|
Windows | 10 |
Python | 3.7 3.8 |
CUDA | 10.1 |
MSVC | 19.24 |
- Install Python and pip, MSVC and CUDA
- run
git clone https://github.com/CERN/TIGRE.git
- run
python setup.py install --user
in the Python folder.
A succesfull installation should be able to execute the script at TIGRE/Python/example.py
-
Install MS Visual Studio Build Tools with Windows SDK.
NOTE: The User has to have no spaces. -
Install Python 3 pip. You can use a virtual conda environment or just a normal python installation.
-
Install CUDA. Make sure the
CUDA_PATH
andPATH
environment variable are set accordingly.
NOTE: The User has to have no spaces. -
Download/clone TIGRE
git clone https://github.com/CERN/TIGRE.git
-
Compile libraries
cd TIGRE/Python/ pip install -r requirements.txt --user python setup.py install --user
NOTE: If you are working under the virtual environment that created by
venv
and you want to install TIGRE to it, you should remove the--user
option. With the--user
option, TIGRE and the other required pakages will be installed to your Python user install directory, not to your virtual environment or system directory.Install in this case will make a copy of pytigre to your python distribution. Therefore the
develop
command is more useful when modifying the source files and developing the software.python setup.py develop --user
-
Try demo 3. If it runs succesfully then you are good to go.
- Python 2/Python 3
- gcc
- A CUDA capable GPU from NVIDIA with compute capability greater or equal to 3.0
- CUDA Toolkit
Tested on
Software | Version |
---|---|
Ubuntu | 16.04 17.10 |
Python | 2.7 3.7 |
CUDA | 8.0 9.2 10.1 10.2 |
gcc | 7.6.0 |
- Install python, gcc, pip and CUDA
- run
git clone https://github.com/CERN/TIGRE.git
- run
python setup.py install --user
in the Python folder.
A succesfull installation should be able to execute the script at TIGRE/Python/example.py
For Ubuntu
-
Install python and pip (you can use 2 or 3, example show for 2)
sudo apt update sudo apt upgrade sudo apt install python2.7 python-pip
-
Install CUDA
Installing CUDA in linux (specially one with a GUI) can be a challenge. Please follow NVIDIAs instructions carefully.
CUDA download link -
Install gcc
gcc should already be installed in your linux, as it is part of the linux distribution.
If you need to install an older version of gcc, read here. -
Download/clone TIGRE
git clone https://github.com/CERN/TIGRE.git
-
Compile libraries
cd TIGRE/Python/ pip install -r requirements.txt --user python setup.py install --user
NOTE: If you are working under the virtual environment that created by
venv
and you want to install TIGRE to it, you should remove the--user
option. With the--user
option, TIGRE and the other required pakages will be installed to your Python user install directory, not to your virtual environment or system directory.Install in this case will make a copy of pytigre to your python distribution. Therefore the
develop
command is more useful when modifying the source files and developing the software.python setup.py develop --user
-
Try demo 3. If it runs succesfully then you are good to go.
if this fails, then try:
export CUDAHOME=yourcudahome
, e.g. default is export CUDAHOME=/usr/local/cuda
python setup.py install --user
NOTE: as of November 2020 the pip pytigre is behind the main repo, we recomedn you install it and compile it yourself. Trying to fix that.
Optional linting dependences are provided to enforce the prevailing codestyle in the Python component of the TIGRE library.
The primary linting packages utilized are:
Multiple installation options have been provided:
A requirements_dev
file is located in Tigre's Python
directory. These dependencies can be installed using pip install -r requirements_dev.txt --user
while in the Python
directory.
Dev dependencies may also be installed using the lint
extras defined in setup.py
. These dependencies can be installed using pip install .[lint] --user
while in the Python
directory.
Linting dependencies are also provided as a pre-commit configuration. With the pre-commit hooks installed, code will be linted prior to commit, preventing code from being committed that fails linting. By default, these hooks are only run against staged files.
The pre-commit package is included in the above pip
installs; once the framework is installed, hooks can be installed by invoking pre-commit install
.
Once installed, invoking the linting tools is straightforward. From TIGRE's Python
directory:
# Run in current directory & subdirectories
$ flake8 .
$ black .
# Or specify a file
$ flake8 ./example.py
$ black ./example.py
pre-commit may also be manually invoked, which will run flake8
and black
against all staged files:
$ pre-commit run
flake8...................................................................Passed
black....................................................................Passed
Check for merge conflicts................................................Passed
Check Toml...........................................(no files to check)Skipped
Check Yaml...........................................(no files to check)Skipped
Fix End of Files.........................................................Passed
Mixed line ending........................................................Passed
check blanket noqa.......................................................Passed
NOTE: pre-commit may also be manually invoked against all files (staged and unstaged) using the pre-commit run --all-files
. However, some changes made to Python's TIGRE codebase by black
have been manually reverted for readability reasons and should not be committed in their blackened state.