File: INSTALL

package info (click to toggle)
r-cran-rnetcdf 1.9-1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 656 kB
  • sloc: xml: 1,997; ansic: 1,358; sh: 19; makefile: 5
file content (86 lines) | stat: -rw-r--r-- 3,271 bytes parent folder | download
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
This file describes the command line arguments which can be passed during
installation of the RNetCDF package and gives some further hints.


Software Requirements
=====================

NetCDF library version 3.6.0 or greater (64-bit file support).

UDUNITS library either version 1 or 2.1 or greater.

If the NetCDF library (version 4) is linked against HDF5, the HDF5 library
must be located in the library search path.

If using Fink on Mac OS X, be sure that the corresponding R version (either
i386 or x86_64) is used (R32 or R64). Compiling with R64 against i386 will
most likely lead to runtime errors.


R CMD INSTALL Options
=====================

Libraries and include files are usually detected automatically by nc-config,
which is part of most netcdf4 installations. If this causes problems,
you can disable nc-config using --without-nc-config.

The configure script can accept variables to define extra paths or libraries:

CPPFLAGS='-I<incdir> [-I<incdir> ...]'  extra directories of header files
LDFLAGS='-L<libdir> [-L<libdir> ...]'   extra directories for libraries
LIBS='-l<libname> [-l<libname> ...]'    libraries to link

Definitions for the above variables may be appended to the configure command line.

Note that libraries may be specified in LIBS in a few different ways.
The most common way is '-l<libname>' as shown above, and the compiler will
typically search for a library called lib<libname>.so and then lib<libname>.a.
But you can also specify the full pathname of a library if necessary,
perhaps to force the use of a particular netcdf or udunits library
on systems with multiple versions available.


R CMD INSTALL Example
=====================

R CMD INSTALL --configure-args="CPPFLAGS=-I/sw/include \
    LDFLAGS=-L/sw/lib LIBS=-lhdf5" RNetCDF_1.9-1.tar.gz


LD_LIBRARY_PATH
===============

If a runtime error occurs indicating that shared libraries cannot be found,
you may need to set or modify the library search path to include directories
where NetCDF, HDF5 and/or UDUNITS libraries are stored.
This is sometimes necessary for custom installations of the libraries.

The library search path is typically influenced by the environment variable
LD_LIBRARY_PATH (or DYLD_LIBRARY_PATH for Mac OSX). For example:

export LD_LIBRARY_PATH=/sw/lib:$LD_LIBRARY_PATH

On some systems, it is possible to build R packages so that dependencies
are found automatically at runtime. For example, some linkers provide an
option such as '-rpath', which embeds the library search path when creating
an executable or shared library. It may also be possible to avoid runtime
dependencies by building your R package against static libraries (*.a),
but this will only work if the functions in the libraries were compiled as
position independent code (e.g. using the -fPIC option of gcc).


R CMD check Example
===================

R CMD check --install-args="--configure-args='CPPFLAGS=-I/sw/include \
    LDFLAGS=-L/sw/lib'" RNetCDF_1.9-1.tar.gz


Time units
==========

Common udunits databases are distributed with RNetCDF, and these are used
by default when RNetCDF is loaded by R. However, a different units database
may be used by specifying the appropriate file in environment variables
UDUNITS2_XML_PATH (udunits2) or UDUNITS_PATH (udunits1).