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?

The Elk Codeビルドの備忘録

Last updated at Posted at 2019-03-22

Elkの概要

The Elk Code
LAPW基底を使った固体の第一原理計算コード。

GCC-4.8.5を使ったElk-4.3.6 のビルド(MPI, libxcのリンクは無し)

Elkは基本的にMakefileを使ったビルド。
elk-4.3.6.tgzを解凍する。

./setup

で、選択肢が表れるので適宜数字を入力。
すると、同じディレクトリにあるmake.incに適切な設定が書き込まれる。
ここで、

make all

で、ひとまず実行可能なファイルが${elk_HOME)/src/elkとして出来る。

この手続きでは、$(elk_HOME)以下にあるBLAS/LAPACKのコード群をビルドしてリンクしている。
従って、システムに入っているBLAS/LAPACKはリンクされていない。

適切なBLAS/LAPACKをリンクしたい場合は、make.incを編集する必要がある。
MPIを使いたい場合や、libxcをリンクしたい場合も適宜make.incを編集する必要がある。

oneAPI-hpckit 2025.1.0を使ったElk-10.4.9のビルド(libxcのリンクは無し)

2025/5/6時点での最新版のElk-10.4.9をwgetで落としてtar -zxvfで展開して、GNU makeでビルドする方法をまとめる。前提として、oneAPI-hpckitが入っている状態を念頭に置く。(例えば Intel oneAPIを一般ユーザー権限で入れる #oneAPI - Qiitaを確認)

まず、Elk - Browse Files at SourceForge.netから最新版ソースをダウンロードする。「Download Latest Version」の緑のボタンのURLを「リンクをコピー」でゲットして、

wget https://sourceforge.net/projects/elk/files/latest/download

とすると、その時点での最新版(2025/5/6現在ではElk-10.4.9)のtarballがダウンロードされる。このとき、ダウンロードされるファイル名がdownloadになっているので要注意。

拡張子もないが、これを

tar -zxvf ./download

をすると、きちんとelk-10.4.9なるフォルダが現れるので問題無し。
$ELK_ROOT/src内のmake.incがデフォルトでは、Intel Fortran compiler classic (ifort) version 18 and later.がアクティヴになっているので、それをコメントアウトして、Intel Fortran LLVM-based compiler (ifx).の項目がアクティブになるように変更:

$ELK_ROOT/src/make.inc(抜粋)
#-------------------------------------------------------------------------------
# Intel Fortran LLVM-based compiler (ifx).
F90 = mpiifx
F90_OPTS = -O3 -xHost -ipo -qopenmp -qmkl=parallel
F90_LIB = -liomp5 -lpthread -lm -ldl
SRC_MKL =
AR = xiar
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
# Intel Fortran compiler classic (ifort) version 18 and later.
#F90 = mpiifort
#F90_OPTS = -O3 -xHost -ipo -qopenmp -mkl=parallel
#F90_LIB = -liomp5 -lpthread -lm -ldl
#SRC_MKL =
#AR = xiar
#-------------------------------------------------------------------------------

これでMakefileがあるディレクトリでmakeでビルド完了。該当ファイルは$ELK_ROOT/src/elk

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?