作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试安装 rgdal
与 configure.args
但没有运气。
安装的gdal版本:
gdal-config --version
1.11.2
ogrinfo --version
GDAL 1.11.2, released 2015/02/10
ls /usr/bin | grep gdal
gdal2tiles.py
gdal2xyz.py
gdaladdo
gdal_auth.py
gdalbuildvrt
gdal_calc.py
gdalchksum.py
gdalcompare.py
gdal-config
gdal_contour
gdaldem
gdal_edit.py
gdalenhance
gdal_fillnodata.py
gdal_grid
gdalident.py
gdalimport.py
gdalinfo
gdallocationinfo
gdalmanage
gdal_merge.py
gdalmove.py
gdal_polygonize.py
gdal_proximity.py
gdal_rasterize
gdal_retile.py
gdalserver
gdal_sieve.py
gdalsrsinfo
gdaltindex
gdaltransform
gdal_translate
gdalwarp
ls /usr/include | grep proj
libprojectM
libprojectM-qt
org_proj4_Projections.h
proj_api.h
projects.h
ls /usr/lib | grep proj
libproj.a
libprojectM-qt.so
libprojectM-qt.so.1
libprojectM-qt.so.1.10
libprojectM.so
libprojectM.so.2
libprojectM.so.2.1.0
libproj.la
libproj.so
libproj.so.0
libproj.so.0.7.0
dpkg -l | grep gdal
ii gdal-bin 1.11.2+dfsg-1~exp2~trusty amd64 Geospatial Data Abstraction Library - Utility programs
ii libgdal-dev 1.11.2+dfsg-1~exp2~trusty amd64 Geospatial Data Abstraction Library - Development files
ii libgdal1-dev 1.11.2+dfsg-1~exp2~trusty all Geospatial Data Abstraction Library - Transitional package
ii libgdal1h 1.11.2+dfsg-1~exp2~trusty amd64 Geospatial Data Abstraction Library
ii python-gdal 1.11.2+dfsg-1~exp2~trusty amd64 Python bindings to the Geospatial Data Abstraction Library
dpkg -l | grep proj
ii libgeo-proj4-perl 1.05-1 amd64 PROJ.4 library for cartographic projections
ii libproj-dev 4.8.0-2ubuntu2 amd64 Cartographic projection library (development files)
ii libproj0 4.8.0-2ubuntu2 amd64 Cartographic projection library
ii libprojectm-dev 2.1.0+dfsg-1build2 amd64 Advanced Milkdrop-compatible music visualization library - dev
ii libprojectm-qt-dev 2.1.0+dfsg-1build2 amd64 projectM Qt4 (development files)
ii libprojectm-qt1 2.1.0+dfsg-1build2 amd64 projectM Qt4 bindings
ii libprojectm2 2.1.0+dfsg-1build2 amd64 Advanced Milkdrop-compatible music visualization library
ii proj-bin 4.8.0-2ubuntu2 amd64 Cartographic projection library (tools)
ii proj-data 4.8.0-2ubuntu2 amd64 Cartographic projection filter and library (datum package)
ii projectm-data 2.1.0+dfsg-1build2 all Advanced Milkdrop-compatible music visualization library - data
ii xfwm4 4.11.1-2ubuntu2 amd64 window manager of the Xfce project
install.packages('rgdal',type='source',
configure.args = paste('--with-gdal-config=/usr/bin/gdal-config',
'--with-proj-lib=/usr/lib',
'--with-proj-include=/usr/include') )
Installing package into ‘/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2’
(as ‘lib’ is unspecified)
trying URL 'http://mirrors.ustc.edu.cn/CRAN/src/contrib/rgdal_0.9-2.tar.gz'
Content type 'application/gzip' length 1627386 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: rgdal: 0.9-2
checking for /usr/bin/svnversion... no
configure: svn revision: 526
configure: gdal-config set to /usr/bin/gdal-config
checking gdal-config exists... yes
checking gdal-config executable... yes
checking gdal-config usability... yes
configure: GDAL: 1.11.2
checking GDAL version >= 1.6.3... yes
checking GDAL version < 2... yes
checking for gcc... gcc -std=gnu99
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 gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/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 gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking gdal: linking with --libs only... yes
checking GDAL: /usr/share/gdal/1.11/pcs.csv readable... yes
checking proj_api.h usability... yes
checking proj_api.h presence... yes
checking for proj_api.h... yes
checking for pj_init_plus in -lproj... yes
configure: PROJ.4 version: > 4.8.0
/tmp/ccsGVxP9.o: In function `main':
/tmp/RtmpOqwz92/R.INSTALL23317ae38fc4/rgdal/proj_conf_test.c:20: undefined reference to `pj_ctx_fclose'
collect2: error: ld returned 1 exit status
./configure: line 3735: ./proj_conf_test: No such file or directory
checking PROJ.4: epsg found and readable... yes
/tmp/ccaNfCUo.o: In function `main':
/tmp/RtmpOqwz92/R.INSTALL23317ae38fc4/rgdal/proj_conf_test.c:20: undefined reference to `pj_ctx_fclose'
collect2: error: ld returned 1 exit status
./configure: line 3810: ./proj_conf_test: No such file or directory
checking PROJ.4: conus found and readable... yes
configure: Package CPP flags: -I/usr/include/gdal -I/usr/include
configure: Package LIBS: -L/usr/lib -lgdal -L/usr/lib -lproj
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c OGR_write.cpp -o OGR_write.o
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c gdal-bindings.cpp -o gdal-bindings.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c init.c -o init.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c local_stubs.c -o local_stubs.o
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c ogr_geom.cpp -o ogr_geom.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c ogr_polygons.c -o ogr_polygons.o
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c ogr_proj.cpp -o ogr_proj.o
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c ogrdrivers.cpp -o ogrdrivers.o
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c ogrsource.cpp -o ogrsource.o
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c projectit.cpp -o projectit.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o rgdal.so OGR_write.o gdal-bindings.o init.o local_stubs.o ogr_geom.o ogr_polygons.o ogr_proj.o ogrdrivers.o ogrsource.o projectit.o -L/usr/lib -lgdal -L/usr/lib -lproj -L/usr/lib/R/lib -lR
installing to /home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/rgdal/libs
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/rgdal/libs/rgdal.so':
/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/rgdal/libs/rgdal.so: undefined symbol: pj_ctx_fgets
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/rgdal’
Warning in install.packages :
installation of package ‘rgdal’ had non-zero exit status
export LD_LIBRARY_PATH=/home/wangchl/R-scripting/R-install/proj-4.9.1/ccc/lib:/usr/lib:$LD_LIBRARY_PATH
sudo R CMD REMOVE rgdal
R CMD INSTALL rgdal_0.9-2.tar.gz --byte-compile --configure-args='--with-gdal-config=/usr/bin/gdal-config --with-proj-lib=/home/wangchl/R-scripting/R-install/proj-4.9.1/ccc/lib --with-proj-include=/home/wangchl/R-scripting/R-install/proj-4.9.1/ccc/include --with-proj-share=/home/wangchl/R-scripting/R-install/proj-4.9.1/ccc/share/proj'
installing to /home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/rgdal/libs
** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/rgdal/libs/rgdal.so':
/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/rgdal/libs/rgdal.so: undefined symbol: pj_ctx_fgets
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/rgdal’
sudo apt-get remove libproj-dev
cd /etc/ld.so.conf.d
sudo touch rgdal.conf
echo 'the lib path of proj4-4.9' | sudo tee -a rgdal.conf
export LD_LIBRARY_PATH=the lib path of proj4-4.9:$LD_LIBRARY_PATH
sudo R CMD REMOVE rgdal
R CMD INSTALL rgdal_0.9-2.tar.gz --byte-compile --configure-args='--with-gdal-config=/usr/bin/gdal-config --with-proj-lib=compiled path of proj4-4.9/lib --with-proj-include=compiled path of proj4-4.9/include --with-proj-share=compiled path of proj4-4.9/share/proj'
最佳答案
你有没有libgdal-dev
和 libproj-dev
安装了吗?
在终端:
sudo apt-get update && sudo apt-get install libgdal-dev libproj-dev
rgdal
再次。
关于r - 无法在 ubuntu 14.04 中安装 rgdal(未定义为引用 'pj_ctx_fclose'),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30320583/
我尝试安装 rgdal与 configure.args但没有运气。 安装的gdal版本: gdal-config --version 1.11.2 ogrinfo --version GDAL 1.1
我是一名优秀的程序员,十分优秀!