# 安裝singularity 3.7.1 編譯原始碼 ###### tags: `singularity` [安裝原文網址](https://github.com/hpcng/singularity/blob/master/INSTALL.md) 1. Install system dependencies ```= yum groupinstall -y 'Development Tools' && \ yum install -y epel-release && \ yum install -y golang libseccomp-devel \ squashfs-tools cryptsetup ``` 2. Install Golang ```= export VERSION=1.15.8 OS=linux ARCH=amd64 wget -O /tmp/go${VERSION}.${OS}-${ARCH}.tar.gz https://dl.google.com/go/go${VERSION}.${OS}-${ARCH}.tar.gz && \ tar -C /usr/local -xzf /tmp/go${VERSION}.${OS}-${ARCH}.tar.gz echo 'export GOPATH=${HOME}/go' >> ~/.bashrc && \ echo 'export PATH=/usr/local/go/bin:${PATH}:${GOPATH}/bin' >> ~/.bashrc && \ source ~/.bashrc ``` 3. Install golangci-lint ```= curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.21.0 ``` 4. Clone the repo ```= 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.7.1 ``` 5. Compiling Singularity ```= cd ${GOPATH}/src/github.com/sylabs/singularity && \ ./mconfig && \ cd ./builddir && \ make && \ make install ``` ### 安裝完成 6. 確認 ```= singularity version ``` To build in a different folder and to set the install prefix to a different path: ```= ./mconfig -b ./buildtree -p /usr/local ```