Compilation failed for package ‘rgeos’ while using R-studio

走远了吗. 提交于 2019-12-23 04:45:29

问题


While installing R package rgeos, I typed the code below in R-studio:

>install.packages("rgeos")

The output shows like this:

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  

What's wrong with clang? How to fix that?
Any advice would be appreciate!

I'm using 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

来源:https://stackoverflow.com/questions/36220704/compilation-failed-for-package-rgeos-while-using-r-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!