---
# System prepended metadata

title: Singularity
tags: [code]

---

---
tags: code
---

# Singularity

## Install 

Based on: https://github.com/hpcng/singularity/blob/master/INSTALL.md

Besides, nice tutorial about snakemake and singularity integration:
https://reproducibility.sschmeier.com/container/index.html#using-a-singularity-container 

### Update system and dependencies
```
sudo apt-get update && \
  sudo apt-get install -y build-essential \
  libseccomp-dev pkg-config squashfs-tools cryptsetup
```

### Get and install GO language
```
wget https://golang.org/dl/go1.15.3.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf ~/Downloads/go1.15.3.linux-amd64.tar.gz
#add to ~/.profile
export GOPATH=${HOME}/go
export PATH=/usr/local/go/bin:${PATH}:${GOPATH}/bin
# check
go version
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.21.0
```

### Obtain and install recent Singularity 
```
mkdir -p ${GOPATH}/src/github.com/sylabs && \
  cd ${GOPATH}/src/github.com/sylabs && \
  git clone https://github.com/sylabs/singularity.git && \
  cd singularity
git checkout v3.6.4 # check for new releases
```

```
cd ${GOPATH}/src/github.com/sylabs/singularity && \
  ./mconfig && \
  cd ./builddir && \
  make && \
  sudo make install
```