install-wrf-open64

LinuxにWRFをインストール with AMD open64 ( 2011/05/08 編集 )

    • AMD x86 open64 Compiler Suite のインストール

    • mpichのインストール

    • jasperのインストール

    • netcdfのインストール

    • WRFのコンパイル

    • WPSのコンパイル

動作確認済み環境 (1ノードあたりスペック)

パターン 1

OS:CentOS5.6 (x86_64)

memory:16GB

CPU:AMD Opteron HE4170

AMD x86 open64 Compiler Suite

NetCDF 3.6.3

MPICH2-1.2

Jasper 1.701.0

WRF ver.3.1.1

WPS ver.3.1.1

AMD x86 open64 Compiler Suite のインストール

http://developer.amd.com/cpu/open64/Pages/default.aspx#four

    • 参考URL:

    • http://blog.livedoor.jp/rootan2007/archives/51587976.html

MPICH2 のインストール

http://www.mcs.anl.gov/research/projects/mpich2/downloads/tarballs/

$ tar -zxvf mpich2-1.2.tar.gz

$ cd mpich2-1.2

$ emacs mpich2-1.2-install.sh

-- ここから下をファイルに保存する --

#!/bin/sh

export CC=opencc

export CXX=openCC

export FC=openf90

export F77=openf90

export CFLAGS=-O3

export FCFLAGS=-O3

export FFLAGS=-O3

./configure --prefix=/usr/local/mpich2-1.2-open64 --enable-debuginfo --with-device=ch3:nemesis

-- ファイルの記入はここまで --

$ chmod 744 mpich2-1.2-install.sh

$ ./mpich2-1.2-install.sh

$ make

$ su

# make install

# exit

    • 参考URL:

    • http://developer.amd.com/cpu/open64/AppsAndLibraries/Documents/building_mpich.html

    • http://blog.livedoor.jp/rootan2007/archives/51603709.html

jasper のインストール

http://www.mmm.ucar.edu/wrf/src/wps_files/jasper-1.701.0.tar.gz

$ tar -zxvf jasper-1.701.0.tar.gz

$ cd jasper-1.701.0

$ emacs jasper-1.701.0install.sh

-- ここから下をファイルに保存する --

#!/bin/sh

export CC=opencc

export CXX=openCC

export FC=openf90

export F77=openf90

export F90=openf90

./configure --prefix=/usr/local/jasper-1.701.0-open64

-- ファイルの記入はここまで --

$ chmod 744 jasper-1.701.0install.sh

$ ./jasper-1.701.0install.sh

$ make

$ su

# make install

NetCDF のインストール

http://www.unidata.ucar.edu/downloads/netcdf/index.jsp

$ tar -zxvf netcdf-3.6.3.tar.gz

$ cd netcdf-3.6.3

$ emacs netcdf-3.6.3-install.sh

-- ここから下をファイルに保存する --

#!/bin/sh

export CC=opencc

export CXX='openCC -O3'

export CFLAGS='-O3 -static'

export F77=openf90

export F90=openf90

export F95=openf95

export FFLAGS='-O3 -static'

./configure --prefix=/usr/local/netcdf-3.6.3-open64

-- ファイルの記入はここまで --

$ chmod 744 netcdf-3.6.3-install.sh

$ ./netcdf-3.6.3-install.sh

$ make

$ make check

$ su

# make install

    • 参考URL:

    • http://blog.livedoor.jp/rootan2007/archives/51603709.html

    • http://developer.amd.com/cpu/open64/AppsAndLibraries/Documents/building_netcdf.html

WRF のコンパイル

http://www.mmm.ucar.edu/wrf/users/download/get_sources.html

ここからが重要です.

confiture 時に open64 用のコンパイルオプションはないので,

とりあえず, gcc gfortran を使用した, dmper を選択します. (WRFV3.1.1なら13番)

次に, 以下のようにコンパイルフラグを修正します.

(before)

SFC = gfortran

SCC = gcc

FCOPTIM = -O3 -ftree-vectorize -ftree-loop-linear -funroll-loops

FORMAT_FIXED = -ffixed-form

FORMAT_FIXED = -fixedform

BYTESWAPIO = -fconvert=big-endian -frecord-marker=4

(after)

SFC = openf90

SCC = opencc

FCOPTIM = -O3 -LNO:vintr=2 -LNO:simd=2 -LNO:vintr_verbose=ON

FORMAT_FREE = -ffree-form -ffree-line-length-none

FORMAT_FREE = -freeform

BYTESWAPIO = -convert big_endian

コンパイル時のエラー集:

wrf_io.f:8250: undefined reference to `bitwise_or__'

module_internal_header_util.f90:854: undefined reference to `int_gen_ti_header_c__'

=> diffwrf のコンパイル時に make がこける.

メモ1:

最後に, wrf.exe, 等をコンパイルするときだけこけてる.

エラーは全て ’undefined reference to’ 〜 なので静的ライブラリの順番がまずいだけだと思う.

Makefileの書き換えもしくは, コンパイルフラグの調整が必要?

メモ2:

ついに原因が判明.

open64 が module 群を作成するとき, hogehoge.mod ではなく, HOGEHOHE.MOD というように

「大文字」で出力してしまう.

つまり module をリンクしてコンパイルするときに, 本来リンクするmoduleとはちがうものと認識して

make に失敗する, ということだとおもう.