1 | <HTML> |
---|
2 | <HEAD> |
---|
3 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8"/> |
---|
4 | <LINK REL="stylesheet" TYPE="text/css" HREF="PyNCplot.css"/> |
---|
5 | </HEAD> |
---|
6 | |
---|
7 | <!--BODY STYLE="color:rgb(240,240,240);font-size:1em;"--> |
---|
8 | <BODY CLASS="genintro"> |
---|
9 | <H1>Installation guide</H1> |
---|
10 | A step-by-step instructions to follow in order to install all the required packages and tools. <BR> |
---|
11 | |
---|
12 | Example of installation in a Debian 8 as root: |
---|
13 | <OL> |
---|
14 | <LI>as root</LI> |
---|
15 | <DIV CLASS="codetxt">$ su</DIV> |
---|
16 | <LI>install subversion, version control packages</LI> |
---|
17 | <DIV CLASS="codetxt"># apt-get install subversion</DIV> |
---|
18 | <LI>install GIT, different paradigm version control</LI> |
---|
19 | <DIV CLASS="codetxt"># apt-get install git</DIV> |
---|
20 | |
---|
21 | <LI>get python and its necessary applications</LI> |
---|
22 | <DIV CLASS="codetxt"># apt-get install python python-scipy python-numpy cython cython-dbg</DIV> |
---|
23 | |
---|
24 | <LI>get netcdf libraries tools and applications (cdo and nco are also installed maybe not required...)</LI> |
---|
25 | <DIV CLASS="codetxt"># apt-get install netcdf-bin netcdf-dbg libnetcdf-dev netcdf-doc libnetcdff-dbg libnetcdff-dev libnetcdff-doc ncview cdo nco</DIV> |
---|
26 | |
---|
27 | <LI>get hdf5</LI> |
---|
28 | <DIV CLASS="codetxt"># apt-get install libhdf5-dev</DIV> |
---|
29 | |
---|
30 | <LI>install matplotlib and basemap in order to plot and drow maps</LI> |
---|
31 | <DIV CLASS="codetxt"># apt-get install python-matplotlib python-matplotlib-data python-matplotlib-doc python-mpltoolkits.basemap python-mpltoolkits.basemap-data</DIV> |
---|
32 | |
---|
33 | <LI>install system tools (Scripts use L<SUP>A</SUP>T<SUB>E</SUB>X interface for titles and labels)</LI> |
---|
34 | <DIV CLASS="codetxt"># apt-get install dvipng</DIV> |
---|
35 | |
---|
36 | <LI>install <A CLASS="la" HREF="http://unidata.github.io/netcdf4-python/">netcdf4</A>, python API interface to netCDF files</LI> |
---|
37 | <OL> |
---|
38 | <LI> Some new linux distributions (at least Debian >8) provide the netcdf4 API in the package systems:</LI> |
---|
39 | <DIV CLASS="codetxt"># apt-get install python-netcdf4</DIV> |
---|
40 | <LI> Otherwise, it can be manually done. Be careful with interferences with anaconda (some issues on mixture of netcdf libraries have been detected). Make sure, that if you use anaconda, that the netcdf libraries installed are with netcdf4 capabilities. |
---|
41 | <UL> |
---|
42 | <LI>Following <A CLASS="la" HREF="https://github.com/Unidata/netcdf4-python" TARGET="_blank">https://github.com/Unidata/netcdf4-python</A>)</LI> |
---|
43 | <DIV CLASS="codetxt"># git clone https://github.com/Unidata/netcdf4-python.git<BR> |
---|
44 | cd netcdf4-python/</DIV> |
---|
45 | <LI>Editing `setup.cfg' to add/change some values (there are installation issues if `nc-config' is used along installation)</LI> |
---|
46 | <PRE><CODE> |
---|
47 | use_ncconfig=False |
---|
48 | netCDF4_dir = /usr/local |
---|
49 | HDF5_dir = /usr/local |
---|
50 | HDF5_libdir = /usr/lib/x86_64-linux-gnu/hdf5/serial |
---|
51 | HDF5_INCDIR = /usr/include/hdf5/serial |
---|
52 | </CODE></PRE> |
---|
53 | <DIV CLASS="codetxt"> |
---|
54 | # python setup.py build >& run_pysetup.log<BR> |
---|
55 | # python setup.py install >& run_pyinstall.log</DIV> |
---|
56 | </UL> |
---|
57 | </OL> |
---|
58 | <LI>Getting the scripts, no need to be root:</LI> |
---|
59 | <DIV CLASS="codetxt"># exit<BR> |
---|
60 | $ cd $HOME <BR> |
---|
61 | $ svn co http://svn.lmd.jussieu.fr/LMDZ_WRF/trunk/tools PyNCplot</DIV> |
---|
62 | <LI>Now all the scripts are held in ${HOME}/PyNCplot. It might be desirable to set an environment variable to make life easier: |
---|
63 | <DIV CLASS="codetxt">$ export pyHOME=${HOME}/PyNCplot</DIV> |
---|
64 | <LI>Finally one need to compile the Fortran modules using the same python to run the scripts. This is done using a standard `Makefile' and the tool <A CLASS="la" HREF="https://docs.scipy.org/doc/numpy-dev/f2py/" TARGET="_blank">f2py</A> to link Fortran compiled codes to python. There are different versions for: different CIMA's machines, different LMD/IPSL and French HPC machines. For a standard linux 64-bits machine (debain 9 with gcc compilers) there is one example as `Makefile.llamp'. Take one and specify a series of different variables specifically for the given machine |
---|
65 | <DIV CLASS="largecodetxt"> |
---|
66 | FC = gfortran # Fortran compiler<BR> |
---|
67 | F2PY = /usr/bin/f2py # Path to the f2py tool<BR> |
---|
68 | F2PYF = # Fortran compiler (when system's one is not used)<BR> |
---|
69 | NCLIBFOLD = /usr/lib/x86_64-linux-gnu # Path to netcdf libraries<BR> |
---|
70 | NCINCFOLD = /usr/include # Path to netcdf includes<BR> |
---|
71 | NCLIBFFOLD = /usr/lib/x86_64-linux-gnu # Path to netcdf-fortran interface libraries<BR> |
---|
72 | NCINCFFOLD = /usr/include # Path to netcdf-fortran interface includes<BR> |
---|
73 | </DIV> |
---|
74 | <LI><B>NOTE:</B> One will not be able to compile all the set of programs within an anaconda environment due to problems with anaconda. Installation of netcdf4 colides with installed <A CLASS="la" HREF="https://anaconda.org/matthewharrison/libnetcdff" TARGET="_blank">libnetcdff</A>. When installing it:</LI> |
---|
75 | <DIV CLASS="largecodetxt"> |
---|
76 | $ conda install netcdf4 <BR> |
---|
77 | (...) <BR> |
---|
78 | - netcdf4<BR> |
---|
79 | The following packages will be downloaded:<BR> |
---|
80 | <BR> |
---|
81 | package | build<BR> |
---|
82 | ---------------------------|-----------------<BR> |
---|
83 | libnetcdf-4.6.1 | h10edf3e_2 1.3 MB<BR> |
---|
84 | <BR> |
---|
85 | The following NEW packages will be INSTALLED:<BR> |
---|
86 | <BR> |
---|
87 | netcdf4: 1.4.2-py27h4b4f87f_0 <BR> |
---|
88 | <BR> |
---|
89 | The following packages will be REMOVED:<BR> |
---|
90 | <BR> |
---|
91 | libnetcdff: 4.4.4-0 matthewharrison<BR> |
---|
92 | <BR> |
---|
93 | The following packages will be UPDATED:<BR> |
---|
94 | <BR> |
---|
95 | libnetcdf: 4.4.0-hf6ef953_0 matthewharrison --> 4.6.1-h10edf3e_2 |
---|
96 | </DIV> |
---|
97 | <LI> Because of that, Makefile is split in two compilation sub-sets |
---|
98 | <DIV CLASS="codetxt"> |
---|
99 | $ make pymods: compilation of Fortran modules used in the python scripts<BR> |
---|
100 | $ make NCfortran: compiation of Fortran modules and main programs which require <BR> |
---|
101 | netCDF-fortran interface: (for: DistriCorrection and trajectories_overlap)<BR> |
---|
102 | $ make: compiles all components |
---|
103 | </DIV> |
---|
104 | <LI>Then one only needs to link the Makefile and compile</LI> |
---|
105 | <DIV CLASS="codetxt"> |
---|
106 | $ ln -s Makefile.[machine].[compiler] ./Makefile<BR> |
---|
107 | $ make [OptionalFlags] >& run_make.log |
---|
108 | </DIV> |
---|
109 | <LI>At the end one should have: </LI> |
---|
110 | <UL> |
---|
111 | <LI><PRE><CODE>DistriCorrection</CODE></PRE> Complete fortran program to correct data by moving values within quantiles of the distribution</LI> |
---|
112 | <LI><PRE><CODE>interpolate</CODE></PRE> Complete fortran program to interpolate data using nearest-neighbors and weighted distances</LI> |
---|
113 | <LI><PRE><CODE>module_ForDef.so</CODE></PRE> python-callable package of fortran's definitions of variables</LI> |
---|
114 | <LI><PRE><CODE>module_ForDistriCorrect.so</CODE></PRE> python-callable package of fortran's correction of the distribution by moving values within quantiles of the distribution</LI> |
---|
115 | <LI><PRE><CODE>module_ForSci.so</CODE></PRE> python-callable package of fortran's scientific/mathematical all purpose functions</LI> |
---|
116 | <LI><PRE><CODE>module_ForDiag.so</CODE></PRE> python-callable package of fortran's computation of meteorological diagnostics</LI> |
---|
117 | <LI><PRE><CODE>module_ForInt.so</CODE></PRE> python-callable package of fortran's interpolation subroutines</LI> |
---|
118 | <LI><PRE><CODE>trajectories_overlap</CODE></PRE> Complete fortran program to define enclosed regions on a given 2D field and compute their trajectories following a maximum-overlaping criteria</LI> |
---|
119 | </CODE></PRE> |
---|
120 | </OL> |
---|
121 | </OL> |
---|
122 | |
---|
123 | </BODY> |
---|
124 | </HTML> |
---|
125 | |
---|