next up previous contents index
Next: 1.1.3 Creating working directory(作業ディレクトリーの作成) Up: 1.1 Outline of the Previous: 1.1.1 Decompression of the


1.1.2 Compilation of the source code(ソースコードのコンパイル)

To compile the source code, follow the Makefile and execute the compile processes in the directory where it exits.

ソースコードが格納されているディレクトリーに行き、Makefileに従って コンパイルを行なう。

%> cd source/

%> vi Makefile

In the Section 0 of the Makefile, you have to choose proper directory name. This is very important in case of sharing the disk by several machines. Otherwise default value is good enough. The operate target is assigned in the Section 1. With no problem in compiling processes, it is unnecessary to change default value.

ファイルMakefile中のSection 0の部分には、適当なディレクトリ名を指定する。 同じディスクから複数種類のマシンで計算する場合に重要となるが、通常は、既定値のままでよい。 Section 1の部分には、実行するターゲットを指定するが、コンパイルに問題が無い限り、既定のままでよい。

You must write the file name which includes the compilation flag, for example, Makein.mic in the Section 2 of the Makefile. This file defines variables of MAKEINFILE and is included by the include statement. This file depends on calculation environments, machines etc., thus you must choose proper one. If the compilation is executed in a new caluculation environment, it is necessary to create a new file which includes new compilation flags. In case of DEC machines(ES45), you should include the following file.

ファイルMakefile中のSection 2の部分にコンパイルフラグを記述したファイル名 (Makein.micなど)を指定する。このファイルは、MAKEINFILEの変数を定義しているものである。 このファイルをインクルード文でインクルードして使用している。計算環境や計算マシンによりインクルードされる ファイルが異なっているので既存の適切なものを選ぶかまたは新しい計算環境のときには新しくコンパイルフラグを 記述したファイルを作成する。DECマシン(ES45)の場合は、下記のファイルをインクルードすればよい。

%> vi Makein.mic

Confirm the compililation flags

コンパイルフラグを確認する。

%> make >& cmp.log &

If the above make command stops in orderly manner, the compilation is completed. Main program of the calculation code is the main.f. The default Makefile generates two execution calculation codes for both normal single calculation and parallel calcullation which employs MPI library. For single calculation, you must assign cpvos and others and not assign cpvop and otherp in the Section 1 of the Makefile.

上記のmakeコマンドが正常に終了して、コンパイル完了。計算コードのメインプログラムは、 main.fである。デフォルトのMakefileは、MPIライブラリーを用いた並列計算用と通常の シングル計算用の2種類の実行計算コードを両方作ることになっている。MPIライブラリーがない環境では、 MakefileSection 1の部分で、cpvosothersを指定し、 cpvopotherpを指定しないようにする。

If you want to return to the previous environment which compilation wasn't executed,

インストールした状態の環境で、コンパイルし直す環境に戻すには、

%> make cleanOBJALL cleanall

you should execute above command. However, it will delete all object files and module files which have compiled in the past.

とすればよい。ただし、これまでコンパイルしたオブジェクトファイルやモジュールファイルを全て消去することになる。


next up previous contents index
Next: 1.1.3 Creating working directory(作業ディレクトリーの作成) Up: 1.1 Outline of the Previous: 1.1.1 Decompression of the
Copyright (C), Tatsuki Oda (oda@cphys.s.kanazawa-u.ac.jp, Kanazawa University)