libgdal.so.20 issue centos rgdal - centos6

Can someone help me to understanding what is the problem of rgdal ?
I installed gdal 2 for centos 6 64 bits but i didn't succeed to install rgdal.
I tried to figure out what is the issue but i didn't found anything useful on the internet .
this is Rstudio-server console:
install.packages("rgdal")
Installing package into ‘/home/admin/R/x86_64-redhat-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
essai de l'URL 'https://cran.rstudio.com/src/contrib/rgdal_1.2-18.tar.gz'
Content type 'application/x-gzip' length 1650578 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ correctement décompressé et sommes MD5 vérifiées
configure: CC: gcc -m64 -std=gnu99
configure: CXX: g++ -m64
configure: rgdal: 1.2-18
checking for /usr/bin/svnversion... yes
configure: svn revision: 718
checking for gdal-config... /usr/local/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.2.3
checking GDAL version >= 1.6.3... yes
checking gdal: linking with --libs only... yes
checking GDAL: /usr/local/share/gdal/pcs.csv readable... yes
configure: -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack- protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC -I/usr/local/include
checking proj_api.h presence and usability... yes
./proj_conf_test1: error while loading shared libraries: libgdal.so.20: cannot open shared object file: No such file or directory
checking PROJ.4 version: ... < 4.8.0
./configure: line 2030: test: -eq: unary operator expected
./configure: line 2035: test: -ge: unary operator expected
./configure: line 2063: test: -ge: unary operator expected
./proj_conf_test2: error while loading shared libraries: libgdal.so.20: cannot open shared object file: No such file or directory
checking PROJ.4: epsg found and readable... yes
./configure: line 2138: test: -ge: unary operator expected
./proj_conf_test3: error while loading shared libraries: libgdal.so.20: cannot open shared object file: No such file or directory
checking PROJ.4: conus found and readable... yes
configure: Package CPP flags: -I/usr/local/include
configure: Package LIBS: -L/usr/local/lib -lgdal -lproj
configure: creating ./config.status
config.status: creating src/Makevars
** libs
ogr_geom.cpp:39: attention : ‘mp_count_k0’ may be used uninitialized in this function
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
converting help for package ‘rgdal’
finding HTML links ... fini
CRS-class html
...
closeDataset-methods html
displayDataset html
llgrid html
Rd warning: /tmp/RtmpTT9ff6/R.INSTALL19d55c4b60f4/rgdal/man/llgrid.Rd:11: missing file link ‘Spatial’
Rd warning: /tmp/RtmpTT9ff6/R.INSTALL19d55c4b60f4/rgdal/man/llgrid.Rd:16: missing file link ‘gridat’
Rd warning: /tmp/RtmpTT9ff6/R.INSTALL19d55c4b60f4/rgdal/man/llgrid.Rd:17: missing file link ‘gridat’
make_EPSG html
nor2k html
projInfo html
project html
readGDAL html
Rd warning: /tmp/RtmpTT9ff6/R.INSTALL19d55c4b60f4/rgdal/man/readGDAL.Rd:136: missing file link ‘flipVertical’
readOGR html
showWKT html
spTransform-methods html
wrappers html
writeOGR html
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘rgdal’ in dyn.load(file, DLLpath = DLLpath, ...):
impossible de charger l'objet partagé '/home/admin/R/x86_64-redhat- linux-gnu-library/3.4/rgdal/libs/rgdal.so':
libgdal.so.20: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
Erreur : le chargement a échoué
Exécution arrêtée
ERROR: loading failed
* removing ‘/home/admin/R/x86_64-redhat-linux-gnu-library/3.4/rgdal’
Warning in install.packages :
installation of package ‘rgdal’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpBon7nM/downloaded_packages’
I tried to install dependencies of gdal and copying libgdal.so.20 to /user/lib64/ogdi whithout any success !*
Thank you for you help

The solution was so simple !
CentOS can't find these libraries and I just copied these libraries to 64 folder .
cp /usr/local/lib/libgdal.so.20* /usr/lib64/
and everything work like a magic !

Related

MacOS M1: problems with installing sf in R - ERROR: compilation failed for package ‘classInt’; ERROR: configuration failed for package ‘units’

I am working on a MacOS Monterey with an M1 chip and have R 4.2.1 arm64 version (build 554). In the last two months I have come across an issue with install.package("sf") and others but will start with sf. When it asks to install from sources and I enter "No", the library won't load so I enter "Yes" and it gets an error (full error below).
ERROR: compilation failed for package ‘classInt’
ERROR: configuration failed for package ‘units’
I have redownloaded the sf, classInt, units, and udunits2 packages from this link (https://cran.r-project.org/web/packages/available_packages_by_name.html), choosing the r re-release arm64 versions and it still doesn't work.
I tried following along with this https://github.com/r-spatial/sf/issues/1542 until the .configure command was not found in the terminal.
I then tried: brew install udunits in the Mac terminal using Homebrew and the error did not change.
I installed sf defining the library with udunits2 and it didn't work:
install.packages("sf", configure.args = "--/Library/Frameworks/R.framework/Versions/4.2/Resources/library/udunits2")
I've spent over a full day troubleshooting and I'm not sure what to try next.
Any help is appreciated!
> install.packages("sf", configure.args = "--/Library/Frameworks/R.framework/Versions/4.2/Resources/library/udunits2")
also installing the dependencies ‘classInt’, ‘units’
Packages which are only available in source form, and may need compilation of C/C++/Fortran: ‘classInt’ ‘units’ ‘sf’
Do you want to attempt to install these from sources? (Yes/no/cancel) Yes
installing the source packages ‘classInt’, ‘units’, ‘sf’
trying URL 'https://packagemanager.rstudio.com/all/latest/src/contrib/classInt_0.4-7.tar.gz'
Content type 'binary/octet-stream' length 440183 bytes (429 KB)
==================================================
downloaded 429 KB
trying URL 'https://packagemanager.rstudio.com/all/latest/src/contrib/units_0.8-0.tar.gz'
Content type 'binary/octet-stream' length 864506 bytes (844 KB)
==================================================
downloaded 844 KB
trying URL 'https://packagemanager.rstudio.com/all/latest/src/contrib/sf_1.0-8.tar.gz'
Content type 'binary/octet-stream' length 3532612 bytes (3.4 MB)
==================================================
downloaded 3.4 MB
* installing *source* package ‘classInt’ ...
** package ‘classInt’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
/opt/R/arm64/bin/gfortran -mtune=native -fno-optimize-sibling-calls -fPIC -Wall -g -O2 -c fish1.f -o fish1.o
make: /opt/R/arm64/bin/gfortran: No such file or directory
make: *** [fish1.o] Error 1
ERROR: compilation failed for package ‘classInt’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/classInt’
Warning in install.packages :
installation of package ‘classInt’ had non-zero exit status
* installing *source* package ‘units’ ...
** package ‘units’ successfully unpacked and MD5 sums checked
** using staged installation
configure: units: 0.8-0
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++ -arch arm64 -std=gnu++14 accepts -g... yes
checking how to run the C++ preprocessor... clang++ -arch arm64 -std=gnu++14 -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 for stdbool.h that conforms to C99... no
checking for _Bool... no
checking for error_at_line... no
checking for gcc... clang -arch arm64
checking whether we are using the GNU C compiler... yes
checking whether clang -arch arm64 accepts -g... yes
checking for clang -arch arm64 option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... yes
checking udunits2.h usability... no
checking udunits2.h presence... no
checking for udunits2.h... no
checking udunits2/udunits2.h usability... no
checking udunits2/udunits2.h presence... no
checking for udunits2/udunits2.h... no
checking for ut_read_xml in -ludunits2... no
configure: error: in `/private/var/folders/4k/f9g3wpqj2tv7rvsmhjtkbdl80000gn/T/Rtmp6uUpFo/R.INSTALL1845f210c2dbd/units':
configure: error:
--------------------------------------------------------------------------------
Configuration failed because libudunits2.so was not found. Try installing:
* deb: libudunits2-dev (Debian, Ubuntu, ...)
* rpm: udunits2-devel (Fedora, EPEL, ...)
* brew: udunits (OSX)
If udunits2 is already installed in a non-standard location, use:
--configure-args='--with-udunits2-lib=/usr/local/lib'
if the library was not found, and/or:
--configure-args='--with-udunits2-include=/usr/include/udunits2'
if the header was not found, replacing paths with appropriate values.
You can alternatively set UDUNITS2_INCLUDE and UDUNITS2_LIBS manually.
--------------------------------------------------------------------------------
See `config.log' for more details
ERROR: configuration failed for package ‘units’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/units’
Warning in install.packages :
installation of package ‘units’ had non-zero exit status
ERROR: dependencies ‘classInt’, ‘units’ are not available for package ‘sf’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/sf’
Warning in install.packages :
installation of package ‘sf’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/4k/f9g3wpqj2tv7rvsmhjtkbdl80000gn/T/RtmpPnpNin/downloaded_packages```
After installing gdal with homebrew, I used the link #wkl sent and the code install.packages('sf', configure.args = '--with-proj-include=/opt/homebrew/include/ --with-proj-lib=/opt/homebrew/lib/', configure.vars = 'GDAL_DATA=/opt/homebrew/opt/gdal/share/gdal/')
I am still having problems with other packages but sf loaded.

Problem installing rugarch package on MacOSx with error 'make: *** [RcppArmadillo.o] Error 127'

I'm trying to install the package, rugarch, for a class.
I am using MacOS Mojave 10.14.6 (18G3020).
I am using RStudio:
R version 3.5.1 (2018-07-02) -- "Feather Spray"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Most of the forums I searched on report the need for Xquartz, but I already have installed it.
I also and searched through
https://thecoatlessprofessor.com/programming/cpp/r-compiler-tools-for-rcpp-on-macos-before-r-3.6.0/
Wondering what to try next. I'm thinking the problem has to do with my file path, which may have been mucked up from installing both clang4 and clang6?......
Error message below involves a compiler issue: 'make: *** [RcppArmadillo.o] Error 127'.
Thanks for your help!
> install.packages('rugarch')
also installing the dependency ‘RcppArmadillo’
trying URL 'https://mran.microsoft.com/snapshot/2018-08-01/src/contrib/RcppArmadillo_0.8.600.0.0.tar.gz'
Content type 'application/octet-stream' length 1356993 bytes (1.3 MB)
==================================================
downloaded 1.3 MB
trying URL 'https://mran.microsoft.com/snapshot/2018-08-01/src/contrib/rugarch_1.4-0.tar.gz'
Content type 'application/octet-stream' length 2936961 bytes (2.8 MB)
==================================================
downloaded 2.8 MB
* installing *source* package ‘RcppArmadillo’ ...
** package ‘RcppArmadillo’ successfully unpacked and MD5 sums checked
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 how to run the C++ preprocessor... clang++ -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether clang++ accepts -g... (cached) yes
checking whether g++ version is sufficient... almost
checking for macOS... configure: WARNING: Compiler self-identifies as being compliant with GNUC extensions but is not g++.
found
checking for macOS Apple compiler... not found
checking for clang compiler... found
checking for OpenMP compatible version of clang... found and suitable
checking LAPACK_LIBS... system LAPACK found
checking for OpenMP... found and suitable
configure: creating ./config.status
config.status: creating inst/include/RcppArmadilloConfigGenerated.h
config.status: creating src/Makevars
** libs
/usr/local/clang4/bin/clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/3.5.1-MRO/Resources/library/Rcpp/include" -DU_STATIC_IMPLEMENTATION -Wall -mtune=core2 -g -O2 -I/opt/X11/include -I../inst/include -fopenmp -fPIC -DU_STATIC_IMPLEMENTATION -Wall -mtune=core2 -g -O2 -I/opt/X11/include -c RcppArmadillo.cpp -o RcppArmadillo.o
/bin/sh: /usr/local/clang4/bin/clang++: No such file or directory
make: *** [RcppArmadillo.o] Error 127
ERROR: compilation failed for package ‘RcppArmadillo’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5.1-MRO/Resources/library/RcppArmadillo’
Warning in install.packages :
installation of package ‘RcppArmadillo’ had non-zero exit status
ERROR: dependency ‘RcppArmadillo’ is not available for package ‘rugarch’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5.1-MRO/Resources/library/rugarch’
Warning in install.packages :
installation of package ‘rugarch’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/bm/wg7t4j8j3tz_88yfzyfdkkhm0000gn/T/RtmpvkSK0v/downloaded_packages’

r - f951: internal compiler error: Illegal instruction: 4

I'm trying to install MVN package:
> install.packages("MVN")
probando la URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/MVN_5.5.tgz'
Content type 'application/x-gzip' length 382369 bytes (373 KB)
==================================================
downloaded 373 KB
The downloaded binary packages are in
/var/folders/79/xxghr9tj65789879v41wrp6h0000gn/T//Rtmp4bpod5/downloaded_packages
but when I do library(MVN) it says me that Error: package or namespace load failed for ‘MVN’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called ‘rrcov’
so when I try to install it:
> install.packages("rrcov")
There is a binary version available but the source version is later:
binary source needs_compilation
rrcov 1.4-4 1.4-7 TRUE
Do you want to install from sources the package which needs compilation? (Yes/no/cancel) yes
installing the source package ‘rrcov’
probando la URL 'https://cran.rstudio.com/src/contrib/rrcov_1.4-7.tar.gz'
Content type 'application/x-gzip' length 965680 bytes (943 KB)
==================================================
downloaded 943 KB
* installing *source* package ‘rrcov’ ...
** package ‘rrcov’ successfully unpacked and MD5 sums checked
** libs
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c R-rng4ftn.c -o R-rng4ftn.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c covOPW.c -o covOPW.o
gfortran -fPIC -g -O2 -c ds11.f -o ds11.o
gfortran: warning: couldn’t understand kern.osversion ‘15.6.0
f951: internal compiler error: Illegal instruction: 4
f951: internal compiler error: Abort trap: 6
gfortran: internal compiler error: Abort trap: 6 (program f951)
make: *** [ds11.o] Abort trap: 6
ERROR: compilation failed for package ‘rrcov’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rrcov’
Warning in install.packages :
installation of package ‘rrcov’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/79/xxghr9tj65789879v41wrp6h0000gn/T/Rtmp4bpod5/downloaded_packages’
I've searched how to fix that, installing XCode, reinstalling r, and nothing. I need this package to perfom some multivariate analysis for my thesis but I do not know how to fix it.
Any help will be appreciated.
Thanks!
I am using an iOS 10.11.6

when trying to install rgeos R cannot find -lgeos

I am trying to install rgeos in R 3.5.1 running in ubuntu 16.04. When I run
install.packages("rgeos")
I get the following message:
* installing *source* package ‘rgeos’ ...
** package ‘rgeos’ successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: rgeos: 0.4-1
checking for /usr/bin/svnversion... yes
configure: svn revision: 579
checking for geos-config... /usr/bin/geos-config
checking geos-config usability... yes
configure: GEOS version: 3.5.1
checking geos version at least 3.2.0... yes
checking geos-config clibs... yes
checking geos_c.h presence and usability... yes
checking geos: linking with libgeos_c... no
/usr/bin/ld: cannot find -lgeos
collect2: error: ld returned 1 exit status
configure: Install failure: compilation and/or linkage problems.
configure: error: initGEOS_r not found in libgeos_c.
ERROR: configuration failed for package ‘rgeos’
* removing ‘/home/rstudio/R/x86_64-pc-linux-gnu-library/3.5/rgeos’
Warning in install.packages :
installation of package ‘rgeos’ had non-zero exit status
I tried installing geospatial libraries
sudo apt-get install binutils libproj-dev gdal-bin
but it didn't help
Any help would be apprecieated
Same problem with R 3.5.1. This fixed the issue
sudo apt install libgeos++-dev

Cannot install Rgdal (Centos)

Hello I have a problem when I try to install RGDAL. If found other posts with similar problems, but the solutions were always limited to Debian distributions, can you help me on CentOs?
This is the error I have when running the following command in RStudio: > install.packages("rgdal", dependencies = T)
Installing package into ‘/home/dial/R/x86_64-redhat-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/rgdal_1.2-13.tar.gz'
Content type 'application/x-gzip' length 1648119 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: CC: gcc -m64 -std=gnu99
configure: CXX: g++ -m64
configure: rgdal: 1.2-13
checking for /usr/bin/svnversion... no
configure: svn revision: 686
checking for gdal-config... /home/dial/anaconda2/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.1.0
checking GDAL version >= 1.6.3... yes
checking gdal: linking with --libs only... no
checking gdal: linking with --libs and --dep-libs... no
followed by a bunch of lines like this one:
/usr/bin/ld: warning: libnetcdf.so.11, needed by /home/dial/anaconda2/lib/libgdal.so, not found (try using -rpath or -rpath-link)
and finally:
collect2: error: ld returned 1 exit status
configure: Install failure: compilation and/or linkage problems.
configure: error: GDALAllRegister not found in libgdal.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/dial/R/x86_64-redhat-linux-gnu-library/3.4/rgdal’
Warning in install.packages :
installation of package ‘rgdal’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmp8UHPBS/downloaded_packages’
This is done on a server, running on CentOS. I guess the following info might be helpful:
$ gdal-config --version
2.1.0
$ which gdal-config
~/anaconda2/bin/gdal-config
$ gdal-config --libs
-L/home/dial/anaconda2/lib -lgdal
Can you help me with this installation?

Resources