[R-SIG-Mac] R+GFortran - build Rgdal on osx 10.8 - homebrew

Massimo Di Stefano massimodisasha at gmail.com
Mon Nov 26 11:53:34 CET 2012


Hi All,

i'm having trouble trying to build Rgdal from source on mac osx 10.8.x

i have R and gfortran installed using Homebrew.

when i try to build rgdal i got this log :

epi:~ epi$ R CMD INSTALL rgdal_0.7-22.tar.gz
* installing to library
‘/usr/local/Cellar/r/2.15.2/R.framework/Versions/2.15/Resources/library’
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: gdal-config: gdal-config
checking gdal-config usability... yes
configure: GDAL: 1.9.2
checking GDAL version > 1.5.4... yes
checking for gcc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
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 gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking gdal: linking with --libs only... no
checking gdal: linking with --libs and --dep-libs... no
clang: warning: treating 'c' input as 'c++' when in C++ mode, this
behavior is deprecated
gdal_test.c:5:1: error: C++ requires a type specifier for all declarations
main() {
^~~~
1 error generated.
clang: warning: treating 'c' input as 'c++' when in C++ mode, this
behavior is deprecated
gdal_test.c:5:1: error: C++ requires a type specifier for all declarations
main() {
^~~~
1 error generated.
configure: Install failure: compilation and/or linkage problems.
configure: error: GDALAllRegister not found in libgdal.
ERROR: configuration failed for package ‘rgdal’
* removing
‘/usr/local/Cellar/r/2.15.2/R.framework/Versions/2.15/Resources/library/rgdal’ 

epi:~ epi$


have you any clue about it ?


I tried to untar the rgdal.tar.gz
and rerun the R CMD install command ,

i attached a link to the logs :

http://epi.whoi.edu/esr/errors.txt
http://epi.whoi.edu/esr/configure.ac
http://epi.whoi.edu/config.log


sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-apple-darwin12.2.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base



###


epi:~ epi$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gfortran/4.7.2/gfortran/libexec/gcc/x86_64-apple-darwin12.2.0/4.7.2/lto-wrapper 

Target: x86_64-apple-darwin12.2.0
Configured with: ../configure --enable-languages=fortran
--prefix=/usr/local/Cellar/gfortran/4.7.2/gfortran
--datarootdir=/usr/local/Cellar/gfortran/4.7.2/share
--bindir=/usr/local/Cellar/gfortran/4.7.2/bin --with-system-zlib
--with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr
--with-mpc=/usr/local/opt/libmpc --enable-checking=release
--disable-stage1-checking --disable-build-poststage1-with-cxx
--disable-libstdcxx-pc --disable-nls
Thread model: posix
gcc version 4.7.2 (GCC)
epi:~ epi$


(i'm using homebrew for gfortran ,
the standard R binary for mac was not able to detect the gfortran that 
comes with homebrew
- missed ld -lgfortran)


Thanks!!!

Massimo.



More information about the R-SIG-Mac mailing list