#= INSTALL guide of deepconv/arare
#
# Authors:: SUGIYAMA Ko-ichiro, ODAKA Masatsugu
# Version:: $Id: INSTALL,v 1.15 2015/02/19 08:39:56 odakker Exp $
# Tag Name: $Name:  $
# Copyright:: Copyright (C) GFD Dennou Club, 2006. All rights reserved.
# License:: See COPYRIGHT[link:COPYRIGHT]
#
########################################################################
#
=begin JA

= deepconv/arare 󥹥ȡ

#*  ̰ϯ,  ,  ã
#  * 2011/12/06  () ǽ
#  * 2011/08/09  () ǽ
#  * 2011/06/14  (̰ϯ) ǽ
#  * 2011/03/02  ( ã) ǽ
#  * 2009/03/06  ( ã) ǽ
#  * 2008/01/17  ( ) ǽ
#  * 2007/10/19  ( ) ǽ
#  * 2006/10/30  ( ) ǽ
#  * 2006/09/29  ( ) ǽ
#  * 2006/09/20  ( ) ǽ
#  * 2006/09/12  ( ) ǽ
#  * 2006/03/16  ( ̰ϯ) ǽ
#  * 2005/04/26  ( ) ǽ
#  * 2005/04/22  ( ̰ϯ) ǽ
#  * 2005/04/19  ( ̰ϯ) 
#  * 2005/01/31  ( ) 

(1) ((<ưĶ>))
(2) ((<ѥɬפʥեȥ>))
(3) ((<ӥɤμ>))
(4) ((<ĥ꡼ʲμפʥեȥǥ쥯ȥ>))

=end JA

=begin EN

= Deepconv/arare installation guide

#* Ko-ichiro Sugiyama, Masatsugu Odaka, Tatsuya Yamashita
#  * 2011/12/06  (Masatsugu Odaka) Update
#  * 2011/08/09  (Masatsugu Odaka) Update
#  * 2011/06/14  (Ko-ichiro Sugiyama) Update
#  * 2011/03/02  (Tatsuya Yamashita) Update
#  * 2009/03/06  (Tatsuya Yamashita) Update
#  * 2007/10/19  (Masatsugu Odaka) Update
#  * 2006/10/30  (Masatsugu Odaka) Update
#  * 2006/09/29  (Masatsugu Odaka) Update
#  * 2006/09/20  (Masatsugu Odaka) Update
#  * 2006/09/12  (Masatsugu Odaka) Update
#  * 2006/03/16  (Ko-ichiro Sugiyama) Update
#  * 2005/04/26  (Masatsugu Odaka) Update
#  * 2005/04/22  (Ko-ichiro Sugiyama) Update
#  * 2005/04/19  (Ko-ichiro Sugiyama) Update
#  * 2005/01/31  (Masatsugu Odaka) Initial release

(1) ((<Operation Environment>))
(2) ((<Required Softwares>))
(3) ((<How to Build>))
(4) ((<Major files and directories in source tree>))


=end EN

=begin JA

== ưĶ

2014 ǯ 02  17 , ʲδĶǤưǧƤޤ.

 * Debian GNU/Linux 7.0 (squuze) + gfortran + LAPACK 
 * Debian GNU/Linux 7.0 (squuze) + intel fortran + LAPACK 
 * Debian GNU/Linux 7.0 (squuze) + PGI fortran + LAPACK 
 * CRAY XC30 + CRAY fortran 

((<ĤΥѥ˴ؤս|URL:./doc/tutorial/compiler_note.htm>)) ⻲Ȳ. ¾ΥѥˤĤƤƤϤޤ礬뤫⤷ޤΤ, ưåޤԤʤˤϤɤ.

=end JA

=begin EN

== Operation Environment

This program is operated by following compilers.

 * Debian GNU/Linux 7.0 (squuze) + gfortran + LAPACK 
 * Debian GNU/Linux 7.0 (squuze) + intel fortran + LAPACK 
 * Debian GNU/Linux 7.0 (squuze) + PGI fortran + LAPACK 
 * CRAY XC30 + CRAY fortran 

((<Notes about some compilers|URL:./doc/tutorial/compiler_note.htm.en>)) that are done the operation check or have done are as follows. Read it through if the following operation check doesn't go well, because it is likely to apply about other compilers.



=end EN

=begin JA
== ѥɬפʥեȥ

deepconv/arare ӥɤȼ¹ԤˤϰʲΥեȥ˥󥹥ȡ
Ƥɬפޤ. 

: ((<netCDF|URL:http://www.unidata.ucar.edu/software/netcdf/>)) (С 3.6.x)

* Debian GNU/Linux (use binary packages)  
  * Debian GNU/Linux ѤƤ, ХʥѥåѤ, ((<ϵήǾDebianѥå|URL:http://www.gfd-dennou.org/library/cc-env/debian-dennou/>)) 򻲾Ȥƥ󥹥ȡ뤷Ƥ. 

* ӥɤ
  * ((<3.6.3  TGZ|URL:http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-3.6.3.tar.gz>))
  
: ((<gtool5 饤֥|URL:http://www.gfd-dennou.org/library/gtool/>))

* Debian GNU/Linux (use binary packages)  
  * Debian GNU/Linux ѤƤ, ХʥѥåѤ, ((<ϵήǾDebianѥå|URL:http://www.gfd-dennou.org/library/cc-env/debian-dennou/>)) 򻲾Ȥƥ󥹥ȡ뤷Ƥ. 

* 饳ѥ뤹
  * ((<gtool5 TGZ|URL:http://www.gfd-dennou.org/library/gtool/gtool5/gtool5_current.tgz>))
    [((<󥹥ȡ륬|URL:http://www.gfd-dennou.org/library/gtool/gtool5/gtool5_current/INSTALL.htm>))]

: LAPACK/BLAS

* Debian GNU/Linux (use binary packages)  
  * Debian GNU/Linux ѤƤ, ХʥѥåѤ, libblas-dev, liblapack-dev ѥå򥤥󥹥ȡ뤷Ʋ. 

* 饳ѥ뤹
  * ((<LAPACK  TGZ|URL:http://www.netlib.org/lapack/>)) 
  * ((<BLAS  TGZ|URL:http://www.netlib.org/blas/>)) 

: MPI 饤֥

* MPI Ѥ׻Ԥˤ, MPI 饤֥򥤥󥹥ȡ뤷Ƥ.

=== ȯԤˤȤäɬפʥեȥ

ɤԽ, 
ɥȤ뤿ˤϰʲ
եȥ˥󥹥ȡ뤷Ƥɬפޤ. 
(tar.gz ѥåˤϴ˥ɥȤƱƤޤ)

* ɤԽ
  * ((<Ruby|URL:http://www.ruby-lang.org/>))
  * ((<Rsed.rb (Recursive Sed with Ruby)|URL:http://www.ep.sci.hokudai.ac.jp/~michi/pc/ruby/script-02.html>))
    (tar.gz ѥåƱѤ)

* ɥ
  * ̤ HTML ڡ
    (: ܥڡ, ((<dcpam5 ɥ|URL:doc/index.htm>)),
    ((<餯 dcpam5|URL:doc/gokuraku/index.htm>)),
    ((<餯餯 dcpam5|URL:doc/rakuraku/rakuraku.pdf>)))
    * ((<rdtool|URL:http://raa.ruby-lang.org/project/rdtool/>))
    * ((<rd2latex|URL:http://shugo.net/archive/rd2latex/>))
      (tar.gz ѥåƱѤ)
  * ƥ⥸塼Υե󥹥ޥ˥奢
    * ((<"RDoc Fortran90/95 ɲϵǽ"|URL:http://www.gfd-dennou.org/library/dcmodel>))
  * ϤȤΥ, ƳФ˴ؤ뻲ͻ 
    * ((<LaTeX|URL:http://www.latex-project.org/>))
      * ե: ((<Dennou6 style|URL:http://www.gfd-dennou.org/library/cc-env/TeXmacro/dennou/SIGEN.htm>))
    * ((<latex2html ܸѥå, Dennou6 style ѥå򤢤Ƥ|URL:http://www.gfd-dennou.org/library/cc-env/latex2html/SIGEN.htm>))

=end JA

=begin EN

== Required Softwares

: ((<netCDF|URL:http://www.unidata.ucar.edu/software/netcdf/>)) (version 3.6.x)

* Debian GNU/Linux (use binary packages)
  * If you use Debian GNU/Linux and use binary package of netCDF, see ((<here|URL:http://www.gfd-dennou.org/library/cc-env/debian-dennou/index.htm.en>)) and install it. 

* Building from source codes
  * ((<Version 3.6.3 TGZ|URL:http://www.gfd-dennou.org/library/netcdf/unidata-mirror/netcdf-3.6.3.tar.gz>)),
 
: ((<gtool5|URL:http://www.gfd-dennou.org/library/gtool/>))

* Debian GNU/Linux (use binary packages)
  * If you use Debian GNU/Linux and use binary package of netCDF, see ((<here|URL:http://www.gfd-dennou.org/library/spmodel/debian/needed.htm.en>)) and install it. 

* Building from source codes
  * ((<TGZ file|URL:http://www.gfd-dennou.org/library/gtool/gtool5/gtool5_current.tgz>))
    [((<Installation Guide|URL:http://www.gfd-dennou.org/library/gtool/gtool5/gtool5_current/INSTALL.htm.en>))]

: LAPACK/BLAS

* Debian GNU/Linux (use binary packages)
  * Please install "libblas-dev" and "liblapack-dev" packages

* Building from source codes
  * ((<TGZ file of LAPACK|URL:http://www.netlib.org/lapack/>)) 
  * ((<TGZ file of BLAS |URL:http://www.netlib.org/blas/>)) 

: MPI library

* If you perform parallel computing by using the MPI, install MPI library.

=== Software Requirements for developers

Following softwares should be installed
for modification of source code and generation of documents.
(But if you get tar.gz package, documentations are already generated).

* Modification of source code
  * ((<Ruby|URL:http://www.ruby-lang.org/>))
  * ((<Rsed.rb: Recursive Sed with Ruby (in Japanese)|URL:http://www.ep.sci.hokudai.ac.jp/~michi/pc/ruby/script-02.html>))
    (This is bundled in the tar.gz package)

* generation of documents
  * Individual HTML pages
    (Examples: This page, ((<dcpam5 Documents|URL:doc/index.htm.en>)),
    ((<GOKURAKU dcpam5|URL:doc/gokuraku/index.htm.en>)),
    ((<RAKURAKU dcpam5|URL:doc/rakuraku/rakuraku.pdf>)))
    * ((<rdtool|URL:http://raa.ruby-lang.org/project/rdtool/>))
    * ((<rd2latex|URL:http://shugo.net/archive/rd2latex/>))
      (This is bundled in the tar.gz package)
  * Reference Manual of modules
    * ((<"Enhanced version of RDoc Fortran90/95 parser"|URL:http://www.gfd-dennou.org/library/dcmodel>))
  * The governing equations and basic_equations, References for derivation
    * ((<LaTeX|URL:http://www.latex-project.org/>))
      * Style file: ((<Dennou6 style (Japanese only)|URL:http://www.gfd-dennou.org/library/cc-env/TeXmacro/dennou/SIGEN.htm>))
    * ((<latex2html_jp+dennou (Japanese only)|URL:http://www.gfd-dennou.org/library/cc-env/latex2html/SIGEN.htm>))

=end EN

=begin JA

== ӥɤμ

=== 

wget ʤɤǥ

  $ wget http://www.gfd-dennou.org/library/deepconv/arare/arare5_current.tgz

=== tgz եŸ, ǥ쥯ȥؤΰư

  $ tar -xzvf arare5_current.tgz
  $ cd arare5-YYYYMMDD


=== Ķѿ

ѥꤹ. 

  $ export FC=(ѥ̾)


=== Config.mk κ

Ÿ줿ǥ쥯ȥ˰ư, (({ ./configure }))¹Ԥޤ.
((<ѥɬפʥ饤֥>))ǥ󥹥ȡ뤷ƥ饤֥
ʲΥץ˻ꤹɬפޤ.

:(({--with-netcdf=}))((|ARG|))
  netcdf 饤֥ (*.a) Υե̾.

:(({--with-gtool5=}))((|ARG|))
  gtool5 饤֥ (*.a) Υե̾.

:(({--with-lapack=}))((|ARG|))
  lapack 饤֥ (*.a) Υե̾.

:(({--with-blas=}))((|ARG|))
  blas 饤֥ (*.a) Υե̾.

:(({--with-mpi}))
  MPI Ѥ󲽤Ԥ

㤨аʲΤ褦˻ꤷޤ.
Υޥɤˤä (({ Config.mk })) ե뤬ޤ.

  $ ./configure \
    --with-netcdf=(netCDF 饤֥եХѥ) \	
    --with-gtool5=(gtool5 饤֥եХѥ) \
    --with-lapack=(LAPACK 饤֥եХѥ) \
    --with-blas=(BLAS 饤֥եХѥ) 

󲽤Ԥ, 

  $ ./configure \
    --with-netcdf=(netCDF 饤֥եХѥ) \	
    --with-gtool5=(gtool5 饤֥եХѥ) \
    --with-lapack=(LAPACK 饤֥եХѥ) \
    --with-blas=(BLAS 饤֥եХѥ) \
    --with-mpi

ӥɤˤ GNU make ɬפȤʤ뤿, configure  PATH ⤫
ư GNU make õ褦Ȥޤ, ⤷Ĥʤ,
顼֤ޤ. ξˤϴĶѿ ((* MAKE *)) 
GNU make ޥɤꤷƺ configure ¹ԤƤ.


: Debian package ѤƤ

gfortran, netcdf, gtool5  Debian package Ѥˤ, ʲΤ褦 configure ¹ԤɤǤ.

    $ export FC=gt5frt 
    $ ./configure


=== Config.mk Խ

嵭 configure ˤä, Ū꤬Ҥ줿
(({ Config.mk })) ե뤬ޤ. 
, ĶˤäƤ configure ΤߤǤԽʬʾ⤢뤿,
ɬפ˱ Config.mk ưԽƲ. 

#(({ MPI Ѥ׻Ԥˤ, CPPFLAGS = -DLIB_MPI ԽƲ }))

ʲ˼פܤ󤲤ޤ. 

:FC
  Fortran ѥ

:CPPFLAGS
  ץץΤΥե饰. MPI Ѥ, CPPFLAGS = -DLIB_MPI Ȥ. 

:SYSFFLAGS
  ѥ󥯻ɬפʥե饰
  (Fortran ѥ¹Իɬפʥץ)
  ư黻٤ݾڤ뤿ΥץɬդƲ
  (pgfortran => -Kieee, ifort => -fp-model strict -prec-div). 

:SYSLDFLAGS
  󥯻ɬפʥե饰

:SYSLDLIBS
  󥯻ɬפʥ饤֥

:prefix
  deepconv Υ饤֥, ⥸塼, ¹ԥե,
  ɥȤΥ󥹥ȡǥ쥯ȥ

:MAKE
  GNU make ޥ

:AR
  ֥ޥ

:ARFLAGS
  ֻɬפʥե饰

:RANLIB
  ֤Υǥå륳ޥ

=== Υѥ

ѥ GNU make ѤƹԤ. ĥ꡼ľ

        $ make

¹ԤȥľΰʲΥǥ쥯ȥ˼¹ԥեȥ饤֥,
⥸塼ե뤬Ÿ.

	./lib		饤֥ libarare.a Ǽ
	./main		¹ԥե뤬Ǽ
	./include	Ƽ *.mod ե뤬Ǽ

main ʲˤϼμ¹ԥե뤬Ǽ.

	arare           ήǥ
	arare_init-data ͥեѼ¹ԥե

ɥȤ򥳥ѥ뤹ˤϰʲΥޥɤ¹ԤƲ. 

	$ make doc  


=end JA
=begin EN

== How to Build

=== Download source code.

Download source code by using wget command, and so on.

  $ wget http://www.gfd-dennou.org/library/deepconv/arare/arare5_current.tgz

=== Unpack tgz file and go to source tree directory.

  $ tar -xzvf arare5_current.tgz
  $ cd arare5-YYYYMMDD

=== Setting of environment variable

Set an environment variable of a compiler.

  $ export FC=(compiler name)

=== Create Config.mk 

Move created directroy, and excute `(({ ./configure }))'.

Specify library files in ((<Libraries needed for compile>)) to
following options.

:(({--with-netcdf=}))((|ARG|))
  netcdf library filename (*.a)

:(({--with-gtool5=}))((|ARG|))
  gtool5 library filename (*.a)

:(({--with-lapack=}))((|ARG|))
  lapack library filename (*.a)

:(({--with-blas=}))((|ARG|))
  blas library filename (*.a)

:(({--with-mpi}))
  using MPI


For exapmle, specify as follow. This command will generate
(({ Config.mk })). 

   $ ./configure \
      --with-netcdf=(netCDF library file) \	
      --with-gtool5=(gtool5 library file) \
      --with-lapack=(LAPACK library file) \
      --with-blas=(BLAS library file) 

If you use MPI, then, 

   $ ./configure \
      --with-netcdf=(netCDF library file) \	
      --with-gtool5=(gtool5 library file) \
      --with-lapack=(LAPACK library file) \
      --with-blas=(BLAS library file)  \
      --with-mpi

GNU make is needed to build, so configure automatically inquires
into GNU make in PATH. However, it returns error when GNU make is
not found. In that case, please set the GNU make command for
environment variable ((* MAKE *)). And rerun execute `(({ ./configure }))'


:Debian packages

If using Debian package, please specify as follow. 

   $ export FC=gfortran
   $ ./configure


=== Edit `Config.mk'

A file '(({ Config.mk }))' in which elemental settings are written
is created by above "configure". 
However, the settings may be insufficient by "configure" in some environments.
In that case, edit '(({ Config.mk }))' manually according to need. 

#(({ If you use MPI, please edit Config.mk as CPPFLAGS = LIB_MPI }))

Followings are main items.

:FC
  Fortran compiler

:CPPFLAGS
  Flags needed for PreProcessor. 
  If using MPI, CPPFLAGS = LIB_MPI.

:SYSFFLAGS
  Flags needed when compiled and linked
  (we recommend following option; pgfortran => -Kieee, ifort => -fp-model strict -prec-div). 

:SYSLDFLAGS
  Flags needed when linked

:SYSLDLIBS
  Libraries needed when linked

:prefix
  Directory where deepconv library, modules, executable files, 
  and documentations are installed

:MAKE
  GNU make command

:AR
  Archive command

:ARFLAGS
  Flag of Archive command

:RANLIB
  Generate index to archive command


=== Compile

Execute "make" command at the top directory of source tree.

	$ make 
  

Execute "make doc" at the top directory of source tree to build
installation guide, code reference and tutorial.

	$ make doc  

=end EN

=begin JA
== 󥤥󥹥ȡμ

src ǥ쥯ȥʲΥ֥ȥե, ¹ԥեξõ

	$ make clean

Ȥ.

ǥΥǥ, 󥹥ȡμ, 
Ѥμȥɥե󥹤ξõ

	$ make clean.doc

Ȥ. 

	$ make clean.all

Ȥ, 嵭Τ٤Ƥ Config.mk ե뤬õ.

=end JA
=begin EN
== Uninstall

Execute "make clean" to remove binary files.

	$ make clean

Execute "make doc" at the top directory of source tree to remove
installation guide, code reference and tutorial.

	$ make clean.doc

All of them and Config.mk are removed by "make clean.all". 

	$ make clean.all

=end EN


