Re: [R] install ncdf package on a 64-bit machine

From: Katharine Mullen <kate_at_few.vu.nl>
Date: Wed, 23 Jan 2008 02:31:57 +0100 (CET)

I am running 64-bit Ubuntu 7.10 and unfortunately remember seeing that error message but not how I got it to go away.

I would first try compiling netcdf-3.6.2 from source, without changing the default directories for installation.

Looking at the error message it seems like the 3 shared libraries get made but then linking them gives the error - that step seems to be where it says to compile with "-fPIC".

My output of install.packages("ncdf") is below with that of sessionInfo() - I still see a lot of warnings.

The downloaded packages are in

         /tmp/RtmpcJ0Af9/downloaded_packages Updating HTML index of packages in '.Library'
>

> sessionInfo()

R version 2.6.1 (2007-11-26)
x86_64-unknown-linux-gnu

locale:
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C

attached base packages:
  [1] splines grid tcltk stats graphics grDevices utils   [8] datasets methods base

other attached packages:

  [1] ncdf_1.6         xtable_1.5-2     TIMP_1.5         minpack.lm_1.0-5
  [5] quadprog_1.4-11  nnls_1.2         gclus_1.2        gplots_2.3.2
  [9] gdata_2.3.1      gtools_2.4.0     fields_3.5       vcd_1.0-6
[13] colorspace_0.95 MASS_7.2-38

loaded via a namespace (and not attached): [1] rcompgen_0.1-17 tools_2.6.1

On Tue, 22 Jan 2008, Linda Smith wrote:

> Dear All,
> I recently got a 64bit machine and had netcdf-3.6.2 installed. Then I tried
> to install ncdf package but got the following error message when using
> netcdflib:
>
> gcc -std=gnu99 -I/home/ljin/share/R-2.6.1/include
> -I/home/ljin/share/R-2.6.1/include
> -I. -I/usr/local/include -fpic -g -O2 -c ncdf2.c -o ncdf2.o
> gcc -std=gnu99 -I/home/ljin/share/R-2.6.1/include
> -I/home/ljin/share/R-2.6.1/include
> -I. -I/usr/local/include -fpic -g -O2 -c ncdf3.c -o ncdf3.o
> ncdf3.c: In function 'R_nc_get_vara_charvarid':
> ncdf3.c:221: warning: assignment discards qualifiers from pointer target
> type
> ncdf3.c: In function 'R_nc_get_vara_numvarid':
> ncdf3.c:267: warning: assignment discards qualifiers from pointer target
> type
> gcc -std=gnu99 -I/home/ljin/share/R-2.6.1/include
> -I/home/ljin/share/R-2.6.1/include
> -I. -I/usr/local/include -fpic -g -O2 -c ncdf.c -o ncdf.o
> ncdf.c: In function 'R_nc_ttc_to_nctype':
> ncdf.c:424: warning: implicit declaration of function 'exit'
> ncdf.c:424: warning: incompatible implicit declaration of built-in function
> 'exit'
> gcc -std=gnu99 -shared -L/usr/local/lib64 -o ncdf.so ncdf2.o ncdf3.o
> ncdf.o-L. -lnetcdf
> /usr/bin/ld: /usr/local/lib/libnetcdf.a(attr.o): relocation R_X86_64_32
> against `a local symbol' can not be used when making a shared object;
> recompile with -fPIC
> /usr/local/lib/libnetcdf.a: could not read symbols: Bad value
> collect2: ld returned 1 exit status
> make: *** [ncdf.so] Error 1
> chmod: cannot access `/home/ljin/share/R-2.6.1/library/ncdf/libs/*': No such
> file or directory
> ERROR: compilation failed for package 'ncdf'
> ** Removing '/home/ljin/share/R-2.6.1/library/ncdf'
>
> ========
> I had no problem when I install the ncdf package on my 32bit linux machine.
> Could anyone help me with the installation on 64bit machine?
>
> Thanks!
>
> Linda
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 23 Jan 2008 - 01:34:42 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 Jan 2008 - 09:30:07 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive