Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
hpc:tutorials:singularity:singularity_with_wsl [2024/09/27 19:04] – gelöscht - Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1hpc:tutorials:singularity:singularity_with_wsl [2024/10/04 21:45] (aktuell)
Zeile 1: Zeile 1:
 +==== Singularity with WSL 2 ====
  
 +This tutorial aims to install Singularity 4.0.2 on your Windows machine and is in most parts a direct extract from the ''INSTALL.md'' of that release. **This tutorial may be out of date**, so check the INSTALL.md if you are using a different release.
 +
 +=== Prerequisites ===
 +
 +== 1. Activate WSL ==
 +
 +In a Windows PowerShell, run following command as an administrator. You can get an administrator PowerShell by clicking the Windows icon, searching for "PowerShell", and right-clicking the application and selecting //"Run as administrator"//.
 +<code>
 +wsl --install
 +</code>
 +WSL will then be available from your Start menu.
 +
 +== 2. Install Dependencies ==
 +The first thing to do is to update your Linux distribution (the default WSL distribution is Ubuntu, if you change it this command may be different): 
 +<code>
 +sudo bash -c 'apt update && apt upgrade -y'
 +sudo apt install -y \
 +    autoconf \
 +    automake \
 +    cryptsetup \
 +    git \
 +    libfuse-dev \
 +    libglib2.0-dev \
 +    libseccomp-dev \
 +    libtool \
 +    pkg-config \
 +    runc \
 +    squashfs-tools \
 +    squashfs-tools-ng \
 +    uidmap \
 +    wget \
 +    zlib1g-dev
 +</code>
 +
 +Then install //go//. If you have go installed previously, be sure to remove ''/usr/local/go'' first. 
 +<code>
 +export VERSION=1.21.4 OS=linux ARCH=amd64
 +sudo rm -rf /usr/local/go
 +wget -O /tmp/go${VERSION}.${OS}-${ARCH}.tar.gz https://dl.google.com/go/go${VERSION}.${OS}-${ARCH}.tar.gz
 +sudo tar -C /usr/local -xzf /tmp/go${VERSION}.${OS}-${ARCH}.tar.gz
 +# make go available for usage:
 +echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
 +source ~/.bashrc
 +</code>
 +
 +=== Install Singularity ===
 +
 +All Singularity releases can be found here:
 +https://github.com/sylabs/singularity/releases
 +
 +We will continue with 4.0.2, so we will fetch and compile the code. After successful compilation it will be installed on your system:
 +<code>
 +wget -O /tmp/singularity-ce-4.0.2.tar.gz https://github.com/sylabs/singularity/releases/download/v4.0.2/singularity-ce-4.0.2.tar.gz
 +tar -C /tmp -xvf /tmp/singularity-ce-4.0.2.tar.gz
 +cd /tmp/singularity-ce-4.0.2
 +make -C builddir && sudo make -C builddir install
 +</code>
 +
 +Your Singularity installation can now be tested via
 +<code>
 +singularity --version
 +</code>
 +
 +If everything went well, the output should be
 +<code>
 +singularity-ce version 4.0.2
 +</code>