"caught segfault" when installing rgdal for tmap R package - r

My goal is to install tmap R package from CRAN. I have followed through this installation procedure prior to installing the tmap package:
https://github.com/mtennekes/tmap/blob/master/ubuntu_17_installation.sh
After install.packages("tmap") I receive an error message that identifies the problem to be with the rgdal package.
Calling install.packages("rgdal"), I received the following:
Beginning of Traceback error message:
installing to /home/larnsce/R/x86_64-pc-linux-gnu-library/3.4/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
*** caught segfault ***
address 0x1e, cause 'memory not mapped'
End of Traceback error message:
22: tools:::.test_load_package("rgdal", "/home/larnsce/R/x86_64-pc-linux-gnu-library/3.4")
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault
ERROR: loading failed
* removing ‘/home/larnsce/R/x86_64-pc-linux-gnu-library/3.4/rgdal’
My sessionInfo():
R version 3.4.2 (2017-09-28)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 17.04
Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.7.0
LAPACK: /usr/lib/lapack/liblapack.so.3.7.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=de_CH.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=de_CH.UTF-8
[6] LC_MESSAGES=en_US.UTF-8 LC_PAPER=de_CH.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=de_CH.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bindrcpp_0.2 ggalt_0.4.0 mapdata_2.2-6 maps_3.2.0 sp_1.2-5 ggmap_2.6.1 dplyr_0.7.4
[8] purrr_0.2.3 readr_1.1.1 tidyr_0.7.1 tibble_1.3.4 ggplot2_2.2.1.9000 tidyverse_1.1.1
loaded via a namespace (and not attached):
[1] reshape2_1.4.2 haven_1.1.0 lattice_0.20-35 colorspace_1.3-2 yaml_2.1.14 rlang_0.1.2 foreign_0.8-69
[8] glue_1.1.1 RColorBrewer_1.1-2 modelr_0.1.1 readxl_1.0.0 jpeg_0.1-8 bindr_0.1 plyr_1.8.4
[15] stringr_1.2.0 munsell_0.4.3 gtable_0.2.0 cellranger_1.1.0 rvest_0.3.2 RgoogleMaps_1.4.1 mapproj_1.2-5
[22] psych_1.7.5 labeling_0.3 knitr_1.17 forcats_0.2.0 extrafont_0.17 parallel_3.4.2 Rttf2pt1_1.3.4
[29] broom_0.4.2 proto_1.0.0 Rcpp_0.12.13 KernSmooth_2.23-15 geosphere_1.5-5 scales_0.5.0.9000 jsonlite_1.5
[36] proj4_1.0-8 mnormt_1.5-5 digest_0.6.12 rjson_0.2.15 hms_0.3 png_0.1-7 stringi_1.1.5
[43] ash_1.0-15 grid_3.4.2 tools_3.4.2 magrittr_1.5 lazyeval_0.2.0 extrafontdb_1.0 pkgconfig_2.0.1
[50] MASS_7.3-47 xml2_1.1.1 lubridate_1.6.0 assertthat_0.2.0 httr_1.2.1 R6_2.2.2 nlme_3.1-131
[57] compiler_3.4.2
Installing rgdal from source gives the following different segfault message:
*** caught segfault ***
address 0x7fe075206833, cause 'invalid permissions'
This might be relevant:
./configure: line 2112: 21315 Aborted ./proj_conf_test2
checking PROJ.4: epsg found and readable... yes
./configure: line 2187: 21324 Aborted ./proj_conf_test3
checking PROJ.4: conus found and readable... yes
Other related questions I have explored
trouble in installing rgdal on ubuntu 16.04
rgdal installation difficulty on ubuntu 16.04 LTS
This is also posted as an issue on GitHub
https://github.com/mtennekes/tmap/issues/150

Related

How can I download a package with 'invalid active developer path'? [duplicate]

I just upgraded R and R Studio to the most recent versions.
I am trying to load the package RHRV and R Studio aborts the session due to a fatal error. It is associated with the following error:
loading package: tcltk
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Loading required package: tkrplot
The command:
library("tcltk")
gives the following error message:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Warning message:
running command ''/usr/bin/otool' -L '/Library/Frameworks/R.framework/Resources/library/tcltk/libs//tcltk.so'' had status 1
Running the following command crashes R Studio:
library("tkrplot")
Here is some additional information of interest:
sessionInfo("tcltk")
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11 (El Capitan)
locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages:
[1] tcltk
loaded via a namespace (and not attached):
[1] Rcpp_0.12.2 Formula_1.2-1 cluster_2.0.3 magrittr_1.5 splines_3.2.2 MASS_7.3-43 grDevices_3.2.2
[8] munsell_0.4.2 colorspace_1.2-6 lattice_0.20-33 minqa_1.2.4 stringr_1.0.0 plyr_1.8.3 tools_3.2.2
[15] utils_3.2.2 nnet_7.3-10 grid_3.2.2 gtable_0.1.2 nlme_3.1-121 latticeExtra_0.6-26 stats_3.2.2
[22] datasets_3.2.2 survival_2.38-3 lme4_1.1-10 digest_0.6.8 base_3.2.2 Matrix_1.2-2 gridExtra_2.0.0
[29] RColorBrewer_1.1-2 nloptr_1.0.4 reshape2_1.4.1 ggplot2_1.0.1 acepack_1.3-3.3 graphics_3.2.2 effects_3.0-4
[36] rpart_4.1-10 stringi_1.0-1 methods_3.2.2 scales_0.3.0 Hmisc_3.17-0 lmerTest_2.0-29 foreign_0.8-65
[43] proto_0.3-10
sessionInfo("tkrplot")
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11 (El Capitan)
locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages:
character(0)
other attached packages:
[1] tkrplot_0.0-23
loaded via a namespace (and not attached):
[1] Rcpp_0.12.2 Formula_1.2-1 cluster_2.0.3 magrittr_1.5 splines_3.2.2 MASS_7.3-43 grDevices_3.2.2
[8] munsell_0.4.2 colorspace_1.2-6 lattice_0.20-33 minqa_1.2.4 stringr_1.0.0 plyr_1.8.3 tcltk_3.2.2
[15] tools_3.2.2 utils_3.2.2 nnet_7.3-10 grid_3.2.2 gtable_0.1.2 nlme_3.1-121 latticeExtra_0.6-26
[22] stats_3.2.2 datasets_3.2.2 survival_2.38-3 lme4_1.1-10 digest_0.6.8 base_3.2.2 Matrix_1.2-2
[29] gridExtra_2.0.0 RColorBrewer_1.1-2 nloptr_1.0.4 reshape2_1.4.1 ggplot2_1.0.1 acepack_1.3-3.3 graphics_3.2.2
[36] effects_3.0-4 rpart_4.1-10 stringi_1.0-1 methods_3.2.2 scales_0.3.0 Hmisc_3.17-0 lmerTest_2.0-29
[43] foreign_0.8-65 proto_0.3-10
Matt
With many thanks to Ben, I can provide a solution to the problem. The issue is that El Capitan has a somewhat unknown xcode issue.
Open the Terminal App and enter:
xcode-select --install
It takes a few minutes to load the patch needed to run xcode. The error described above is highlighted in several instances, and this was the workaround.
I then restarted my computer and loaded the package "tkrplot" directly from the source with the code:
install.packages("tkrplot", type="source")
Once I completed these three steps, I was able to load the package "RHRV" and the associated packages "tkrplot" and "tcltk" without issue.
You'll only have the "invalid active developer path" problem when you build package from source. If you use the pre-compiled versions from CRAN, you won't have to worry about it. Try
install.packages("tkrplot", type="binary")

Trouble installing rlang in R [duplicate]

I just upgraded R and R Studio to the most recent versions.
I am trying to load the package RHRV and R Studio aborts the session due to a fatal error. It is associated with the following error:
loading package: tcltk
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Loading required package: tkrplot
The command:
library("tcltk")
gives the following error message:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Warning message:
running command ''/usr/bin/otool' -L '/Library/Frameworks/R.framework/Resources/library/tcltk/libs//tcltk.so'' had status 1
Running the following command crashes R Studio:
library("tkrplot")
Here is some additional information of interest:
sessionInfo("tcltk")
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11 (El Capitan)
locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages:
[1] tcltk
loaded via a namespace (and not attached):
[1] Rcpp_0.12.2 Formula_1.2-1 cluster_2.0.3 magrittr_1.5 splines_3.2.2 MASS_7.3-43 grDevices_3.2.2
[8] munsell_0.4.2 colorspace_1.2-6 lattice_0.20-33 minqa_1.2.4 stringr_1.0.0 plyr_1.8.3 tools_3.2.2
[15] utils_3.2.2 nnet_7.3-10 grid_3.2.2 gtable_0.1.2 nlme_3.1-121 latticeExtra_0.6-26 stats_3.2.2
[22] datasets_3.2.2 survival_2.38-3 lme4_1.1-10 digest_0.6.8 base_3.2.2 Matrix_1.2-2 gridExtra_2.0.0
[29] RColorBrewer_1.1-2 nloptr_1.0.4 reshape2_1.4.1 ggplot2_1.0.1 acepack_1.3-3.3 graphics_3.2.2 effects_3.0-4
[36] rpart_4.1-10 stringi_1.0-1 methods_3.2.2 scales_0.3.0 Hmisc_3.17-0 lmerTest_2.0-29 foreign_0.8-65
[43] proto_0.3-10
sessionInfo("tkrplot")
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11 (El Capitan)
locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages:
character(0)
other attached packages:
[1] tkrplot_0.0-23
loaded via a namespace (and not attached):
[1] Rcpp_0.12.2 Formula_1.2-1 cluster_2.0.3 magrittr_1.5 splines_3.2.2 MASS_7.3-43 grDevices_3.2.2
[8] munsell_0.4.2 colorspace_1.2-6 lattice_0.20-33 minqa_1.2.4 stringr_1.0.0 plyr_1.8.3 tcltk_3.2.2
[15] tools_3.2.2 utils_3.2.2 nnet_7.3-10 grid_3.2.2 gtable_0.1.2 nlme_3.1-121 latticeExtra_0.6-26
[22] stats_3.2.2 datasets_3.2.2 survival_2.38-3 lme4_1.1-10 digest_0.6.8 base_3.2.2 Matrix_1.2-2
[29] gridExtra_2.0.0 RColorBrewer_1.1-2 nloptr_1.0.4 reshape2_1.4.1 ggplot2_1.0.1 acepack_1.3-3.3 graphics_3.2.2
[36] effects_3.0-4 rpart_4.1-10 stringi_1.0-1 methods_3.2.2 scales_0.3.0 Hmisc_3.17-0 lmerTest_2.0-29
[43] foreign_0.8-65 proto_0.3-10
Matt
With many thanks to Ben, I can provide a solution to the problem. The issue is that El Capitan has a somewhat unknown xcode issue.
Open the Terminal App and enter:
xcode-select --install
It takes a few minutes to load the patch needed to run xcode. The error described above is highlighted in several instances, and this was the workaround.
I then restarted my computer and loaded the package "tkrplot" directly from the source with the code:
install.packages("tkrplot", type="source")
Once I completed these three steps, I was able to load the package "RHRV" and the associated packages "tkrplot" and "tcltk" without issue.
You'll only have the "invalid active developer path" problem when you build package from source. If you use the pre-compiled versions from CRAN, you won't have to worry about it. Try
install.packages("tkrplot", type="binary")

How can I solve my problems with the installation of the text2vec package?

I'm trying to install the R package text2vec, I get the following error.
It says it cannot open a certain shared object file.
> install.packages("text2vec")
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/var/R/library/rsparse/libs/rsparse.so':
float.so: cannot open shared object file: No such file or directory
Calls: <Anonymous> ... asNamespace -> loadNamespace -> library.dynam -> dyn.load
Execution halted
ERROR: lazy loading failed for package ‘text2vec’
* removing ‘/var/R/library/text2vec’
Warning in install.packages :
installation of package ‘text2vec’ had non-zero exit status
This is my session info:
R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux
Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblasp-r0.3.3.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] readr_1.4.0 usethis_2.0.1 purrr_0.3.4 rebus_0.1-3 testthat_3.0.3 stringi_1.6.2 scales_1.1.1
[8] tictoc_1.0.1 ggplot2_3.3.3 topicmodels_0.2-12 udpipe_0.8.6 tidytext_0.3.1 tidyr_1.1.3 stringr_1.4.0
[15] dplyr_1.0.5 odbc_1.3.2
loaded via a namespace (and not attached):
[1] Rcpp_1.0.6 lubridate_1.7.10 lattice_0.20-41 assertthat_0.2.1 utf8_1.2.1 slam_0.1-48
[7] plyr_1.8.6 cellranger_1.1.0 R6_2.5.0 stats4_4.0.3 quanteda_3.1.0 pillar_1.5.1
[13] cld3_1.4.1 rlang_0.4.10 readxl_1.3.1 rstudioapi_0.13 data.table_1.14.0 blob_1.2.1
[19] Matrix_1.2-18 rebus.base_0.0-3 config_0.3.1 bit_4.0.4 munsell_0.5.0 compiler_4.0.3
[25] janeaustenr_0.1.5 xfun_0.24 pkgconfig_2.0.3 tidyselect_1.1.0 tibble_3.1.0 rebus.numbers_0.0-1
[31] fansi_0.4.2 crayon_1.4.1 dbplyr_2.1.1 withr_2.4.1 SnowballC_0.7.0 grid_4.0.3
[37] gtable_0.3.0 lifecycle_1.0.0 DBI_1.1.1 magrittr_2.0.1 tokenizers_0.2.1 RcppParallel_5.1.4
[43] cli_2.4.0 reshape2_1.4.4 fs_1.5.0 NLP_0.2-1 xml2_1.3.2 stopwords_2.2
[49] ellipsis_0.3.1 generics_0.1.0 vctrs_0.3.7 fastmatch_1.1-3 wordcloud_2.6 RColorBrewer_1.1-2
[55] tools_4.0.3 bit64_4.0.5 glue_1.4.2 rebus.unicode_0.0-2 hms_1.0.0 rebus.datetimes_0.0-1
[61] parallel_4.0.3 yaml_2.2.1 tm_0.7-8 colorspace_2.0-0 knitr_1.33 modeltools_0.2-23
Can someone help me?
The problem here is the float package and the way R installs dependencies when not using "staged installs". What you can do here is to first reinstall the float package, and once it is reinstalled, reinstall the rsparse package. If that still doesn't work - and this is specific to float which uses dynamic linking - perhaps try installing float manually, changing the configuration to ensure that it uses your currently installed BLAS library (here openblas).

R freezed after devtools::build_vignettes()

When I run devtools::build_vignettes() I get:
> devtools::build_vignettes()
Building OwenQ vignettes
Your system is ready to build packages!
And then R is freezed. Nothing happens, even after 15 minutes. No folder doc or inst/doc is created.
EDIT
I also tried the following with R 3.6.1:
> devtools::install(build_vignettes = TRUE)
Then I get
Your system is ready to build packages!
√ checking for file 'C:\MyPackages\OwenQ/DESCRIPTION' ...
- preparing 'OwenQ': (8.4s)
√ checking DESCRIPTION meta-information ...
- cleaning src
- installing the package to build vignettes (543ms)
creating vignettes ...
And same result: nothing else happens.
EDIT
Finally, devtools::install(build_vignettes = TRUE) has correctly created the vignettes! But there's no folder inst/doc in the package source folder, the vignettes only are in the package installed folder.
> sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=French_Belgium.1252 LC_CTYPE=French_Belgium.1252
[3] LC_MONETARY=French_Belgium.1252 LC_NUMERIC=C
[5] LC_TIME=French_Belgium.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] OwenQ_1.0.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.2 rstudioapi_0.10 knitr_1.22 magrittr_1.5
[5] usethis_1.5.1 devtools_2.1.0 pkgload_1.0.2 R6_2.4.0
[9] rlang_0.4.0 tools_3.5.3 pkgbuild_1.0.4 xfun_0.7
[13] sessioninfo_1.1.1 cli_1.1.0 withr_2.1.2 remotes_2.1.0
[17] yaml_2.2.0 assertthat_0.2.1 digest_0.6.20 rprojroot_1.3-2
[21] crayon_1.3.4 processx_3.4.1 callr_3.3.1 fs_1.3.1
[25] ps_1.3.0 testthat_2.2.1 glue_1.3.1 memoise_1.1.0
[29] compiler_3.5.3 desc_1.2.0 backports_1.1.4 prettyunits_1.0.2

Installed caret in R but unable to use in library

This is the code and error message I am getting:
> library(caret)
Error : object ‘semester’ is not exported by 'namespace:lubridate'
Error: package or namespace load failed for ‘caret’
I am using a mac. I also use this at work on a PC and haven't had any problems.
I also ran sessionInfo() as adivsed
> sessionInfo()
R version 3.3.3 (2017-03-06)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X Yosemite 10.10.5
locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] lattice_0.20-34 factoextra_1.0.5 FactoMineR_1.36 e1071_1.6-8
[5] GGally_1.3.0 ggrepel_0.6.5 RColorBrewer_1.1-2 stringr_1.2.0
[9] tidyr_0.6.1 dplyr_0.7.3 data.table_1.10.4 ggplot2_2.2.1
loaded via a namespace (and not attached):
[1] reshape2_1.4.1 kernlab_0.9-25 splines_3.3.3
[4] colorspace_1.3-2 prodlim_1.6.1 survival_2.40-1
[7] rlang_0.1.2 ModelMetrics_1.1.0 glue_1.1.1
[10] bindrcpp_0.2 foreach_1.4.3 bindr_0.1
[13] plyr_1.8.4 lava_1.5 dimRed_0.1.0
[16] robustbase_0.92-7 timeDate_3012.100 munsell_0.4.3
[19] gtable_0.2.0 leaps_3.0 codetools_0.2-15
[22] class_7.3-14 DEoptimR_1.0-8 Rcpp_0.12.9
[25] scales_0.4.1 flashClust_1.01-2 ipred_0.9-6
[28] scatterplot3d_0.3-40 CVST_0.2-1 stringi_1.1.2
[31] RcppRoll_0.2.2 ddalpha_1.2.1 grid_3.3.3
[34] tools_3.3.3 magrittr_1.5 lazyeval_0.2.0
[37] tibble_1.3.4 cluster_2.0.5 DRR_0.0.2
[40] pkgconfig_2.0.1 MASS_7.3-45 Matrix_1.2-8
[43] lubridate_1.5.6 gower_0.1.2 assertthat_0.1
[46] reshape_0.8.6 iterators_1.0.8 R6_2.2.0
[49] rpart_4.1-10 nnet_7.3-12 nlme_3.1-131
You may have outdated dependencies. Try updating all installed packages. Then install "caret" with all dependencies : (install.packages("caret", dependencies = TRUE)). Worked for me!
I just ran into the same issue, except I got stuck at updating (reinstalling) the lubridate package. Some of the errors I got looked something like:
./cctz/include/civil_time_detail.h:37: error: expected nested-name-specifier before ‘year_t’
./cctz/include/civil_time_detail.h:37: error: ‘year_t’ has not been declared
./cctz/include/civil_time_detail.h:37: error: expected ‘;’ before ‘=’ token
./cctz/include/civil_time_detail.h:37: error: expected unqualified-id before ‘=’ token
turned out my gcc compiler (running RHEL 6.8) was too old (4.4.7). Since I couldn't upgrade the compiler itself, I installed a devtoolset.
then, I fixed my problem by enabling the devtoolset before running R:
scp enable devtoolset-4 R

Resources