Salome HOME
Improved message display
[tools/solverlab.git] / CoreFlows / Documentation / install.dox
1 /*!
2 \page install Installation and use of CoreFlows 
3
4
5 CDMATH-CoreFlows is currently developped and maintained on Fedora and Ubuntu distributions.
6 CDMATH-CoreFlows relies on the numerical toolbox of the project [CDMATH]((http://cdmath.jimdo.com)) for the handling of meshes and fields, and on the library [PETSC](https://www.mcs.anl.gov/petsc/) for the handling of large sparse matrices.
7 You will need the packages  '\a cmake ', '\a gcc', '\a gfortran' and '\a hdf5', plus '\a doxygen' if you want to generate this documentation and '\a swig' if you want to use python scripts.
8
9 Download and compilation of CDMATH and PETSc
10 --------------------------------------------
11 CDMATH can be downloaded and compiled together with PETSc in a single process, thanks to the cmake option -DCDMATH_WITH_PETSC=ON.
12 First create and enter a working dir
13 \verbatim 
14  mkdir -p ~/workspace/cdmath
15  cd ~/workspace/cdmath
16 \endverbatim
17
18 In order to download the approriate branch of \ref cdmath either unzip the following file to a directory cdmath-master
19 \verbatim 
20  https://github.com/ndjinga/CDMATH/archive/master.zip
21 \endverbatim
22 or clone the git repository to a folder cdmath-master
23 \verbatim 
24 git clone https://github.com/ndjinga/CDMATH.git cdmath-master
25 \endverbatim 
26
27 In order to compile \ref cdmath you will need at least the libraries '\a cmake ', '\a gcc', '\a gfortran' , and '\a hdf5' plus optionally '\a swig' 'python-dev' and '\a numpy' if you intend to use \ref cdmath functions in your python scripts. 
28
29 Create build and install repositories:
30 \verbatim 
31  mkdir cdmath_build cdmath_install
32 \endverbatim
33
34 Enter the build directory
35 \verbatim 
36  cd cdmath_build
37 \endverbatim 
38
39 Then run the commands
40 \verbatim 
41  cmake ../cdmath-master/ -DCMAKE_INSTALL_PREFIX=../cdmath_install -DCMAKE_BUILD_TYPE=Release -DCDMATH_WITH_PYTHON=ON -DCDMATH_WITH_PETSC=ON
42  make
43  make install
44 \endverbatim 
45
46 By default, \ref cdmath will compile a new sequential installation of PETSc. If an installation of PETSc (version 3.4 or later) is already available in the system, it is possible to save time by first setting the environment variables PETSC_DIR and PETSC_ARCH to the appropriate values as can be found in petscconf.h, and then running the above cmake command.
47
48 Download and compilation of CoreFlows
49 ---------------------------------------------
50 First create and access a working directory :
51 \verbatim
52  mkdir -p ~/workspace/CDMATH-CoreFlows
53  cd ~/workspace/CDMATH-CoreFlows
54 \endverbatim
55
56 Now create build and install repositories:
57 \verbatim
58 mkdir CDMATH-CoreFlows_build CDMATH-CoreFlows_install
59 \endverbatim
60
61 In order to download CDMATH-CoreFlows either unzip the following file to a directory CDMATH-CoreFlows-master
62 \verbatim
63  https://github.com/ndjinga/CDMATH-CoreFlows/archive/master.zip
64 \endverbatim
65 or clone the git repository to a folder CDMATH-CoreFlows-master
66 \verbatim 
67 git clone https://github.com/ndjinga/CDMATH-CoreFlows.git CDMATH-CoreFlows-master
68 \endverbatim 
69 Either of these latter commands results in the creation of a directory `~/workspace/CDMATH-CoreFlows/CDMATH-CoreFlows-master`  containing the source files.
70
71 In the following steps we assume that 'PETSc' (version 3.4 or more recent) has been installed with 'CDMATH' with the process described above.
72 You need to set the following variables 
73 - `\a CDMATH_DIR`, the path to your CDMATH installation, for example  `~/workspace/cdmath/cdmath_install//share/petsc-3.8.3 `
74 - `\a PETSC_DIR`, the path to your PETSc installation. If PETSc was installed by CDMATH then PETSC_DIR can be defined as `~/workspace/cdmath/cdmath_install`
75 - `\a PETSC_ARCH`, the type of installation used (usually arch-linux2-c-opt or linux-gnu-c-opt)
76 In order to do so, it is sufficient to source the 'CDMATH' environment file. Type in your linux terminal
77 \verbatim
78 source ~/workspace/cdmath/cdmath_install/env_CDMATH.sh
79 \endverbatim
80 Go to the build directory
81 \verbatim
82 cd CDMATH-CoreFlows_build
83 \endverbatim
84
85 Then run the command
86 \verbatim
87 ../CDMATH-CoreFlows-master/configure  --prefix=../CDMATH-CoreFlows_install/ --with-petsc-dir=$PETSC_DIR --with-petsc-arch=$PETSC_ARCH --with-cdmath-dir=$CDMATH_DIR --with-python --with-doc
88 make doc install
89 \endverbatim
90 You can add the following optional commands
91 - `--with-gui`, if you want to use CDMATH-CoreFlows as a Salomé module (you will need to use a Salomé shell)
92 - `--with-debug`, if you want to use CDMATH-CoreFlows in debug mode instead of the default optimised mode
93
94 Use of CoreFlows
95 ----------------
96 First load CoreFlows environment from the CoreFlows_install directory
97 \verbatim
98 source CoreFlows_install/env_CoreFlows.sh
99 \endverbatim
100
101 - If you use C language: edit the file CoreFlows-master/main.cxx then in a terminal type
102 \verbatim
103 cd CoreFlows_build 
104 make -j
105 make install -j
106 \endverbatim
107 Then you can run the simulation in any directory with the command line
108 \verbatim
109 $CoreFlows
110 \endverbatim
111
112 - If you use python language: edit your own python file my_file.py following for example the pattern of the file CDMATH-CoreFlows-master/main.py. Then in a terminal type
113 \verbatim
114 python my_file.py
115 \endverbatim
116
117 - If you use the graphic interface, you need to run a Salomé Unix shell and type the command line
118 \verbatim
119 runSalome -mCOREFLOWS
120 \verbatim
121 then click on new study to open CoreFlows interface
122
123 */