forked from M-Labs/artiq
1
0
Fork 0

update Conda installation method

This commit is contained in:
Sebastien Bourdeauducq 2020-06-20 19:26:31 +08:00
parent 966ed5d013
commit 4ad46e0e40
2 changed files with 8 additions and 54 deletions

View File

@ -101,17 +101,17 @@ After installing either Anaconda or Miniconda, open a new terminal (also known a
Executing just ``conda`` should print the help of the ``conda`` command. If your shell does not find the ``conda`` command, make sure that the Conda binaries are in your ``$PATH``. If ``$ echo $PATH`` does not show the Conda directories, add them: execute ``$ export PATH=$HOME/miniconda3/bin:$PATH`` if you installed Conda into ``~/miniconda3``. Executing just ``conda`` should print the help of the ``conda`` command. If your shell does not find the ``conda`` command, make sure that the Conda binaries are in your ``$PATH``. If ``$ echo $PATH`` does not show the Conda directories, add them: execute ``$ export PATH=$HOME/miniconda3/bin:$PATH`` if you installed Conda into ``~/miniconda3``.
Download the `ARTIQ installer script <https://raw.githubusercontent.com/m-labs/artiq/master/install-with-conda.py>`_ and edit its beginning to define the Conda environment name (you can leave the default environment name if you are just getting started) and select the desired ARTIQ packages. Non-ARTIQ packages should be installed manually later. Controllers for third-party devices (e.g. Thorlabs TCube, Lab Brick Digital Attenuator, etc.) that are not shipped with ARTIQ can also be installed with this script. Browse `Hydra <https://nixbld.m-labs.hk/project/artiq>`_ or see the list of NDSPs in this manual to find the names of the corresponding packages, and list them at the beginning of the script.
Set up the Conda channel and install ARTIQ into a new Conda environment: ::
$ conda config --prepend channels https://conda.m-labs.hk/artiq-beta
$ conda config --append channels conda-forge
$ conda install -n artiq artiq
.. note:: .. note::
If you do not need to flash boards, the ``artiq`` package is sufficient. The packages named ``artiq-board-*`` contain only firmware for the FPGA board and are never necessary for using an ARTIQ system without reflashing it. If you do not need to flash boards, the ``artiq`` package is sufficient. The packages named ``artiq-board-*`` contain only firmware for the FPGA board and are never necessary for using an ARTIQ system without reflashing it.
Controllers for third-party devices (e.g. Thorlabs TCube, Lab Brick Digital Attenuator, etc.) that are not shipped with ARTIQ can also be installed with this script. Browse `Hydra <https://nixbld.m-labs.hk/project/artiq>`_ or see the list of NDSPs in this manual to find the names of the corresponding packages, and list them at the beginning of the script.
Make sure the base Conda environment is activated and then run the installer script: ::
$ conda activate base
$ python install-with-conda.py
After the installation, activate the newly created environment by name. :: After the installation, activate the newly created environment by name. ::
@ -137,7 +137,7 @@ Upgrading ARTIQ (with Conda)
When upgrading ARTIQ or when testing different versions it is recommended that new Conda environments are created instead of upgrading the packages in existing environments. When upgrading ARTIQ or when testing different versions it is recommended that new Conda environments are created instead of upgrading the packages in existing environments.
Keep previous environments around until you are certain that they are not needed anymore and a new environment is known to work correctly. Keep previous environments around until you are certain that they are not needed anymore and a new environment is known to work correctly.
To install the latest version, just select a different environment name and run the installer script again. To install the latest version, just select a different environment name and run the installation command again.
Switching between Conda environments using commands such as ``$ conda deactivate artiq-6`` and ``$ conda activate artiq-5`` is the recommended way to roll back to previous versions of ARTIQ. Switching between Conda environments using commands such as ``$ conda deactivate artiq-6`` and ``$ conda activate artiq-5`` is the recommended way to roll back to previous versions of ARTIQ.

View File

@ -1,46 +0,0 @@
# This script installs ARTIQ using the conda packages built by the new Nix/Hydra system.
# It needs to be run in the root (base) conda environment with "python install-with-conda.py"
# It supports Linux and Windows, but Linux users should consider using the higher-quality
# Nix package manager instead of Conda.
# EDIT THIS:
# The name of the conda environment to create
CONDA_ENV_NAME = "artiq"
# The conda packages to download and install.
CONDA_PACKAGES = [
"artiq",
"artiq-comtools",
# Only install board packages if you plan to reflash the board.
# The two lines below are just examples and probably not what you want.
# Select the packages that correspond to your board, or remove them
# if you do not intend to reflash the board.
"artiq-board-kc705-nist_clock",
"artiq-board-kasli-wipm"
]
# Set to False if you have already set up conda channels
ADD_CHANNELS = True
# PROXY: If you are behind a web proxy, configure it in your .condarc (as per
# the conda manual).
# You should not need to modify the rest of the script below.
import os
def run(command):
r = os.system(command)
if r != 0:
raise SystemExit("command '{}' returned non-zero exit status: {}".format(command, r))
if ADD_CHANNELS:
run("conda config --prepend channels m-labs")
run("conda config --prepend channels https://conda.m-labs.hk/artiq-beta")
run("conda config --append channels conda-forge")
# Creating the environment first with python 3.5 hits fewer bugs in conda's broken dependency solver.
run("conda create -y -n {CONDA_ENV_NAME} python=3.5".format(CONDA_ENV_NAME=CONDA_ENV_NAME))
for package in CONDA_PACKAGES:
# Do not activate the environment yet - otherwise "conda install" may not find the SSL module anymore on Windows.
# Installing into the environment from the outside works around this conda bug.
run("conda install -y -n {CONDA_ENV_NAME} -c https://conda.m-labs.hk/artiq-beta {package}"
.format(CONDA_ENV_NAME=CONDA_ENV_NAME, package=package))