数値計算ライブラリ:itensor:プログラムのメイク
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
数値計算ライブラリ:itensor:プログラムのメイク [2017/06/14 00:21] – koudai | 数値計算ライブラリ:itensor:プログラムのメイク [2021/07/05 15:57] (current) – koudai | ||
---|---|---|---|
Line 2: | Line 2: | ||
Makefileにこれらオプションをまとめておくと便利である。 | Makefileにこれらオプションをまとめておくと便利である。 | ||
+ | ソースコードのファイル名が例えばheisenberg_chain.ccとする。 | ||
次のようなMakefileを作成する。 | 次のようなMakefileを作成する。 | ||
- | <sxh; first-line: 1; highlight: [6]; title: | + | <file make Makefile> |
+ | APP=heisenberg_chain | ||
LIBRARY_DIR=/ | LIBRARY_DIR=/ | ||
- | |||
- | ifdef app | ||
- | APP=$(app) | ||
- | else | ||
- | APP=main | ||
- | endif | ||
CCFILES=$(APP).cc | CCFILES=$(APP).cc | ||
Line 54: | Line 50: | ||
mkdebugdir: | mkdebugdir: | ||
mkdir -p .debug_objs | mkdir -p .debug_objs | ||
- | </sxh> | + | </file> |
プログラムのコンパイルと実行は、ソースコードとMakefileのあるディレクトリに入って次のようにする。 | プログラムのコンパイルと実行は、ソースコードとMakefileのあるディレクトリに入って次のようにする。 | ||
- | もし、ソースコードのファイル名が例えばheisenberg_chain.ccならば | + | < |
+ | $ make | ||
+ | $ ./ | ||
+ | </ | ||
+ | |||
+ | デバッグモードの場合は | ||
+ | < | ||
+ | $ make debug | ||
+ | </ | ||
- | > \$ make heisenberg_chain | + | コンパイルで生成したファイルを消したい場合は |
- | > \$ ./heisenberg_chain | + | <code> |
+ | $ make clean | ||
+ | </code> | ||
- | 上のMakefileでは、もし単に make とだけ入力すれば main.cc をコンパイルするようにした。 |
数値計算ライブラリ/itensor/プログラムのメイク.1497367268.txt.gz · Last modified: 2021/06/27 21:57 (external edit)