Reputation: 63
How can I install the R 'sf'
package on CentOS? On attempting to install, I initially got an error due to an out of date gdal package; I updated gdal (built from source following: http://trac.osgeo.org/gdal/wiki/BuildingOnUnix) and now have an error:
checking GDAL: linking with --libs only... yes
checking GDAL: /usr/local/share/gdal/pcs.csv readable... yes
checking GDAL: checking whether PROJ.4 is available for linking:... yes
checking GDAL: checking whether PROJ.4 is available fur running:...
./gdal_proj: error while loading shared libraries: libgdal.so.20: cannot open
shared object file: No such file or directory
no
configure: error: OGRCoordinateTransformation() does not return a
coord.trans:
PROJ.4 not available?
ERROR: configuration failed for package ‘sf’
I've tried creating a symlink to libgdal.so.20
, but this doesn't change the error at all.
Upvotes: 2
Views: 4598
Reputation: 1956
@Dave has given exact steps & Please follow the below steps with some more explanation.
/usr/local/lib
to e.g. /etc/ld.so.conf.d/libgdal-x86_64.conf
Please create the file libgdal-x86_64.conf if doesn't exists.#echo "/usr/local/lib" >> /etc/ld.so.conf.d/libgdal-x86_64.conf
#ldconfig
GEOS,GDAL,PROJ
installed on your system.#yum install proj.x86_64 proj-devel.x86_64 proj-epsg.x86_64 proj-nad.x86_64 geos*
Try again
install.packages("sf")
Thanks hope this helps
Upvotes: 1
Reputation: 11
For anyone else who has a multi-user/multi-computer environment with the need to have multiple versions of various pieces of software installed, I fixed my issue with:
install.packages('sf',configure.args='--with-gdal-config=/sw/gdal/2.2.3-gcc4/bin/gdal-config --with-proj-include=/sw/proj/4.9.3-gcc4/include --with-proj-lib=/sw/proj/4.9.3-gcc4/lib --with-proj-share=/sw/proj/4.9.3-gcc4/share/proj')
Obviously you may/would have to alter path names from what I have.
Upvotes: 0
Reputation: 64
/usr/local/lib
to e.g. /etc/ld.so.conf.d/libgdal-x86_64.conf
Upvotes: 4