LoginSignup
1
4

More than 5 years have passed since last update.

Singularityのインストール (v3)

Last updated at Posted at 2019-03-20

概要

Singularity v3のインストール手順を説明します。Singularityはv3以前はC言語で実装されていましたが、v3からGo言語で再実装されたためインストール方法が大きく変わっています。v2以前のインストール方法は以前の投稿を参照ください。

インストールは以下の流れで行います。

  1. 必要なパッケージをインストールします
  2. Goをインストールします
  3. GitHubからSingularityのソースを入手し、ビルドします

本稿においては、Debian系LinuxとRHEL系Linuxへのインストール手順を説明します。自身の環境ではUbuntu18.04およびCentOS7.6において以下手順で動作確認を行いました。同様の手順でWindows Subsystem for Linux (Ubuntu18.04)へのインストールも可能ですが、まともに動作しません(2019年3月時点)。

インストール手順のより詳細な説明については公式マニュアルを参照ください。

インストール手順

パッケージのインストール

必要なパッケージ群をインストールします。

Debian系Linux

$ sudo apt-get update -y
$ sudo apt-get install -y build-essential libssl-dev uuid-dev libgpgme11-dev squashfs-tools

RHEL系Linux

$ sudo yum update -y
$ sudo yum groupinstall -y 'Development Tools'
$ sudo yum install -y epel-release
$ sudo yum install -y openssl-devel libuuid-devel libseccomp-devel squashfs-tools

なお、RHEL/CentOS6以前のバージョンではlibseccomp-develは不要のようです。

Goのインストール

Goの実行環境を構築します。

Debian系Linux

以下の例ではv1.11.5をインストールしていますが、バージョンは適宜変更してください。

$ export VERSION=1.11.5 OS=linux ARCH=amd64
$ cd /tmp
$ wget https://dl.google.com/go/go${VERSION}.${OS}-${ARCH}.tar.gz
$ tar -C /usr/local -xzf go${VERSION}.${OS}-${ARCH}.tar.gz

RHEL系Linux

yumコマンドによりインストールが可能です。

$ sudo yum install -y golang 

Debian/RHEL系Linux共通

Singularityのビルドには${GOPATH}という環境変数が使用されるため、この設定を~/.bashrcに記述しておきます。

$ echo 'export GOPATH=${HOME}/go' >> ~/.bashrc
$ echo 'export PATH=/usr/local/go/bin:${PATH}:${GOPATH}/bin' >> ~/.bashrc
$ source ~/.bashrc

Singularityのビルド・インストール

Singularityのソースをクローンし、ビルドします。特定のバージョンを選択したい場合はリリースタグを参照ください。

$ mkdir -p ${GOPATH}/src/github.com/sylabs
$ cd ${GOPATH}/src/github.com/sylabs
$ git clone https://github.com/sylabs/singularity.git
$ cd singularity

(オプション) 特定バージョンをインストールする場合はチェックアウトします。

$ export SVERSION=v3.1.0
$ git checkout ${SVERSION}

依存関係をDepにより解決し、Singularityバイナリをビルドします。

$ go get -u -v github.com/golang/dep/cmd/dep
$ ./mconfig
$ make -C builddir
$ sudo make -C builddir install

singularityコマンドを実行し、問題なく動作することを確認します。

$ singularity version
3.1.0
1
4
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
4