[R] sharing experience - installing R Spatial Views

Hendro Wibowo hendrohwibowo at gmail.com
Sat Jun 12 02:37:54 CEST 2010


Hi Guys,

I would like to share my experience when installing the Spatial views 
packages for R. I could not install 32 packages which are parts of the 
Spatial views, and I use google-search and search to solve ALL those 
problems for about 2 days. I hope maybe somebody would benefit from my 
experience.

I admitted that I do not have excellent programming skills at all. So, 
perhaps some of steps I did are not necessary to solve the problem at 
hands. But it works and I am happy.

I was lucky if the problem I have was already solved by someone else, or 
if the problem is just a matter of installing another R packages that 
depends on other packages. Sometimes it has something to do not with R 
package but with a package that has to be installed in my operating 
system (in my case LinuxMint 8, based on ubuntu karmic). so I just 
guessed the nature of the problem, and try to solve it via already 
solved similar problem.

i found many problems solved direct or indirect from Nabble - OSGeo 
FOSS4G websites. of course many problem are also solved from other 
website other than Nabble, but I forgot their address, as I google 
search again and again for all those problems. But I do appreciate 
everyone who post their problems, solved or not solved, so I can solved 
my own problem, either directly or indirectly (by using the idea and 
guessing from already solved problem).

I found that we need to change from gcc version 4 to 3, in order to some 
packages to be installed (I forgot which one). The script i used to 
achieve that, taken from the internet, is placed at the bottom of this 
message.

and finally below here are lists of problems and solutions of installing 
Spatial Views.
------------------------------------------------------------------------
install-R views Spatial in linuxmint 8 (ubuntu karmic based)

requirement: update for latest R (> 2.11.1)

# install package ctv
# install.packages("ctv",dependencies=TRUE)
# problems:

package: XML
error: cannot find xml2-config
solved: apt-get install libxml2-dev

# install views Spatial
# install.views("Spatial",dependencies=TRUE)
# problems:

The downloaded packages are in
	‘/tmp/Rtmpb0gy50/downloaded_packages’
There were 32 warnings (use warnings() to see them)
 > warnings()
Warning messages:
================================================================================================
1: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'RODBC' had non-zero exit status

message error:
configure error: "ODBC headers sql.h and sqlext.h not found"
solved: apt-get install unixodbc unixodbc-dev

================================================================================================
2: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'Rmpi' had non-zero exit status

message error:
configure error: "Cannot find mpi.h header file"
solved:
- first add debian source repository -> copy paste existing main 
restricted, add -src
	deb http://...... karmic main restricted.....
	deb http://...... karmic-updates main restricted.....
become
	deb-src http://...... karmic main restricted.....
	deb-src http://...... karmic-updates main restricted.....
- apt-get update
- apt-get build-dep r-cran-rmpi
- R CMD INSTALL Rmpi --configure-args="--with-mpi=/usr/lib/openmpi"

================================================================================================
3: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'rpvm' had non-zero exit status

message error:
Try to guess if pvm is installed somewhere ...
  Cannot find pvm.
  If pvm is installed, set PVM_ROOT to where pvm is.
  Otherwise, please install pvm first.
ERROR: configuration failed for package ‘rpvm’

solved:
- apt-get install pvm pvm-dev


================================================================================================
4: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'rsprng' had non-zero exit status

message error:
Cannot find sprng 2.0 header file.

solved:
- install libsprng2-dev

================================================================================================
5: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'tkrplot' had non-zero exit status

message error:
tcltkimg.c:2:16: tk.h: No such file or directory
............
tcltkimg.c:469: error: expected declaration specifiers before ‘Tcl_Interp’
tcltkimg.c:468: warning: type of ‘interp’ defaults to ‘int’
make: *** [tcltkimg.o] Error 1


solved:
apt-get install tk8.5-dev

================================================================================================
6: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'rJava' had non-zero exit status

problems: no java compiler javac and javah
check with R CMD java reconf

hendro-linux R-packages # R CMD javareconf
Java interpreter : /usr/bin/java
Java version     : 1.6.0_20
Java home path   : /usr/lib/jvm/java-6-sun-1.6.0.20/jre
Java compiler    : not present
Java headers gen.:
Java archive tool:
Java library path: 
$(JAVA_HOME)/lib/i386/client:$(JAVA_HOME)/lib/i386:$(JAVA_HOME)/../lib/i386::/usr/java/packages/lib/i386:/lib:/usr/lib
JNI linker flags : -L$(JAVA_HOME)/lib/i386/client 
-L$(JAVA_HOME)/lib/i386 -L$(JAVA_HOME)/../lib/i386

solved:
apt-get install sun-java6-jdk

check again with R CMD java reconf

hendro-linux R-packages # R CMD javareconf
Java interpreter : /usr/bin/java
Java version     : 1.6.0_20
Java home path   : /usr/lib/jvm/java-6-sun-1.6.0.20/jre
Java compiler    : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
Java library path: 
$(JAVA_HOME)/lib/i386/client:$(JAVA_HOME)/lib/i386:$(JAVA_HOME)/../lib/i386::/usr/java/packages/lib/i386:/lib:/usr/lib
JNI linker flags : -L$(JAVA_HOME)/lib/i386/client 
-L$(JAVA_HOME)/lib/i386 -L$(JAVA_HOME)/../lib/i386 -L 
-L/usr/java/packages/lib/i386 -L/lib -L/usr/lib -ljvm
JNI cpp flags    : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/linux

================================================================================================
7: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'rgl' had non-zero exit status

message error:
configure: error: missing required header GL/gl.h

solved:
apt-get install libglu1-mesa-dev

================================================================================================
8: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'fields' had non-zero exit status

message error:
ERROR: dependencies ‘spam’ are not available for package ‘fields’

solved:
cd /usr/lib
ln -s libgfortran.so.3 libgfortran.so
install.packages("fields",dependencies=TRUE)
================================================================================================
9: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'ncdf' had non-zero exit status

message error:
Fatal error: I cannot find the directory that holds the netcdf include 
file netcdf.h!

solved:
apt-get install libnetcdf-dev
================================================================================================
10: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'spatialsegregation' had non-zero exit status

message error:
make: *** [tcltkimg.o] Error 1
ERROR: compilation failed for package ‘tkrplot’
.
.
.
/usr/bin/ld: cannot find -lgfortran

solved:
package ‘tkrplot’ installed
================================================================================================
11: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'snowFT' had non-zero exit status

solved:
install.packages("snowFT",dependencies=TRUE)
================================================================================================
12: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'shapes' had non-zero exit status

solved:
install.packages("shapes",dependencies=TRUE)
================================================================================================
13: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'compositions' had non-zero exit status

solved:
install.packages("compositions",dependencies=TRUE)
================================================================================================
14: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'DSpat' had non-zero exit status

message error:
ERROR: dependencies ‘spatstat’ are not available for package ‘DSpat’

solved:
spatstat need tkrplot
package ‘tkrplot’ installed
================================================================================================
15: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'FieldSim' had non-zero exit status

solved:
R CMD INSTALL FieldSim_3.1.tar.gz
================================================================================================
16: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'MBA' had non-zero exit status

message error:
configure: error: Boost header files not found. Under linux/Unix try R 
CMD INSTALL MBA_0.0-0.tar.gz 
--configure-args='--with-boost-include=INCLUDE_PATH'
ERROR: configuration failed for package ‘MBA’

solved:
apt-get install libboost-dev
================================================================================================
17: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'ramps' had non-zero exit status

message error:

dependencies:
spam (spam need fields)
fields

solved:
by installing spam and fields
================================================================================================
18: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'rgdal' had non-zero exit status

message error:
./configure: line 1311: gdal-config: command not found

solved:
The program 'gdal-config' is currently not installed
apt-get install libgdal1-dev
================================================================================================
19: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'latentnet' had non-zero exit status

solved:
as the above problems are solved (not sure which one), this one is 
solved automatically
================================================================================================
20: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'VIM' had non-zero exit status

message error:
ERROR: dependencies ‘tkrplot’ are not available for package ‘VIM’
================================================================================================
21: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'CircSpatial' had non-zero exit status

solved:
as the above problems are solved (not sure which one), this one is 
solved automatically
================================================================================================
22: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'clustTool' had non-zero exit status

solved:
as the above problems are solved (not sure which one), this one is 
solved automatically
================================================================================================
23: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'cshapes' had non-zero exit status

solved:
as the above problems are solved (not sure which one), this one is 
solved automatically
================================================================================================
24: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'ecespa' had non-zero exit status

solved:
as the above problems are solved (not sure which one), this one is 
solved automatically
================================================================================================
25: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'ModelMap' had non-zero exit status

solved:
as the above problems are solved (not sure which one), this one is 
solved automatically
================================================================================================
26: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'RSurvey' had non-zero exit status

solved:
as the above problems are solved (not sure which one), this one is 
solved automatically
================================================================================================
27: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'spgrass6' had non-zero exit status

solved:
as the above problems are solved (not sure which one), this one is 
solved automatically
================================================================================================
28: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'statnet' had non-zero exit status

solved:
as the above problems are solved (not sure which one), this one is 
solved automatically
================================================================================================
29: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'GeoXp' had non-zero exit status

solved:
as the above problems are solved (not sure which one, definitely one of 
them is 'spam' package), this one is solved automatically
================================================================================================
30: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'intamap' had non-zero exit status

solved:
as the above problems are solved (not sure which one), this one is 
solved automatically
================================================================================================
31: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'spcosa' had non-zero exit status

solved:
as the above problems are solved (not sure which one), this one is 
solved automatically
================================================================================================
32: In install.packages(pkgs, repos = views[[i]]$repository,  ... :
   installation of package 'psgp' had non-zero exit status

message error:
In file included from optimisation/SCGModelTrainer.h:38,
                  from astonGeostats.h:16,
                  from astonGeostats.cpp:1:
optimisation/ModelTrainer.h:43: error: `eps' was not declared in this scope
optimisation/ModelTrainer.h:47: error: `itpp' is not a namespace-name
..
..
..
make: *** [astonGeostats.o] Error 1
ERROR: compilation failed for package ‘psgp’

solved:
apt-get install libblas-dev libblas3gf liblapack-dev liblapack3gf 
libfftw3-3 libfftw3-dev
apt-get install libitpp-dev libitpp6gf

================================================================================================
gcc34 script:
#/bin/sh
mkdir DELEME &&
cd DELEME &&
wget 
http://ge.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/libstdc++6-dev_3.4.6-6ubuntu3_i386.deb 
&&
wget 
http://ge.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/cpp-3.4_3.4.6-6ubuntu3_i386.deb 
&&
wget 
http://ge.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/gcc-3.4_3.4.6-6ubuntu3_i386.deb 
&&
wget 
http://ge.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/gcc-3.4-base_3.4.6-6ubuntu3_i386.deb 
&&
wget 
http://ge.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/g++-3.4_3.4.6-6ubuntu3_i386.deb 
&&
sudo dpkg -i *.deb &&
cd .. &&
rm -rf DELEME



More information about the R-help mailing list