0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Apptainerことはじめ

Last updated at Posted at 2025-05-04

Apptainer

Apptainer - Portable, Reproducible Containers: Singularityと呼ばれていたものが、Linux Foundationに入ることによってApptainerに変わった。

関連ポスト: Singularityことはじめ #初心者 - Qiita

ホストとコンテナ内のファイル共有について

shell, exec, run, testいずれの実行時においても、ホストの$(PWD), $(HOME), /tmp, /var/tmp, /proc, /sys, /devがコンテナ内から見える。
これらのファイルの編集閲覧権限はapptainer実行者の権限と同じになる。したがって、$(HOME)/$(PWD)//tmp//var/tmpは編集可能だが、他は閲覧のみ。

これに加えてホストの/host/Aをコンテナ内の/container/Bにbindしたい場合は

aptainer exec --bind /host/A:/container/B hoge.sif python3 --version

のように--bindを使う。

コマンドチートシート

apptainer build hoge.sif hoge.def #hoge.defからhoge.sifをビルド
apptainer shell hoge.sif #コンテナに入ってshellでインタラクティブに操作
apptainer run hoge.sif #レシピ内%runscript に書かれた内容を実行して終了
apptainer exec hoge.sif python3 --version #コンテナ内で`python3 --version`を実行して終了
apptainer test hoge.sif #レシピ内%test に書かれた内容を実行
apptainer inspect hoge.sif #レシピ内%labels, %help の情報を表示
apptainer inspect -d hoge.sif #レシピの内容を表示
apptainer inspect -e hoge.sif #環境変数を表示
apptainer inspect -H hoge.sif #コンテナ内%help の情報を表示
apptainer inspect -j hoge.sif #出力をJSONで
apptainer inspect -l hoge.sif #%labels の情報を表示
apptainer inspect -r hoge.sif #%runscript の内容をを表示
apptainer inspect -s hoge.sif #%startscript の内容を表示
apptainer inspect -t hoge.sif #%test の情報を表示

Ubuntu22.04へのインストール

cat /etc/lsb-relase

出力
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.4 LTS"

で、入れるディストリビューションはUbuntu 22.04。
chatGPT先生の教えに従って、関連ライブラリをインストール:

sudo apt update
sudo apt install -y build-essential libseccomp-dev pkg-config squashfs-tools cryptsetup

あとは公式Installing Apptainer — Apptainer Admin Guide main documentationのInstall Debian packagesの箇所に従って、以下のコマンドでGithubからdebファイルをとってきてインストール:

export VERSION=1.4.0  # 2025/5/5時点最新安定版
wget https://github.com/apptainer/apptainer/releases/download/v${VERSION}/apptainer_${VERSION}_amd64.deb
sudo dpkg -i apptainer_${VERSION}_amd64.deb

トラブルシューティング

conflicting packages - not installing apptainer

error message
dpkg: error processing archive apptainer_1.4.0_amd64.deb (--install):
 conflicting packages - not installing apptainer
Errors were encountered while processing:
 apptainer_1.4.0_amd64.deb

でインストール未達だった。
前の記事Singularityことはじめ #初心者 - Qiitaで、singularity-ceを入れていたので、そことコンフリクトしていた。
sudo apt remove singularity-ceで消した後にsudo dpkg -i apptainer_${VERSION}_amd64.debでインストール完了。

例えばapptainer --versionsingularity --version

apptainer version 1.4.0

が返ってくる。

Ubuntu24.04へのインストール

2025/09/03に実施。
cat /etc/lsb-relase

出力
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04.2 LTS"

で、入れるディストリビューションはKubuntu 24.04。

公式Installing Apptainer — Apptainer Admin Guide main documentationにInstall Ubuntu packagesの箇所があるのを発見した。これに従って、以下のコマンドでリポジトリを追加してインストール:

sudo apt update
sudo apt install -y software-properties-common
sudo add-apt-repository -y ppa:apptainer/ppa
sudo apt update
sudo apt install -y apptainer # non-setuid版をインストール

例えばapptainer --versionsingularity --version

apptainer version 1.4.2

が返ってくる。

トラブルシューティング

TimeoutError: [Errno 110] Connection timed out

sudo add-apt-repository -y ppa:apptainer/ppaの箇所で以下のエラーで止まる:

(抜粋)
File "/usr/lib/python3/dist-packages/httplib2/__init__.py", line 1133, in connect
    sock.connect((self.host, self.port))
TimeoutError: [Errno 110] Connection timed out

これは、sudoにproxy環境がうまく反映できていないのが原因だった。Proxy環境は一般ユーザー環境で.bashrcとして設定してあったので

sudo -E add-apt-repository -y ppa:apptainer/ppa

として-Eのオプションをつけて環境変数を引き継いで実行したところうまく通った。

oneapi-hpckitのコンテナoneapi-hpckit.sifをつくって使ってみる

oneapi-hpckit.def
Bootstrap: docker
From: intel/oneapi-hpckit:2025.1.1-0-devel-ubuntu22.04

%post
    apt-get update && apt-get install -y build-essential
    echo 'source /opt/intel/oneapi/setvars.sh' >> /environment
    echo 'source /opt/intel/oneapi/setvars.sh' >> /etc/profile.d/oneapi.sh

%environment
    source /opt/intel/oneapi/setvars.sh

%runscript
    echo "Intel oneAPI HPC Toolkit container is ready."
    exec "$@"

apptainer build oneapi-hpckit.sif oneapi-hpckit.defでコンテナを作成。このコマンドには特にsudoは必要ない。

apptiner shell oneapi-hpckit.sifでコンテナに入って操作してみる

apptiner shell oneapi-hpckit.sifでコンテナに入る。
ここでの環境は、基本的にホストと無関係にコンテナ内に構築されたものだが、$HOME$PWD/tmpはホストと共有されたものになっている。この共有はread+writeで、コンテナ内で作成した$HOME, $PWD, /tmpのファイルはコンテナを閉じた後も残る。この点が、dockerのコンテナとは決定的に違うポイント。

oneapi-hpckitのdockerコンテナをベースにしているので、

Apptainer> which ifx
/opt/intel/oneapi/compiler/2025.1/bin/ifx
Apptainer> mpiifx --version
ifx (IFX) 2025.1.1 20250418
Copyright (C) 1985-2025 Intel Corporation. All rights reserved.

といった出力が得られる。

トラブルシューティング

ネットワークの不安定?

何度やっても以下のエラーが出る。 20回くらい試みても、ほとんどの試行は以下のエラーで止まる:

FATAL:   While performing build: conveyor failed to get: error writing layer: local error: tls: bad record MAC

エラーが出る時間が違うので、多分ネットワークの不安定性によるものと判断。一旦docker pullで落としてそこから作ることにした。

sudo docker pull intel/oneapi-hpckit:2025.1.1-0-devel-ubuntu22.04
sudo docker save intel/oneapi-hpckit:2025.1.1-0-devel-ubuntu22.04 -o oneapi-hpckit.tar
sudo apptainer build oneapi-hpckit.sif docker-archive://oneapi-hpckit.tar

oneapi-hpckit.sifができる。docker pullの方が何となく、ネットワークの不安定性に強いよう。
こちらのコマンドでは、docker-archive://oneapi-hpckit.tarにアクセスするために、最後のコマンドにsudoが必要。

oneapi-hpckitのコンテナoneapi-hpckit.sifを改造する

なんでoneapi-hpckitのコンテナを作ったかって、そりゃoneapi-hpckitに入っているMPIライブラリをリンクしたインテルのコンパイラでビルドしたアプリの入ったコンテナを作りたかったからである。というわけで、oneapi-hpckit.sifを改造して、自分がビルドしたいアプリケーションを入れ込んだsifコンテナを作る。

基本的な流れは(ChatGPT先生による提案により)

# 1. 展開
apptainer build --sandbox my_sandbox/ base.sif

# 2. 修正
apptainer shell --writable my_sandbox/
# → apt install, ファイル編集, ビルドなど
# apt installする際はコマンドをsudo apptainer...にしておいたほうがよい

# 3. 再パッケージ化(任意)
sudo apptainer build my_modified.sif my_sandbox/

Elk-10.4.9を/opt/elk/src/elkとして追加したoneapi-hpckit4elk.sifを作る

まず適当なディレクトリでsandboxを作成:

apptainer build --sandbox my_sandbox/ oneapi-hpckit.sif

次にvimlessを入れるために管理者権限で入る:

sudo apptainer shell --writable my_sandbox/
Apptainer> apt update
Apptainer> apt install vim
Apptainer> apt install less

でファイル書き換えや閲覧の準備完了。

The Elk Codeビルドの備忘録 #DFT - Qiita
に則って、Elk-10.4.9をsandbox内の/root/sources/elk-10.4.9にインストールする。(Elkは古式ゆかしいアプリケーションなので、prefix等でインストール先を指定するようなことはしない)

ln -s /root/sources/elk-10.4.9 /opt/elk

/opt/elkにシンボリックリンクを貼る。つまり、実行するファイルは/opt/elk/src/elkとしてアクセスできるようにした。ここにPATHを通したい。

Apptainerコンテナ内でPATHを通すためのお作法としては/.singularity.d/env/90-environment.shに環境変数の更新案を記入するのが適切な方法の一つであるとchatGPTに習ったので、

/.singularity.d/env/90-environment.sh(抜粋)
export PATH="/opt/elk/src:$PATH"

を追記した。これでwhich elkを入力すると、PATHが通っていることが確認できる。

このsandboxをsifコンテナにまとめる:

sudo apptainer build oneapi-hpckit4elk.sif ./my_sandbox

こうしてできたコンテナにapptainer shell oneapi-hpckit4elk.sifで入って、which elkで適切にPATHが通っているかどうか確認できる。

トラブルシューティング

dpkg: error: requested operation requires superuser privilege

vimをインストールする際にapptainer shell --writable my_sandbox/としてapt install vimを実行すると

出力(抜粋)
perl: warning: Falling back to a fallback locale ("C.UTF-8").
debconf: delaying package configuration, since apt-utils is not installed
dpkg: error: requested operation requires superuser privilege
E: Sub-process /usr/bin/dpkg returned an error code (2)

となって、インストールできない。これを解決するためにはsandboxに入るときにsudo apptainer shell --writable my_sandbox/で実行する必要がある。

Elk-10.4.9を/opt/elk/src/elkとして追加したoneapi-hpckit4elk.sifを実行

上で作ったsifコンテナを動かしてみる。前提として、ホストにはoneapi-hpckitの2025.1.0を入れてあり、ランタイムのmpirunはインストールされている。

今回作ったコンテナでは%runscriptelkは追加していないので、自動実行はされない。従って、apptainer exec oneapi-hpickit4elk.sif elk等として、明示的に実行コマンドを指定することになる。これをslurmで実行するスクリプトは以下の通り(参考URL:Slurmことはじめ #初心者 - Qiita):

calc.sh
#!/bin/bash
#SBATCH --job-name=ngridk_888
#SBATCH --time=02:00:00
#SBATCH --partition=debug
#SBATCH --ntasks=1 
#SBATCH --cpus-per-task=4

. /home/shinohara/intel/oneapi/setvars.sh

export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK

EXE=elk
MPIEXE=mpirun
SIF=/path/for/oneapi-hpickit4elk.sif

$MPIEXE apptainer exec $SIF $EXE > log.log

として、sbatch calc.shで期待通りに実行ができた

buildできるレシピ

ソースコードと同じ。とにかく動くレシピが重要。

GCC+OpenMPIでquantum espresso (QE) をビルドするレシピ

QE_OpenMPI.def
Bootstrap: docker
From: ubuntu:24.04

%labels
    Maintainer "Yasushi SHINOHARA <yasushi.shinohara_at_hogemail.com>"
    Description "Ubuntu 24.04 Fortran HPC build env for Quantum ESPRESSO (QE)"
    Description "QE built from source; binaries in /opt/qe/bin"
    BuildDate "UTC-$(date -u +%Y-%m-%dT%H:%M:%SZ)"
    MPI OpenMPI
    Base Ubuntu 24.04

%environment
    export QE_HOME=/opt/qe
    export PATH=$QE_HOME/bin:$PATH
    # 並列数のデフォルト(必要に応じてホスト側で上書き)
    export OMP_NUM_THREADS=1
    export MKL_NUM_THREADS=1
    export OPENBLAS_NUM_THREADS=1

%post -c /bin/bash
    set -euo pipefail
    export DEBIAN_FRONTEND=noninteractive
    apt-get update
    # 基本ツール & ビルドに必要なもの
    apt-get install -y --no-install-recommends \
        ca-certificates build-essential gfortran gcc g++ make git wget curl perl pkg-config \
        python3 python3-pip python3-setuptools python3-venv patch \
        openmpi-bin libopenmpi-dev \
        libfftw3-dev libfftw3-mpi-dev \
        libblas-dev liblapack-dev \
        libscalapack-openmpi-dev \
        libhdf5-openmpi-dev \
        zlib1g-dev libzstd-dev
    update-ca-certificates

    # 省サイズ化(APTキャッシュ・リスト削除)
    apt-get clean
    rm -rf /var/lib/apt/lists/*

    # バージョンのログ
    echo "==== Compilers ===="
    gcc --version || true
    gfortran --version || true
    echo "==== MPI ===="
    mpirun --version || true
    echo "==== BLAS/LAPACK/FFTW/ScaLAPACK/ELPA ===="
    pkg-config --list-all 2>/dev/null | grep -E 'fftw|elpa|scalapack' || true

    # 動作確認用サンプルを置く(/opt/samples)
    mkdir -p /opt/samples
    cat >/opt/samples/hello_f90.f90 <<'EOF'
program hello
  print *, "Hello, Fortran!"
end program hello
EOF

    cat >/opt/samples/hello_mpi.f90 <<'EOF'
program hello_mpi
  use mpi
  implicit none
  integer :: ierr, rank, size
  call MPI_Init(ierr)
  call MPI_Comm_rank(MPI_COMM_WORLD, rank, ierr)
  call MPI_Comm_size(MPI_COMM_WORLD, size, ierr)
  print *, "Hello from rank", rank, "of", size
  call MPI_Finalize(ierr)
end program hello_mpi
EOF

   # 簡易ビルドスクリプト
    cat >/opt/samples/build_test.sh <<'EOF'
#!/usr/bin/env bash
set -eux

workdir=$(mktemp -d -t smoketest.XXXXXX)
trap 'rm -rf "$workdir"' EXIT  # 終了時に必ず削除
echo "tmp: $workdir"

gfortran /opt/samples/hello_f90.f90 -o $workdir/hello_f90
mpifort /opt/samples/hello_mpi.f90 -o $workdir/hello_mpi
$workdir/hello_f90
mpirun --allow-run-as-root -np 2 $workdir/hello_mpi
EOF
    chmod +x /opt/samples/build_test.sh

    # 取得する QE のバージョン(必要ならここを書き換え)
    QEV="qe-7.3"     # 例: qe-7.3 / qe-7.2 / qe-7.1 など
    SRC_DIR=/tmp/qe_src
    QE_HOME=/opt/qe
    mkdir -p ${SRC_DIR} ${QE_HOME}
    cd ${SRC_DIR}

    # ソース取得(GitHub の公式リリース tarball)
    wget -q https://github.com/QEF/q-e/archive/refs/tags/${QEV}.tar.gz
    tar xf ${QEV}.tar.gz
    cd q-e-${QEV}

    # 環境のヒント(OpenMPI/FFTW/ScaLAPACK/HDF5 を使う)
    # configure は自動検出を試みるので、まずは素直に通す
    ./configure --enable-openmp FCFLAGS="-O0 -fallow-argument-mismatch" FFLAGS="-O0 -fallow-argument-mismatch" --prefix=${QE_HOME}

    # 代表的なパッケージをビルド(pw, ph, cp, pp など)
    make -j"$(nproc)" pw ph cp pp
    make install

    # 便利スクリプト(バージョン表示)
    echo "${QEV}" > ${QE_HOME}/QE_VERSION.txt

    # 後片付け
    rm -rf ${SRC_DIR}

%runscript
    # 使い方のヒントを出す
    echo "Quantum ESPRESSO container: \$QE_HOME=\${QE_HOME:-/opt/qe}"
    echo "Binaries in /opt/qe/bin (on PATH). Example:"
    echo "  mpirun -np 4 pw.x -in scf.in"
    exec "$@"

%help
    Quantum ESPRESSO (QE) built from source with OpenMPI/FFTW/BLAS/LAPACK/ScaLAPACK/HDF5.
    Binaries are placed under /opt/qe/bin and added to PATH.

    Typical usage:
      apptainer exec --bind \$PWD:/work QE_OpenMPI.sif mpirun -np 4 pw.x -in /work/scf.in

    Note:
      - Match the container's MPI (OpenMPI) with host environment when using multi-node runs.
      - Set OMP_NUM_THREADS as needed.

%test
    set -eux
    # シリアル & MPI の両方の簡易テスト
    /opt/samples/build_test.sh
%help
    このコンテナは、Fortranベースの科学技術計算コード(特にQuantum ESPRESSO)を
    ビルド・実行するためのUbuntu 24.04環境です。
    主要ツール:
      - Compilers: gcc/gfortran, g++, make, cmake, ninja, pkg-config
      - MPI: OpenMPI (mpicc, mpifort など)
      - Math libs: OpenBLAS, LAPACK, FFTW3(+MPI), ScaLAPACK, ELPA
      - IO libs: HDF5(OpenMPI), NetCDF-C/-Fortran
    テスト:
      apptainer test <SIFファイル>
    例(コンパイル):
      apptainer exec <SIF> bash -lc 'mpifort file.f90 -O3 -o a.out'
    例(実行):
      apptainer exec --bind $PWD:$PWD --pwd $PWD <SIF> mpirun -np 8 ./a.out

%runscript
    # 既定ではバージョン一覧を表示
    echo "Fortran HPC build container (Ubuntu 24.04)"
    echo "Compilers:"
    gfortran --version | head -n1 || true
    echo "MPI:"
    mpirun --version | head -n1 || true
    echo "Try: apptainer exec $SINGULARITY_CONTAINER bash -lc '/opt/samples/build_test.sh'"

Fortranを使う計算科学コードビルド用レシピ

HPC_GNU_Fortran.def
Bootstrap: docker
From: ubuntu:24.04

%labels
    Maintainer "Yasushi SHINOHARA <yasushi.shinohara@hogemail.com>"
    Description "Ubuntu 24.04 Fortran HPC build env for Quantum ESPRESSO (QE)"
    BuildDate "UTC-$(date -u +%Y-%m-%dT%H:%M:%SZ)"
    MPI OpenMPI
    Base Ubuntu 24.04

%environment
    # 並列数のデフォルト(必要に応じてホスト側で上書き)
    export OMP_NUM_THREADS=1
    export MKL_NUM_THREADS=1
    export OPENBLAS_NUM_THREADS=1

%post -c /bin/bash
    set -euo pipefail
    export DEBIAN_FRONTEND=noninteractive
    apt-get update
    # 基本ツール & ビルドに必要なもの
    apt-get install -y --no-install-recommends \
        ca-certificates build-essential gfortran gcc g++ make git wget curl perl pkg-config \
        python3 python3-pip python3-setuptools python3-venv patch \
        openmpi-bin libopenmpi-dev \
        libfftw3-dev libfftw3-mpi-dev \
        libblas-dev liblapack-dev \
        libscalapack-openmpi-dev \
        libhdf5-openmpi-dev \
        zlib1g-dev libzstd-dev
    update-ca-certificates

    # 省サイズ化(APTキャッシュ・リスト削除)
    apt-get clean
    rm -rf /var/lib/apt/lists/*

    # バージョンのログ
    echo "==== Compilers ===="
    gcc --version || true
    gfortran --version || true
    echo "==== MPI ===="
    mpirun --version || true
    echo "==== BLAS/LAPACK/FFTW/ScaLAPACK/ELPA ===="
    pkg-config --list-all 2>/dev/null | grep -E 'fftw|elpa|scalapack' || true

    # 動作確認用サンプルを置く(/opt/samples)
    mkdir -p /opt/samples
    cat >/opt/samples/hello_f90.f90 <<'EOF'
program hello
  print *, "Hello, Fortran!"
end program hello
EOF

    cat >/opt/samples/hello_mpi.f90 <<'EOF'
program hello_mpi
  use mpi
  implicit none
  integer :: ierr, rank, size
  call MPI_Init(ierr)
  call MPI_Comm_rank(MPI_COMM_WORLD, rank, ierr)
  call MPI_Comm_size(MPI_COMM_WORLD, size, ierr)
  print *, "Hello from rank", rank, "of", size
  call MPI_Finalize(ierr)
end program hello_mpi
EOF
    # 簡易ビルドスクリプト
    cat >/opt/samples/build_test.sh <<'EOF'
#!/usr/bin/env bash
set -eux

workdir=$(mktemp -d -t smoketest.XXXXXX)
trap 'rm -rf "$workdir"' EXIT  # 終了時に必ず削除
echo "tmp: $workdir"

gfortran /opt/samples/hello_f90.f90 -o $workdir/hello_f90
mpifort /opt/samples/hello_mpi.f90 -o $workdir/hello_mpi
$workdir/hello_f90
mpirun --allow-run-as-root -np 2 $workdir/hello_mpi
EOF
    chmod +x /opt/samples/build_test.sh

%test
    set -eux
    # シリアル & MPI の両方の簡易テスト
    /opt/samples/build_test.sh

%help
    このコンテナは、Fortranベースの科学技術計算コード(特にQuantum ESPRESSO)を
    ビルド・実行するためのUbuntu 24.04環境です。
    主要ツール:
      - Compilers: gcc/gfortran, g++, make, cmake, ninja, pkg-config
      - MPI: OpenMPI (mpicc, mpifort など)
      - Math libs: OpenBLAS, LAPACK, FFTW3(+MPI), ScaLAPACK, ELPA
      - IO libs: HDF5(OpenMPI), NetCDF-C/-Fortran
    テスト:
      apptainer test <SIFファイル>
    例(コンパイル):
      apptainer exec <SIF> bash -lc 'mpifort file.f90 -O3 -o a.out'
    例(実行):
      apptainer exec --bind $PWD:$PWD --pwd $PWD <SIF> mpirun -np 8 ./a.out

%runscript
    # 既定ではバージョン一覧を表示
    echo "Fortran HPC build container (Ubuntu 24.04)"
    echo "Compilers:"
    gfortran --version | head -n1 || true
    echo "MPI:"
    mpirun --version | head -n1 || true
    echo "Try: apptainer exec $SINGULARITY_CONTAINER bash -lc '/opt/samples/build_test.sh'"

oneapi-hpckitでquantum espresso (QE) をビルドするレシピ

oneapi-hpckit_qe.def
Bootstrap: docker
From: intel/oneapi-hpckit:2025.1.1-0-devel-ubuntu22.04

%post
    apt-get update && apt-get install -y build-essential
    echo 'source /opt/intel/oneapi/setvars.sh' >> /environment
    echo 'source /opt/intel/oneapi/setvars.sh' >> /etc/profile.d/oneapi.sh


    # バージョンのログ
    echo "==== Compilers ===="
    icx --version || true
    ifx --version || true
    echo "==== MPI ===="
    mpiifx --version || true
    mpiicx --version || true
    mpirun --version || true
    echo "==== BLAS/LAPACK/FFTW/ScaLAPACK/ELPA ===="
    pkg-config --list-all 2>/dev/null | grep -E 'fftw|elpa|scalapack' || true

    # 取得する QE のバージョン(必要ならここを書き換え)
    QEV="qe-7.4.1"     # 例: qe-7.3 / qe-7.2 / qe-7.1 など
    SRC_DIR=/tmp/qe_src
    QE_HOME=/opt/qe
    mkdir -p ${SRC_DIR} ${QE_HOME}
    cd ${SRC_DIR}

    # ソース取得(GitHub の公式リリース tarball)
    wget -q https://github.com/QEF/q-e/archive/refs/tags/${QEV}.tar.gz
    tar xf ${QEV}.tar.gz
    cd q-e-${QEV}

    # 環境のヒント(OpenMPI/FFTW/ScaLAPACK/HDF5 を使う)
    # configure は自動検出を試みるので、まずは素直に通す
    ./configure \
        --prefix=${QE_HOME} \
        FC=mpiifx \
        CC=mpiicx \
        --with-scalapack=intel \
        --with-cuda=no \
        --enable-parallel \
        --with-mpi \
        --with-openmp

    # 代表的なパッケージをビルド(pw, ph, cp, pp など)
    make -j"$(nproc)" all
    make install

    # 便利スクリプト(バージョン表示)
    echo "${QEV}" > ${QE_HOME}/QE_VERSION.txt

    # 後片付け
    rm -rf ${SRC_DIR}

%environment
    source /opt/intel/oneapi/setvars.sh
    export QE_HOME=/opt/qe
    export PATH=$QE_HOME/bin:$PATH
    export OMP_NUM_THREADS=1
    export MKL_NUM_THREADS=1

%runscript
    echo "Intel oneAPI HPC Toolkit container is ready."
    exec "$@"
0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?