Skip to content

Problems installing rgdal from source

5 messages · Paul Roebuck, sj, Simon Urbanek

sj
#
Dear list

I tried to install rgdal from source and was running into troubles.

System: OS X 10.4.6, PPC
R version: 2.3.0
GDAL version: 1.3.1.0 (installed from fink)
PROJ.4 version: 4.4.8-4 (installed from fink)

proj_api.h exists in /sw/include
libproj.a exists in /sw/lib

therefor I used the following commands to install:

export CPPFLAGS="-I/sw/include"
export LDFLAGS="-L/sw/lib"
R CMD INSTALL rgdal_0.4-4.tar.gz

what produced:

-------------------------------------------------------------------------------------------------------------------------
* Installing *source* package 'rgdal' ...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for pj_init_plus in -lproj... yes
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking proj_api.h usability... yes
checking proj_api.h presence... yes
checking for proj_api.h... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
** arch - ppc
g++-4.0 -arch ppc -I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/ppc 
-I/sw/include/gdal1 -g -DRGDALDEBUG -I/usr/local/include   -fPIC 
-fno-common  -g -O2 -c gdal-bindings.cpp -o gdal-bindings.o
g++-4.0 -arch ppc -I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/ppc 
-I/sw/include/gdal1 -g -DRGDALDEBUG -I/usr/local/include   -fPIC 
-fno-common  -g -O2 -c ogr_geom.cpp -o ogr_geom.o
g++-4.0 -arch ppc -I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/ppc 
-I/sw/include/gdal1 -g -DRGDALDEBUG -I/usr/local/include   -fPIC 
-fno-common  -g -O2 -c ogr_proj.cpp -o ogr_proj.o
g++-4.0 -arch ppc -I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/ppc 
-I/sw/include/gdal1 -g -DRGDALDEBUG -I/usr/local/include   -fPIC 
-fno-common  -g -O2 -c ogrsource.cpp -o ogrsource.o
gcc-4.0 -arch ppc -I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/ppc 
-I/sw/include/gdal1 -g -DRGDALDEBUG -I/usr/local/include   -fPIC 
-fno-common  -g -O2 -std=gnu99 -c projectit.c -o projectit.o
projectit.c:6:22: error: proj_api.h: No such file or directory
projectit.c: In function 'project':
projectit.c:16: error: 'projUV' undeclared (first use in this function)
projectit.c:16: error: (Each undeclared identifier is reported only once
projectit.c:16: error: for each function it appears in.)
projectit.c:16: error: syntax error before 'p'
projectit.c:17: error: 'projPJ' undeclared (first use in this function)
projectit.c:19: error: 'pj' undeclared (first use in this function)
projectit.c:19: warning: implicit declaration of function 'pj_init_plus'
projectit.c:20: warning: implicit declaration of function 'pj_strerrno'
projectit.c:20: warning: implicit declaration of function 'pj_get_errno_ref'
projectit.c:20: error: invalid type argument of 'unary *'
projectit.c:20: warning: passing argument 1 of 'Rf_error' makes pointer 
from integer without a cast
projectit.c:29: error: 'p' undeclared (first use in this function)
projectit.c:31: error: 'DEG_TO_RAD' undeclared (first use in this function)
projectit.c:33: warning: implicit declaration of function 'pj_fwd'
projectit.c:35: warning: implicit declaration of function 'pj_free'
projectit.c:36: error: invalid type argument of 'unary *'
projectit.c:36: warning: passing argument 1 of 'Rf_error' makes pointer 
from integer without a cast
projectit.c: In function 'project_inv':
projectit.c:54: error: 'projUV' undeclared (first use in this function)
projectit.c:54: error: syntax error before 'p'
projectit.c:55: error: 'projPJ' undeclared (first use in this function)
projectit.c:57: error: 'pj' undeclared (first use in this function)
projectit.c:58: error: invalid type argument of 'unary *'
projectit.c:58: warning: passing argument 1 of 'Rf_error' makes pointer 
from integer without a cast
projectit.c:66: error: 'p' undeclared (first use in this function)
projectit.c:68: warning: implicit declaration of function 'pj_inv'
projectit.c:71: error: invalid type argument of 'unary *'
projectit.c:71: warning: passing argument 1 of 'Rf_error' makes pointer 
from integer without a cast
projectit.c:73: error: 'RAD_TO_DEG' undeclared (first use in this function)
projectit.c: In function 'transform':
projectit.c:88: error: 'projUV' undeclared (first use in this function)
projectit.c:88: error: syntax error before 'p'
projectit.c:89: error: 'projPJ' undeclared (first use in this function)
projectit.c:92: error: 'fromPJ' undeclared (first use in this function)
projectit.c:93: error: invalid type argument of 'unary *'
projectit.c:93: warning: passing argument 1 of 'Rf_error' makes pointer 
from integer without a cast
projectit.c:95: error: 'toPJ' undeclared (first use in this function)
projectit.c:96: error: invalid type argument of 'unary *'
projectit.c:96: warning: passing argument 1 of 'Rf_error' makes pointer 
from integer without a cast
projectit.c:105: warning: implicit declaration of function 'pj_get_def'
projectit.c:105: warning: passing argument 1 of 'Rf_mkChar' makes 
pointer from integer without a cast
projectit.c:108: warning: passing argument 1 of 'Rf_mkChar' makes 
pointer from integer without a cast
projectit.c:115: error: 'p' undeclared (first use in this function)
projectit.c:120: warning: implicit declaration of function 'pj_is_latlong'
projectit.c:121: error: 'DEG_TO_RAD' undeclared (first use in this function)
projectit.c:125: warning: implicit declaration of function 'pj_transform'
projectit.c:134: error: invalid type argument of 'unary *'
projectit.c:134: warning: passing argument 1 of 'Rf_error' makes pointer 
from integer without a cast
projectit.c:137: error: 'RAD_TO_DEG' undeclared (first use in this function)
projectit.c: In function 'checkCRSArgs':
projectit.c:153: error: 'projPJ' undeclared (first use in this function)
projectit.c:153: error: syntax error before 'pj'
projectit.c:159: error: 'pj' undeclared (first use in this function)
projectit.c:162: error: invalid type argument of 'unary *'
projectit.c:162: warning: passing argument 1 of 'Rf_mkChar' makes 
pointer from integer without a cast
projectit.c:169: warning: passing argument 1 of 'Rf_mkChar' makes 
pointer from integer without a cast
make: *** [projectit.o] Error 1
chmod: getting attributes of 
`/Library/Frameworks/R.framework/Versions/2.3/Resources/library/rgdal/libs/ppc/*': 
No such file or directory
ERROR: compilation failed for package 'rgdal'
** Removing 
'/Library/Frameworks/R.framework/Versions/2.3/Resources/library/rgdal'
-------------------------------------------------------------------------------------------------------------------------

Apparently it still cannot find the proj_api.h, although the checks were 
ok. Any hints what I do wrong?

Thanks and regards
Simon

PS: Is there a possibility or function to search the mail archive?
#
On Thu, 8 Jun 2006, sj wrote:

            
Is it possible that such a generically named header file
actually is completely unrelated to the API in question?
You put FINK on your OS X system and expected it to use
it for development with non-FINK software. Ditch FINK and
compile what you need yourself.

----------------------------------------------------------
SIGSIG -- signature too long (core dumped)
sj
#
Thanks for your quick reply.
No, proj_api.h:

/******************************************************************************
  * $Id: proj_api.h,v 1.10 2004/05/04 03:28:01 warmerda Exp $
  *
  * Project:  PROJ.4
  * Purpose:  Public (application) include file for PROJ.4 API, and 
constants.
  * Author:   Frank Warmerdam, <warmerdam at pobox.com>
  *
 
******************************************************************************
Well, this would be an idea, but it worked quite well for me until now. 
I compiled things myself before on my Linux box and it took me a great 
deal of time to figure out all the dependencies, correct versions of 
dependencies and even sometimes the package/program the requested file 
resided in. And finally it also ends up in a non standard location 
(compared to a Linux machine). Perhaps I have a wrong understanding of 
this, but what Fink basically does, is figuring out and automatically 
installing the dependencies (of course into a non standard location). So 
the question is rather, why the configure script resp. the compiler does 
not find the file any more after the successful checks. Anyhow, I'll 
give it a try and compile it by hand.

Thanks and regards
Simon
sj
#
Problem solved, installation of rgdal succeded.
I compiled and installed PROJ.4 under /usr/local. After this, the 
installation with R CMD worked smoothly. Surprisingly, there was no need 
to reinstall GDAL (installed with Fink). Apparently there is somewhere a 
hardcoded path (this is my interpretation), ignoring the flags.

Thanks for your help.

Regards
Simon