forked from snoweye/pbdNCDF4
-
Notifications
You must be signed in to change notification settings - Fork 3
/
INSTALL
132 lines (88 loc) · 3.79 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
### Read pbdNCDF4 vignettes first at
### http://cran.r-project.org/web/packages/pbdNCDF4/vignettes/pbdNCDF4-guide.pdf
###
### This file is a quick installation for Solaris, Linux, and Mac OS X.
### See `INSTALL.win' for Windows.
--- 'pbdMPI' Installation:
See 'pbdMPI/INSTALL' for the details.
--- Parallel HDF5 Installation:
1. Suppose MPI heaers are in "/usr/include/mpi" and MPI libraries are in
"/usr/lib". Then, we can install HDF5 with parallel I/O.
> ./configure \
--prefix=/usr/local/hdf5 \
--enable-parallel \
--enable-shared \
CC="mpicc -g" \
CFLAGS="-fPIC -I/usr/include/mpi" \
CPPFLAGS="-fPIC -I/usr/include/mpi" \
LDFLAGS="-L/usr/lib -lmpi"
> make; make install
--- Parallel NetCDF4 Installation:
1. Suppose parallel HDF5 is installed in "/usr/local/hdf5". Then, we install
NetCDF4 with parallel I/O.
> ./configure \
--prefix=/usr/local/netcdf4 \
--enable-netcdf4 \
--enable-shared \
CC="mpicc -g" \
CFLAGS="-fPIC -I/usr/include/mpi -I/usr/local/hdf5/include" \
CPPFLAGS="-fPIC -I/usr/include/mpi -I/usr/local/hdf5/include" \
LDFLAGS="-L/usr/lib -lmpi -L/usr/local/hdf5/lib -lhdf5"
> make; make install
--- 'pbdNCDF4' Installation:
0. Download and extract 'pbdNCDF4'
> tar zxvf pbdNCDF4_0.1-0.tar.gz
1. Default Installation:
This should work with most platforms with OpenMPI installed. The
configuration is based on Rmpi but detect the flags and libraries from
'mpicc --showme:*' which is more portable.
> R CMD INSTALL pbdNCDF4
2. Non-default Installation:
If NetCDF4 library is not in the PATH, then we can install it by specifying
the path to "nc-config". It will be "/usr/local/netcdf4/bin" if
"/usr/local/netcdf4" is the installed directory.
> R CMD INSTALL pbdNCDF4 \
--configure-args="--with-nc-config=/usr/local/netcdf4/bin"
3. Enable Parallel I/O:
Suppose parallel HDF5 and NetCDF4 libraries are installed correctly.
The configuration arguments can link with the libraries and enable
parallel I/O.
> R CMD INSTALL pbdNCDF4 \
--configure-args="--enable-parallel"
--- Testing:
Suppose 'pbdMPI' and 'pbdNCDF4' are installed correctly. I can run
> mpiexec -np 2 Rscript -e "demo(ncwrite_par,'pbdNCDF4',ask=F,echo=F)"
> mpiexec -np 2 Rscript -e "demo(ncread_par,'pbdNCDF4',ask=F,echo=F)"
for parallel, and
> mpiexec -np 2 Rscript -e "demo(ncwrite_ser,'pbdNCDF4',ask=F,echo=F)"
> mpiexec -np 2 Rscript -e "demo(ncread_ser,'pbdNCDF4',ask=F,echo=F)"
for serial.
### `INSTALL.win'
### This part is a quick installation for Windows.
### See vignettes for more detail steps for Windows.
--- netCDF 4.3.2 Installation:
1. Download 32-bit library from
http://www.unidata.ucar.edu/netcdf/win_netcdf/netCDF4.3.2-NC4-32.exe
and 64-bit library from
http://www.unidata.ucar.edu/netcdf/win_netcdf/netCDF4.3.2-NC4-64.exe .
2. Install with a few clicks and manually assign directory for 32-bit
library at
C:/Program Files (x86)/netCDF 4.3.2/
and 64-bit library at
C:/Program Files/netCDF 4.3.2/ .
--- 'pbdNCDF4' Installation:
0. Download and extract 'pbdNCDF4'
> tar zxvf pbdNCDF4_0.1-3.tar.gz
1. Set Environment Variables:
SET NETCDF4_ROOT_32 = C:/Program Files (x86)/netCDF 4.3.2/
SET NETCDF4_ROOT_64 = C:/Program Files/netCDF 4.3.2/
SET NETCDF4_ROOT=%NETCDF4_ROOT_64%
2. Set Rtools:
SET R_HOME=C:/Program Files/R/R-3.0.1/
SET RTOOLS=C:/Rtools/bin/
SET MINGW=C:/Rtools/gcc-4.6.3/bin/
SET PATH=%R_HOME%;%R_HOME%bin/;%RTOOLS%;%MINGW%;%PATH%
SET PATH=%NETCDF4_ROOT%bin/;%PATH%
3. Default Installation:
> R CMD INSTALL --build pbdNCDF4
> R CMD INSTALL pbdNCDF4_0.1-3.zip