It seems that the current version of GEOS available on shinyapps.io is not at the right level.
This is the error message I am getting when trying to deploy my app:
** package ‘lwgeom’ successfully unpacked and MD5 sums checked
** using staged installation configure: CC: gcc configure: CXX: g++ -std=gnu++11 configure: pkg-config proj exists, will use it configure: PROJ: 4.9.2 checking for pj_init_plus in -lproj... yes
checking PROJ:
epsg found and readable... yes configure: POSTGIS_PROJ_VERSION: 49
checking for geos-config... /usr/bin/geos-config checking geos-config
usability... yes configure: GEOS: 3.5.1 checking GEOS version >=
3.6.0... no
configure: error: upgrade GEOS to 3.6.0 or later
ERROR: configuration failed for package ‘lwgeom’
removing ‘/opt/R/4.0.0/lib/R/library/lwgeom’
Is there anything I could do to by-pass this problem waiting for an update on the shiny apps side?
Thank you in advance.
Related
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.
I tried to install rgdal package in R on my Mac machine, but the error message came out as below:
Installing package into ‘/Users/isong/Library/R/4.0/library’
(as ‘lib’ is unspecified)
* installing *source* package ‘rgdal’ ...
** using staged installation
configure: R_HOME: /usr/local/lib/R
configure: CC: gcc
configure: CXX: g++ -std=gnu++11
configure: CFLAGS: -g -O2
configure: CPPFLAGS: -I/usr/local/include
configure: CXXFLAGS: -g -O2
configure: LDFLAGS: -L/usr/local/lib
configure: LDFLAGS: -L/usr/local/lib
configure: CXX11 is: g++, CXX11STD is: -std=gnu++11
configure: CXX is: g++ -std=gnu++11
configure: C++11 support available
configure: rgdal: 1.5-19
checking for /usr/bin/svnversion... no
cat: inst/SVN_VERSION: No such file or directory
configure: svn revision:
checking for gdal-config... /usr/local/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 3.0.2
checking GDAL version >= 1.11.4... yes
checking GDAL version <= 2.5 or >= 3.0... yes
checking GDAL: linking with --libs only... yes
checking GDAL: gdal-config data directory readable... yes
checking GDAL: /usr/local/share/gdal/stateplane.csv readable... yes
configure: pkg-config proj not available
set PKG_CONFIG_PATH to the directory containing proj.pc
configure: PROJ version not determined using pkg-config proj
configure: PROJ CPP flags: -I/usr/local/include
configure: PROJ LIBS: -lproj
checking PROJ header API:... yes
configure: API to be used as yet undetermined, searching ...
configure: Using API: proj.h
checking whether the C++ compiler works... yes
[truncated]
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 proj.h usability... yes
checking proj.h presence... yes
checking for proj.h... yes
checking for proj_context_create in -lproj... yes
checking Using GDAL < 3 with PROJ >= 6... no
checking PROJ version >= 4.8.0... yes
checking PROJ: proj.db found and readable... yes
configure: Package CPP flags: -I/usr/local/include -DPROJ_H_API
configure: Package LIBS: -L/usr/local/lib -lgdal -lproj
configure: creating ./config.status
config.status: creating src/Makevars
** libs
[truncated]
installing to /Users/isong/Library/R/4.0/library/00LOCK-rgdal/00new/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 from temporary location
Error: package or namespace load failed for ‘rgdal’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Users/isong/Library/R/4.0/library/00LOCK-rgdal/00new/rgdal/libs/rgdal.so':
dlopen(/Users/isong/Library/R/4.0/library/00LOCK-rgdal/00new/rgdal/libs/rgdal.so, 6): Library not loaded: #rpath/libproj.19.dylib
Referenced from: /Users/isong/Library/R/4.0/library/00LOCK-rgdal/00new/rgdal/libs/rgdal.so
Reason: image not found
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Users/isong/Library/R/4.0/library/rgdal’
* restoring previous ‘/Users/isong/Library/R/4.0/library/rgdal’
For your reference, I already configured and installed libproj, gdal, and geos in my machine and all of the dynamic libraries are located in /usr/local/lib.
Thank you.
I've had sf and rproj working on mac forever, and still working since upgrading to Catalina / R 3.6.2.
I tried to install the latest version of sf (0.9.0), both from CRAN and the dev version, and get errors both ways, configure: error: libproj not found in standard or given locations.
I've gone through and removed every last trace of gdal and proj on my computer, uninstalled both, reinstalled, and still same issue. And now, trying to install older versions of sf (0.8.1) that I know worked on my computer also fails. Absolutely stumped here!
GDAL 2.4.4, released 2020/01/08
R v3.6.2
macOS 10.15.3
configure: CC: clang
configure: CXX: clang++ -std=gnu++11
checking for gdal-config... /usr/local/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.4.4
checking GDAL version >= 2.0.1... 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... 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/local/Cellar/gdal/2.4.4_2/share/gdal/pcs.csv readable... yes
checking GDAL: checking whether PROJ is available for linking:... yes
checking GDAL: checking whether PROJ is available fur running:... yes
configure: GDAL: 2.4.4
checking proj.h usability... yes
checking proj.h presence... yes
checking for proj.h... yes
checking PROJ: checking whether PROJ and sqlite3 are available for linking:... no
configure: error: libproj not found in standard or given locations.
for rgdal...
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
** using staged installation
configure: R_HOME: /Library/Frameworks/R.framework/Resources
configure: CC: clang
configure: CXX: clang++ -std=gnu++11
configure: C++11 support available
configure: rgdal: 1.4-7
checking for /usr/bin/svnversion... yes
configure: svn revision: 845
checking for gdal-config... /usr/local/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.4.4
checking C++11 support for GDAL >= 2.3.0... yes
checking GDAL version >= 1.11.4... yes
checking GDAL version <= 2.5 or >= 3.0... yes
checking gdal: linking with --libs only... yes
checking GDAL: gdal-config data directory readable... yes
checking GDAL: /usr/local/Cellar/gdal/2.4.4_2/share/gdal/pcs.csv readable... yes
configure: pkg-config proj not available
set PKG_CONFIG_PATH to the directory containing proj.pc
configure: PROJ version not determined using pkg-config proj
configure: proj CPP flags: -I/usr/local/Cellar/gdal/2.4.4_2/include
configure: PROJ LIBS: -lproj
checking PROJ header API:... proj_api.h
checking proj_api.h presence and usability... no
configure: error: proj_api.h not found in standard or given locations.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rgdal
Finally found a solution after many hours of digging here if anyone else comes across this problem.
A solution that works for me. I have posted it in:
https://biostatsr.blogspot.com/2021/05/install-sf-from-github-source-in-macosx.html
In terminal. You must have MacBrew installed. If not, use:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then
brew install proj
brew install gdal
brew install geos
sudo R
Then in R:
library("devtools")
install_github("r-spatial/sf", configure.args = "--with-proj-include=/usr/local/include --with-proj-lib=/usr/local/lib")
And...
packageVersion("sf")
[1] ‘0.9.9’
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
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?