Metabolomics Society Forum

Software => XCMS => R => XCMS - Cookbook => Topic started by: hpbenton on August 19, 2011, 09:30:12 AM

Title: Compiling netcdf library
Post by: hpbenton on August 19, 2011, 09:30:12 AM
Why compile
You will only need this if your UNIX/Linux does not provide libnetcdf, e.g. SLES. Debian based systems like Ubuntu provide libnetcdf. It can be installed using
Code: [Select]
##terminal :
sudo apt-get install libnetcdf4 libnetcdf-dev
On Mac OSX netcdf isn't needed if you install xcms using the tgz binary file. However, if you want to alter the code or install from source you will need to install netcdf using the following terminal code:
Code: [Select]
curl -O http://r.research.att.com/libs/netcdf-4.0.1-darwin89-bin4.tar.gz
sudo tar fvxz netcdf-4.0.1-darwin89-bin4.tar.gz -C /
There is also netcdf-4.1.1 but some users report errors when installing xcms. To check if there are any updates check R Research AT&T (http://http://r.research.att.com/libs/)

Compiling the netcdf library for XCMS from source
Download netcdf libraries, version 4.1.1 http://www.unidata.ucar.edu/downloads/netcdf/index.jsp (http://www.unidata.ucar.edu/downloads/netcdf/index.jsp)

Compile using the --enable-shared option
Copy the executables, libraries and headers to a place where R can find it, e.g. /usr/local.
It might also be necessary to have the libraries in both, /usr/local/lib and /usr/local/lib64.

Test: the library ncdf.
Code: [Select]
## R code
install.packages("ncdf")
#and load
library(ncdf)