From db2d9002988246fa3aed4b6e0dd06ff269ac22c9 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 20 Jun 2020 19:31:26 +0800 Subject: [PATCH] update Conda installation method --- doc/manual/installing.rst | 17 ++++++--------- install-with-conda.py | 46 --------------------------------------- 2 files changed, 7 insertions(+), 56 deletions(-) delete mode 100644 install-with-conda.py diff --git a/doc/manual/installing.rst b/doc/manual/installing.rst index af67c4f11..08c3baee4 100644 --- a/doc/manual/installing.rst +++ b/doc/manual/installing.rst @@ -101,17 +101,14 @@ 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``. -Download the `ARTIQ installer script `_ 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. +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:: - 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 `_ 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 + 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 Conda. Browse `Hydra `_ or see the list of NDSPs in this manual to find the names of the corresponding packages. After the installation, activate the newly created environment by name. :: @@ -137,7 +134,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. 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. diff --git a/install-with-conda.py b/install-with-conda.py deleted file mode 100644 index f22c07f96..000000000 --- a/install-with-conda.py +++ /dev/null @@ -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") - 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 {package}" - .format(CONDA_ENV_NAME=CONDA_ENV_NAME, package=package))