使用R-studio时包'rgeos'的编译失败

时间:2016-03-25 13:17:11

标签: r clang rstudio gis geos

安装R包 rgeos 时,我在R-studio中输入以下代码:

>install.packages("rgeos")

输出显示如下:

ld: framework not found R
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [rgeos.so] Error 1
ERROR: compilation failed for package ‘rgeos’
* removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgeos’
Warning in install.packages :
  installation of package ‘rgeos’ had non-zero exit status  

clang 有什么问题?如何解决?
任何建议都会很感激!

我正在使用Mac Os X Yosemite。

Upate

## Whole contents when I failed to install
configure: CC: clang
configure: CXX: clang++
configure: rgeos: 0.3-17
checking for /usr/bin/svnversion... yes
configure: svn revision: 520
checking for geos-config... /usr/local/bin/geos-config
checking geos-config usability... yes
configure: GEOS version: 3.4.2
checking geos version at least 3.2.0... yes
checking geos-config clibs... yes
checking for gcc... clang
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 clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -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 geos_c.h usability... yes
checking geos_c.h presence... yes
checking for geos_c.h... yes
checking geos: linking with libgeos_c... yes
configure: PKG_CPPFLAGS:  -I/usr/local/Cellar/geos/3.4.2/include
configure: PKG_LIBS:  -L/usr/local/Cellar/geos/3.4.2/lib -lgeos -L/usr/local/Cellar/geos/3.4.2/lib -lgeos_c
configure: creating ./config.status
config.status: creating src/Makevars
** libs
clang++ -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/geos/3.4.2/include -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sp/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c dummy.cc -o dummy.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/geos/3.4.2/include -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sp/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c init.c -o init.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/geos/3.4.2/include -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sp/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c local_stubs.c -o local_stubs.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/geos/3.4.2/include -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sp/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c rgeos.c -o rgeos.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/geos/3.4.2/include -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sp/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c rgeos_R2geos.c -o rgeos_R2geos.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/geos/3.4.2/include -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sp/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c rgeos_R2geosMP.c -o rgeos_R2geosMP.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/geos/3.4.2/include -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sp/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c rgeos_bbox.c -o rgeos_bbox.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/geos/3.4.2/include -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sp/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c rgeos_buffer.c -o rgeos_buffer.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/geos/3.4.2/include -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sp/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c rgeos_coord.c -o rgeos_coord.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/geos/3.4.2/include -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sp/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c rgeos_geos2R.c -o rgeos_geos2R.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/geos/3.4.2/include -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sp/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c rgeos_misc.c -o rgeos_misc.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/geos/3.4.2/include -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sp/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c rgeos_poly2nb.c -o rgeos_poly2nb.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/geos/3.4.2/include -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sp/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c rgeos_predicate_binary.c -o rgeos_predicate_binary.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/geos/3.4.2/include -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sp/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c rgeos_predicate_unary.c -o rgeos_predicate_unary.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/geos/3.4.2/include -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sp/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c rgeos_topology.c -o rgeos_topology.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/geos/3.4.2/include -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sp/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c rgeos_topology_binary.c -o rgeos_topology_binary.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/geos/3.4.2/include -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sp/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c rgeos_validate.c -o rgeos_validate.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/geos/3.4.2/include -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sp/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c rgeos_wkt.c -o rgeos_wkt.o
clang++ -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o rgeos.so dummy.o init.o local_stubs.o rgeos.o rgeos_R2geos.o rgeos_R2geosMP.o rgeos_bbox.o rgeos_buffer.o rgeos_coord.o rgeos_geos2R.o rgeos_misc.o rgeos_poly2nb.o rgeos_predicate_binary.o rgeos_predicate_unary.o rgeos_topology.o rgeos_topology_binary.o rgeos_validate.o rgeos_wkt.o -L/usr/local/Cellar/geos/3.4.2/lib -lgeos -L/usr/local/Cellar/geos/3.4.2/lib -lgeos_c -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: framework not found R
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [rgeos.so] Error 1
ERROR: compilation failed for package ‘rgeos’
* removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgeos’

The downloaded source packages are in
    ‘/private/var/folders/wg/d26_jxbj2p9gp7nkl90q0fbm0000gn/T/Rtmp55wbAF/downloaded_packages’
Warning message:
In install.packages("rgeos", type = "source") :
  installation of package ‘rgeos’ had non-zero exit status

0 个答案:

没有答案