r-spatial / discuss

a discussion repository: raise issues, or contribute!
54 stars 12 forks source link

Installation of rgdal on Ubuntu #39

Closed Robinlovelace closed 4 years ago

Robinlovelace commented 4 years ago

I'm having issues installing the latest version of rgdal. I've tried the following after posting and following a thread on the r-sig-geo email list but it's still not working. Does anyone have any suggestions? Thanks!

list.files("/opt/proj/")
#> [1] "bin"     "include" "lib"     "share"
    install.packages(
        "rgdal",
        configure.args = c(
            "--with-proj-include=/opt/proj/include",
            "--with-proj-lib=/opt/proj/lib"
        )
    )
#> Installing package into '/home/robin/R/x86_64-pc-linux-gnu-library/3.6'
#> (as 'lib' is unspecified)
#> Warning in install.packages("rgdal", configure.args = c("--with-proj-include=/
#> opt/proj/include", : installation of package 'rgdal' had non-zero exit status

Created on 2020-06-01 by the reprex package (v0.3.0)

Session info ``` r devtools::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 3.6.3 (2020-02-29) #> os Ubuntu 18.04.4 LTS #> system x86_64, linux-gnu #> ui X11 #> language en_GB:en #> collate en_GB.UTF-8 #> ctype en_GB.UTF-8 #> tz Europe/London #> date 2020-06-01 #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date lib source #> assertthat 0.2.1 2019-03-21 [2] CRAN (R 3.6.0) #> backports 1.1.7 2020-05-13 [1] CRAN (R 3.6.3) #> callr 3.4.3 2020-03-28 [1] CRAN (R 3.6.3) #> cli 2.0.2 2020-02-28 [1] CRAN (R 3.6.2) #> crayon 1.3.4 2017-09-16 [2] standard (@1.3.4) #> desc 1.2.0 2018-05-01 [2] standard (@1.2.0) #> devtools 2.3.0 2020-04-10 [1] CRAN (R 3.6.3) #> digest 0.6.25 2020-02-23 [1] CRAN (R 3.6.2) #> ellipsis 0.3.1 2020-05-15 [3] CRAN (R 3.6.3) #> evaluate 0.14 2019-05-28 [2] CRAN (R 3.6.0) #> fansi 0.4.1 2020-01-08 [1] CRAN (R 3.6.2) #> fs 1.4.1 2020-04-04 [2] CRAN (R 3.6.3) #> glue 1.4.1 2020-05-13 [2] CRAN (R 3.6.3) #> highr 0.8 2019-03-20 [3] CRAN (R 3.5.3) #> htmltools 0.4.0.9003 2020-04-09 [1] Github (rstudio/htmltools@1a7d0dc) #> knitr 1.28 2020-02-06 [1] CRAN (R 3.6.2) #> magrittr 1.5 2014-11-22 [2] CRAN (R 3.5.2) #> memoise 1.1.0 2017-04-21 [3] CRAN (R 3.5.0) #> pkgbuild 1.0.8 2020-05-07 [1] CRAN (R 3.6.3) #> pkgload 1.1.0 2020-05-29 [3] CRAN (R 3.6.3) #> prettyunits 1.1.1 2020-01-24 [1] CRAN (R 3.6.2) #> processx 3.4.2 2020-02-09 [1] CRAN (R 3.6.3) #> ps 1.3.3 2020-05-08 [1] CRAN (R 3.6.3) #> R6 2.4.1 2019-11-12 [2] CRAN (R 3.6.1) #> remotes 2.1.1 2020-02-15 [1] CRAN (R 3.6.2) #> rlang 0.4.6.9000 2020-05-05 [1] Github (r-lib/rlang@4bea875) #> rmarkdown 2.1.2 2020-04-09 [1] Github (rstudio/rmarkdown@65dd144) #> rprojroot 1.3-2 2018-01-03 [2] CRAN (R 3.5.3) #> sessioninfo 1.1.1 2018-11-05 [3] CRAN (R 3.5.1) #> stringi 1.4.6 2020-02-17 [1] CRAN (R 3.6.2) #> stringr 1.4.0 2019-02-10 [2] standard (@1.4.0) #> testthat 2.3.2 2020-03-02 [1] CRAN (R 3.6.3) #> usethis 1.6.1 2020-04-29 [1] CRAN (R 3.6.3) #> withr 2.2.0 2020-04-20 [2] CRAN (R 3.6.3) #> xfun 0.14 2020-05-20 [1] CRAN (R 3.6.3) #> yaml 2.2.1 2020-02-01 [1] CRAN (R 3.6.2) #> #> [1] /home/robin/R/x86_64-pc-linux-gnu-library/3.6 #> [2] /usr/local/lib/R/site-library #> [3] /usr/lib/R/site-library #> [4] /usr/lib/R/library ```
rsbivand commented 4 years ago

Please run from the command line and report the 00install log. I also emailed with a speculative idea.

Roger Bivand Falsensvei 32 5063 Bergen

man. 1. jun. 2020, 19:55 skrev Robin notifications@github.com:

I'm having issues installing the latest version of rgdal. I've tried the following after posting and following a thread on the r-sig-geo https://stat.ethz.ch/pipermail/r-sig-geo/2020-May/028155.html email list but it's still not working. Does anyone have any suggestions? Thanks!

list.files("/opt/proj/")

> [1] "bin" "include" "lib" "share"

install.packages(

    "rgdal",

    configure.args = c(

        "--with-proj-include=/opt/proj/include",

        "--with-proj-lib=/opt/proj/lib"

    )

)

> Installing package into '/home/robin/R/x86_64-pc-linux-gnu-library/3.6'

> (as 'lib' is unspecified)

> Warning in install.packages("rgdal", configure.args = c("--with-proj-include=/

> opt/proj/include", : installation of package 'rgdal' had non-zero exit status

Created on 2020-06-01 by the reprex package https://reprex.tidyverse.org (v0.3.0) Session info

devtools::session_info()

> ─ Session info ───────────────────────────────────────────────────────────────

> setting value

> version R version 3.6.3 (2020-02-29)

> os Ubuntu 18.04.4 LTS

> system x86_64, linux-gnu

> ui X11

> language en_GB:en

> collate en_GB.UTF-8

> ctype en_GB.UTF-8

> tz Europe/London

> date 2020-06-01

>

> ─ Packages ───────────────────────────────────────────────────────────────────

> package * version date lib source

> assertthat 0.2.1 2019-03-21 [2] CRAN (R 3.6.0)

> backports 1.1.7 2020-05-13 [1] CRAN (R 3.6.3)

> callr 3.4.3 2020-03-28 [1] CRAN (R 3.6.3)

> cli 2.0.2 2020-02-28 [1] CRAN (R 3.6.2)

> crayon 1.3.4 2017-09-16 [2] standard (@1.3.4)

> desc 1.2.0 2018-05-01 [2] standard (@1.2.0)

> devtools 2.3.0 2020-04-10 [1] CRAN (R 3.6.3)

> digest 0.6.25 2020-02-23 [1] CRAN (R 3.6.2)

> ellipsis 0.3.1 2020-05-15 [3] CRAN (R 3.6.3)

> evaluate 0.14 2019-05-28 [2] CRAN (R 3.6.0)

> fansi 0.4.1 2020-01-08 [1] CRAN (R 3.6.2)

> fs 1.4.1 2020-04-04 [2] CRAN (R 3.6.3)

> glue 1.4.1 2020-05-13 [2] CRAN (R 3.6.3)

> highr 0.8 2019-03-20 [3] CRAN (R 3.5.3)

> htmltools 0.4.0.9003 2020-04-09 [1] Github (rstudio/htmltools@1a7d0dc)

> knitr 1.28 2020-02-06 [1] CRAN (R 3.6.2)

> magrittr 1.5 2014-11-22 [2] CRAN (R 3.5.2)

> memoise 1.1.0 2017-04-21 [3] CRAN (R 3.5.0)

> pkgbuild 1.0.8 2020-05-07 [1] CRAN (R 3.6.3)

> pkgload 1.1.0 2020-05-29 [3] CRAN (R 3.6.3)

> prettyunits 1.1.1 2020-01-24 [1] CRAN (R 3.6.2)

> processx 3.4.2 2020-02-09 [1] CRAN (R 3.6.3)

> ps 1.3.3 2020-05-08 [1] CRAN (R 3.6.3)

> R6 2.4.1 2019-11-12 [2] CRAN (R 3.6.1)

> remotes 2.1.1 2020-02-15 [1] CRAN (R 3.6.2)

> rlang 0.4.6.9000 2020-05-05 [1] Github (r-lib/rlang@4bea875)

> rmarkdown 2.1.2 2020-04-09 [1] Github (rstudio/rmarkdown@65dd144)

> rprojroot 1.3-2 2018-01-03 [2] CRAN (R 3.5.3)

> sessioninfo 1.1.1 2018-11-05 [3] CRAN (R 3.5.1)

> stringi 1.4.6 2020-02-17 [1] CRAN (R 3.6.2)

> stringr 1.4.0 2019-02-10 [2] standard (@1.4.0)

> testthat 2.3.2 2020-03-02 [1] CRAN (R 3.6.3)

> usethis 1.6.1 2020-04-29 [1] CRAN (R 3.6.3)

> withr 2.2.0 2020-04-20 [2] CRAN (R 3.6.3)

> xfun 0.14 2020-05-20 [1] CRAN (R 3.6.3)

> yaml 2.2.1 2020-02-01 [1] CRAN (R 3.6.2)

>

> [1] /home/robin/R/x86_64-pc-linux-gnu-library/3.6

> [2] /usr/local/lib/R/site-library

> [3] /usr/lib/R/site-library

> [4] /usr/lib/R/library

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/r-spatial/discuss/issues/39, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNZ3BCB3XZ7V3WUTOWA5LDRUPTRLANCNFSM4NQAP2GA .

Robinlovelace commented 4 years ago

Thanks for quick reply and apologies for the hassle. This is what I got from the command line:

wget https://cran.r-project.org/src/contrib/rgdal_1.5-8.tar.gz
R CMD INSTALL 'rgdal_1.5-8.tar.gz' 
* installing to library ‘/home/robin/R/x86_64-pc-linux-gnu-library/3.6’
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
** using staged installation
configure: R_HOME: /usr/lib/R
configure: CC: gcc -std=gnu99
configure: CXX: g++ -std=gnu++11
configure: C++11 support available
configure: rgdal: 1.5-8
checking for /usr/bin/svnversion... no
configure: svn revision: 990
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 3.0.4
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/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/include/gdal
configure: PROJ LIBS:  -lproj
checking PROJ header API:... proj.h
./configure: line 2578: test: =: unary operator expected
checking Using GDAL < 3 with PROJ >= 6... ./configure: line 3892: test: too many arguments
no
checking PROJ version >= 4.8.0... ./configure: line 3908: test: -lt: unary operator expected
yes
./configure: line 3917: test: -lt: unary operator expected
./configure: line 3979: test: =: unary operator expected
checking PROJ: proj.db found and readable... yes
./configure: line 4119: test: =: unary operator expected
./configure: line 4196: test: =: unary operator expected
./configure: line 4261: test: : integer expression expected
./configure: line 4402: test: =: unary operator expected
./configure: line 4425: test: =: unary operator expected
./configure: line 4429: test: : integer expression expected
configure: Package CPP flags:  -I/usr/include/gdal
configure: Package LIBS:  -L/usr/lib -lgdal -lproj
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I"/home/robin/R/x86_64-pc-linux-gnu-library/3.6/sp/include"   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-V28x5H/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c OGR_write.cpp -o OGR_write.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I"/home/robin/R/x86_64-pc-linux-gnu-library/3.6/sp/include"   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-V28x5H/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -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"/home/robin/R/x86_64-pc-linux-gnu-library/3.6/sp/include"   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-V28x5H/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -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"/home/robin/R/x86_64-pc-linux-gnu-library/3.6/sp/include"   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-V28x5H/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c inverser.c -o inverser.o
inverser.c:5:10: fatal error: projects.h: No such file or directory
 #include <projects.h>
          ^~~~~~~~~~~~
compilation terminated.
/usr/lib/R/etc/Makeconf:168: recipe for target 'inverser.o' failed
make: *** [inverser.o] Error 1
ERROR: compilation failed for package ‘rgdal’
* removing ‘/home/robin/R/x86_64-pc-linux-gnu-library/3.6/rgdal’
* restoring previous ‘/home/robin/R/x86_64-pc-linux-gnu-library/3.6/rgdal’
Robinlovelace commented 4 years ago

I am also seeing issues with the dev version:

install.packages("rgdal", repos = "http://R-Forge.R-project.org")
Installing package into ‘/home/robin/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'http://R-Forge.R-project.org/src/contrib/rgdal_1.5-9.tar.gz'
Content type 'application/x-gzip' length 1823032 bytes (1.7 MB)
==================================================
downloaded 1.7 MB

* installing *source* package ‘rgdal’ ...
** using staged installation
configure: R_HOME: /usr/lib/R
configure: CC: gcc -std=gnu99
configure: CXX: g++ -std=gnu++11
configure: C++11 support available
configure: rgdal: 1.5-8
checking for /usr/bin/svnversion... no
cat: inst/SVN_VERSION: No such file or directory
configure: svn revision: 
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 3.0.4
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/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/include/gdal
configure: PROJ LIBS:  -lproj
checking PROJ header API:... proj.h
./configure: line 2578: test: =: unary operator expected
checking Using GDAL < 3 with PROJ >= 6... ./configure: line 3892: test: too many arguments
no
checking PROJ version >= 4.8.0... yes
./configure: line 3908: test: -lt: unary operator expected
./configure: line 3917: test: -lt: unary operator expected
./configure: line 3979: test: =: unary operator expected
checking PROJ: proj.db found and readable... yes
./configure: line 4119: test: =: unary operator expected
./configure: line 4196: test: =: unary operator expected
./configure: line 4261: test: : integer expression expected
./configure: line 4402: test: =: unary operator expected
./configure: line 4425: test: =: unary operator expected
./configure: line 4429: test: : integer expression expected
configure: Package CPP flags:  -I/usr/include/gdal
configure: Package LIBS:  -L/usr/lib -lgdal -lproj
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I"/home/robin/R/x86_64-pc-linux-gnu-library/3.6/sp/include"   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-V28x5H/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c OGR_write.cpp -o OGR_write.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I"/home/robin/R/x86_64-pc-linux-gnu-library/3.6/sp/include"   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-V28x5H/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -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"/home/robin/R/x86_64-pc-linux-gnu-library/3.6/sp/include"   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-V28x5H/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -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"/home/robin/R/x86_64-pc-linux-gnu-library/3.6/sp/include"   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-V28x5H/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c inverser.c -o inverser.o
inverser.c:5:10: fatal error: projects.h: No such file or directory
 #include <projects.h>
          ^~~~~~~~~~~~
compilation terminated.
/usr/lib/R/etc/Makeconf:168: recipe for target 'inverser.o' failed
make: *** [inverser.o] Error 1
ERROR: compilation failed for package ‘rgdal’
* removing ‘/home/robin/R/x86_64-pc-linux-gnu-library/3.6/rgdal’
* restoring previous ‘/home/robin/R/x86_64-pc-linux-gnu-library/3.6/rgdal’
Warning in install.packages :
  installation of package ‘rgdal’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpIW93xy/downloaded_packages’
rsbivand commented 4 years ago

R-forge has build issues, so you are only getting the released version from there unless you check out the source. Try http://spatial.nhh.no/R/rgdal for my build, or untar the released tarball and replace configure, configure.ac and DESCRIPTION with those from R-forge.

Roger Bivand Falsensvei 32 5063 Bergen

tir. 2. jun. 2020, 00:44 skrev Robin notifications@github.com:

I am also seeing issues with the dev version:

install.packages("rgdal", repos = "http://R-Forge.R-project.org")

Installing package into ‘/home/robin/R/x86_64-pc-linux-gnu-library/3.6’

(as ‘lib’ is unspecified)

trying URL 'http://R-Forge.R-project.org/src/contrib/rgdal_1.5-9.tar.gz'

Content type 'application/x-gzip' length 1823032 bytes (1.7 MB)

==================================================

downloaded 1.7 MB

  • installing source package ‘rgdal’ ...

** using staged installation

configure: R_HOME: /usr/lib/R

configure: CC: gcc -std=gnu99

configure: CXX: g++ -std=gnu++11

configure: C++11 support available

configure: rgdal: 1.5-8

checking for /usr/bin/svnversion... no

cat: inst/SVN_VERSION: No such file or directory

configure: svn revision:

checking for gdal-config... /usr/bin/gdal-config

checking gdal-config usability... yes

configure: GDAL: 3.0.4

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/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/include/gdal

configure: PROJ LIBS: -lproj

checking PROJ header API:... proj.h

./configure: line 2578: test: =: unary operator expected

checking Using GDAL < 3 with PROJ >= 6... ./configure: line 3892: test: too many arguments

no

checking PROJ version >= 4.8.0... yes

./configure: line 3908: test: -lt: unary operator expected

./configure: line 3917: test: -lt: unary operator expected

./configure: line 3979: test: =: unary operator expected

checking PROJ: proj.db found and readable... yes

./configure: line 4119: test: =: unary operator expected

./configure: line 4196: test: =: unary operator expected

./configure: line 4261: test: : integer expression expected

./configure: line 4402: test: =: unary operator expected

./configure: line 4425: test: =: unary operator expected

./configure: line 4429: test: : integer expression expected

configure: Package CPP flags: -I/usr/include/gdal

configure: Package LIBS: -L/usr/lib -lgdal -lproj

configure: creating ./config.status

config.status: creating src/Makevars

** libs

g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I"/home/robin/R/x86_64-pc-linux-gnu-library/3.6/sp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-V28x5H/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c OGR_write.cpp -o OGR_write.o

g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I"/home/robin/R/x86_64-pc-linux-gnu-library/3.6/sp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-V28x5H/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -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"/home/robin/R/x86_64-pc-linux-gnu-library/3.6/sp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-V28x5H/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -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"/home/robin/R/x86_64-pc-linux-gnu-library/3.6/sp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-V28x5H/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c inverser.c -o inverser.o

inverser.c:5:10: fatal error: projects.h: No such file or directory

include

      ^~~~~~~~~~~~

compilation terminated.

/usr/lib/R/etc/Makeconf:168: recipe for target 'inverser.o' failed

make: *** [inverser.o] Error 1

ERROR: compilation failed for package ‘rgdal’

  • removing ‘/home/robin/R/x86_64-pc-linux-gnu-library/3.6/rgdal’

  • restoring previous ‘/home/robin/R/x86_64-pc-linux-gnu-library/3.6/rgdal’

Warning in install.packages :

installation of package ‘rgdal’ had non-zero exit status

The downloaded source packages are in

‘/tmp/RtmpIW93xy/downloaded_packages’

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/r-spatial/discuss/issues/39#issuecomment-637164240, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNZ3BBTX5HMRAXC2Y72OYDRUQVNRANCNFSM4NQAP2GA .

mdsumner commented 4 years ago

Your site is unresponsive to me. So, with a spare moment.

Would you please consider moving rgdal to github?

(It's not just rgdal, I think the same of other projects, rgl in particular would benefit from a move into the light, fwiw).

rsbivand commented 4 years ago

Power outage at my (closed campus) office, I'll try to get there sometime to reboot my desktop, was up on Sunday morning - (Monday was free here). Tarball here: rgdal_1.5-9.tar.gz

rsbivand commented 4 years ago

The idea was to encourage users and maintainers to migrate to sf, stars, terra, hence rgdal was in maintenancce-only mode until the Proj4->WKT2 migration was forced on us. Being on Github would suggest active development, R-forge is less accessible, so easier to handle because of fewer PRs etc., with new functionality which should go to stars, terra, sf, etc. Does this make sense?

mdsumner commented 4 years ago

Very good, thank you!

 library(rgdal)
Loading required package: sp
rgdal: version: 1.5-9, (SVN revision 995)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 3.0.4, released 2020/01/28
Path to GDAL shared files: /usr/share/gdal
GDAL binary built with GEOS: TRUE
Loaded PROJ runtime: Rel. 7.0.0, March 1st, 2020, [PJ_VERSION: 700]
Path to PROJ shared files: /perm_storage/home/mdsumner/.local/share/proj:/usr/share/proj
PROJ CDN enabled:FALSE
Linking to sp version:1.4-2
To mute warnings of possible GDAL/OSR exportToProj4() degradation,
use options("rgdal_show_exportToProj4_warnings"="none") before loading rgdal.
> sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.4 LTS
...
other attached packages:
[1] rgdal_1.5-9 sp_1.4-2
...
mdsumner commented 4 years ago

I understand the idea of stifling a legacy project in favour of new, but I think it's a mistake in this instance - is it working? To me it comes down to whether you want involvement of others, or not.

Robinlovelace commented 4 years ago

Great to see another tarball, many thanks Roger! I think this is getting closer but it failed with a different error message this time:

R CMD INSTALL 'rgdal_1.5-9.tar.gz' 
* installing to library ‘/home/robin/R/x86_64-pc-linux-gnu-library/3.6’
* installing *source* package ‘rgdal’ ...
** using staged installation
configure: R_HOME: /usr/lib/R
configure: CC: gcc -std=gnu99
configure: CXX: g++ -std=gnu++11
./configure: line 2088: 6: command not found
configure: C++11 support available
configure: rgdal: 1.5-9
checking for /usr/bin/svnversion... no
configure: svn revision: 995
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 3.0.4
checking GDAL version >= 1.11.4... yes
checking GDAL version <= 2.5 or >= 3.0... yes
checking gdal: linking with --libs only... no
checking gdal: linking with --libs and --dep-libs... no
./configure: line 2361: ERROR:: command not found
./configure: line 2376: ERROR:: command not found
configure: Install failure: compilation and/or linkage problems.
configure: error: GDALAllRegister not found in libgdal.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/robin/R/x86_64-pc-linux-gnu-library/3.6/rgdal’
* restoring previous ‘/home/robin/R/x86_64-pc-linux-gnu-library/3.6/rgdal’
Robinlovelace commented 4 years ago

How did you get it to install @mdsumner ? Seem you're also on Ubuntu.

mdsumner commented 4 years ago

I did exactly as you did.

R CMD INSTALL rgdal_1.5-9.tar.gz

FWIW, it did not work for me a few days ago -checked out from rforge - with PROJ 7.0.0 - I had the same error as your OP, about "projects.h".

edzer commented 4 years ago

It worked for me too. Robin, what is the output fo

R CMD config CXX

on your machine?

Robinlovelace commented 4 years ago

I get this:

R CMD config CXX                  
g++ -std=gnu++11
edzer commented 4 years ago

And what is your output of

gdal-config --libs
gdal-config --dep-libs
Robinlovelace commented 4 years ago

I see:

gdal-config --libs
-L/usr/lib -lgdal
gdal-config --dep-libs
-lcrypto -lpoppler -ljson-c -L/usr/lib -lfreexl -lqhull -lqhull -L/usr/lib/x86_64-linux-gnu -lgeos_c -lwebp -L/usr/lib -lepsilon -lodbc -lodbcinst -lkmlbase -lkmldom -lkmlengine -lkmlxsd -lkmlregionator -lexpat -lxerces-c -lpthread -lopenjp2 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu/hdf5/serial -lnetcdf -lhdf5_hl -lhdf5 -lpthread -lsz -lz -ldl -lm -lcurl -L/usr/lib/x86_64-linux-gnu/hdf5/serial/lib -lhdf5 -lmfhdfalt -ldfalt -logdi -lgif -lCharLS -ljpeg -lgeotiff -ltiff -lpng -lcfitsio -lpq -lzstd -llzma -lproj -lz -lpthread -lm -lrt -ldl -ldapclient -ldapserver -ldap -L/usr/lib -lspatialite -lpcre -lcurl -lfyba -lfygm -lfyut -lxml2 -L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -latomic -lssl -lcrypto -ldl
rsbivand commented 4 years ago

See https://r-forge.r-project.org/R/?group_id=884&log=build_src&pkg=rgdal&flavor=patched for the current R-forge settings. When it gets to rev 997, it may improve, because I backed out of a CRAN suggestion to replace all -a in configure.ac with &&. 996 had && and the failures you see, 997 has -a as had versions <= 990.

So not R, not GDAL, but differences in handling bash scripts?

edzer commented 4 years ago

Oh, I still have to wake up. It seems things went wrong on line 2088 of configure, meaning CXX11 doesn't get properly set, and you're working with R < 4.0. I still don't see why, though.

edzer commented 4 years ago

Yeah, it might be the use of && -- sf doesn't have any of these.

This points to another, growing problem: all R packages using GDAL, GEOS and/or PROJ use, afaict, autoconf on a configure.ac script they picked up at some stage from another package (except for rgdal, who was there first). Maintaining these is getting more and more a nightmare (for me at least) as nobody sees which problems are raised and solved by whom, and where.

Robinlovelace commented 4 years ago

I can upgrade to R 4.0.0, been putting it off too long on my main desktop, waiting to complete a contract...

edzer commented 4 years ago

If you do, it will take us longer to fix this problem.

Robinlovelace commented 4 years ago

Staying with R 3.6.3 works for me for now, was planning to wait until the point release of Ubuntu 20.04 but my natural impatience may get the better of me!

Robinlovelace commented 4 years ago

Let me know if there's anything I can do to support this, including editing configure files iteratively until it works.

rsbivand commented 4 years ago

@edzer: do we need a side repo for configure.ac?

edzer commented 4 years ago

Yes, and someone to set it up & maintain it!

rsbivand commented 4 years ago

Brian Ripley provided a patch for rgdal's configure.ac, and the R-forge build and check processes now succeed, so please try to install either downloading http://download.r-forge.r-project.org/src/contrib/rgdal_1.5-9.tar.gz and installing from the command line (after running R CMD check), or install.packages("rgdal", repos="http://R-Forge.R-project.org").

Robinlovelace commented 4 years ago

Very happy to say: the patch worked! Huge thanks to you Roger, Brian and everyone involved. To celebrate the occasion I created this exciting video to show the install process :tada:

asciicast

Robinlovelace commented 4 years ago

I think we can close this but may be worth leaving open for a bit to make the solution more prominent for now.

rsbivand commented 4 years ago

I agree, somewhere to point people.

vinciuna commented 4 years ago

Im facing issue while installingrgdal` on Linux:

** testing if installed package can be loaded from temporary location

 *** caught segfault ***
address 0x55a130000000, cause 'memory not mapped'
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault (core dumped)
ERROR: loading failed
* removing ‘/home/kk/R/x86_64-pc-linux-gnu-library/4.0/rgdal’
Warning in install.packages :
  installation of package ‘rgdal’ had non-zero exit status

 > sessioninfo::platform_info()
 setting  value                       
 version  R version 4.0.2 (2020-06-22)
 os       Ubuntu 20.04.1 LTS          
 system   x86_64, linux-gnu           
 ui       RStudio                     
 language en_US:en                    
 collate  lt_LT.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       Europe/Vilnius              
 date     2020-08-13                

any clue? hint? where to start digging? thanks a lot in advance for any support!

vinciuna commented 4 years ago

OK, seems this worked for me - PURGEd ALL GDAL/PROJ/GEOS packages from system and reinstalled from scratch. This solved the above.

florisvdh commented 4 years ago

To inform you, as I came by this issue just now. Somewhere end Aug - beginning Sep I installed Linux Mint 20 (uses Ubuntu 20.04 repo), i.e. with GDAL & PROJ from Ubuntu. Plus R 4.0, plus rgdal etc.

It all worked like a breeze, no problems at all!! From skimming through this issue, it seems that I owe a big THANK YOU ! :clap: :clap: :clap: :rocket:

Robinlovelace commented 4 years ago

Good to hear @florisvdh and thanks for the follow-up, useful to know and encouraging! I suggest we can close this issue now new CRAN versions have been up for a while and everything seems to be settling down. There is still the question of OSGeo library versions but I think the default versions on 20.04 will be good for the foreseeable.

Robinlovelace commented 4 years ago

Closing as I think this is sorted. Onto bigger questions (feel free to reopen anyone if I'm jumping the gun)!

r2evans commented 3 years ago

FYI, I ran into the same error of

configure: pkg-config proj not available
  set PKG_CONFIG_PATH to the directory containing proj.pc

I found that apt-get -y install libproj-dev allowed me to compile and install rgdal in R.