ggalt icon indicating copy to clipboard operation
ggalt copied to clipboard

proj4 error in installation

Open ghost opened this issue 7 years ago • 13 comments

install.packages("ggalt")

2016-09-05 09:00:49 (473 KB/s) - ‘/tmp/RtmpFo6quQ/downloaded_packages/ggalt_0.1.1.tar.gz’ saved [690266/690266]

* installing *source* package ‘ggalt’ ...
** package ‘ggalt’ successfully unpacked and MD5 sums checked
** R
** preparing package for lazy loading
Error : .onLoad failed in loadNamespace() for 'proj4', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/home/henk/R/x86_64-pc-linux-gnu-library/3.2/proj4/libs/proj4.so':
  libproj.so.0: cannot open shared object file: No such file or directory
ERROR: lazy loading failed for package ‘ggalt’
* removing ‘/home/henk/R/x86_64-pc-linux-gnu-library/3.2/ggalt’
* restoring previous ‘/home/henk/R/x86_64-pc-linux-gnu-library/3.2/ggalt’
Warning in install.packages :
  installation of package ‘ggalt’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpFo6quQ/downloaded_packages’

> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.1 LTS

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=nl_NL.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=nl_NL.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=nl_NL.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=nl_NL.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggplot2_2.1.0.9000

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.6        assertthat_0.1     MASS_7.3-45        grid_3.2.3         plyr_1.8.4         gtable_0.2.0       scales_0.4.0       KernSmooth_2.23-15 ash_1.0-15         tools_3.2.3        munsell_0.4.3      maps_3.1.0        
[13] rsconnect_0.4.3    colorspace_1.2-6   tibble_1.1        

ghost avatar Sep 05 '16 06:09 ghost

Try install.packages("ggalt", dependencies=TRUE). That should be the default behavior for install.packages(). ggalt uses the proj4 package (and that's where your issues are really coming from, not my pkg). proj4 requires thelibprojlibrary. This may help with getting proj4 setup on your system.

hrbrmstr avatar Sep 07 '16 10:09 hrbrmstr

Thanks! install.packages("ggalt", dependencies = T) didn't work, but install.packages("proj4") first did the trick.

ghost avatar Sep 08 '16 07:09 ghost

I confirm the answer of carbonmetrics on ubuntu 16.04

cbarbu avatar Jun 01 '17 16:06 cbarbu

With LinuxMint 18.1 and R version 3.4.3 (2017-11-30) , I had to follow this steps:

1º - sudo aptitude install libproj-dev libgdal-dev 2º - install.packages("proj4", dependencies=TRUE) 3º - install.packages("ggalt", dependencies = T)

fodassecaralho avatar Mar 05 '18 19:03 fodassecaralho

In Cent OS, sudo yum install proj-devel solved the problem for me

jongmmm avatar Mar 07 '19 18:03 jongmmm

While installing proj4 with: >install.packages("proj4", dependencies=TRUE) I got this error: configure: error: libproj and/or proj_api.h not found in standard search locations.

Following the procedure of @fodassecaralho (thanks :+1: ) could solve the prob with R version 3.5.3 (2019-03-11) Running under: Ubuntu 18.04.2 LTS

matteodelucchi avatar Mar 26 '19 09:03 matteodelucchi

With LinuxMint 18.1 and R version 3.4.3 (2017-11-30) , I had to follow this steps:

1º - sudo aptitude install libproj-dev libgdal-dev 2º - install.packages("proj4", dependencies=TRUE) 3º - install.packages("ggalt", dependencies = T)

This is the exact answer that works perfectly for me

langongjin avatar Nov 05 '20 02:11 langongjin

I am having the same issue trying to built proj4 for R/4.0.2 on a CentOS 7.9 system. I have installed the proj and proj-devel packages which puts things in standard places (i.e. /usr/include and /usr/lib64). However i still keep getting this error:

checking proj_api.h usability... yes checking proj_api.h presence... yes checking for proj_api.h... yes checking whether we are using the GNU C++ compiler... yes checking whether g++ -std=gnu++11 accepts -g... yes checking for pj_init_plus in -lproj... no checking for proj_create_crs_to_crs in -lproj... no checking whether to require PROJ6 API... no checking whether to use PROJ6 API... yes configure: error: libproj and/or proj.h/proj_api.h not found in standard search locations.

*** Install PROJ library and if necessary set PKG_CPPFLAGS/PKG_LIBS accordingly. ERROR: configuration failed for package ‘proj4’

  • removing ‘/data/R-4.0.2/lib64/R/library/proj4’

Even if i set PKG_CPPFLAGS and PKG_LIBS to point to the standard spot, it still fails to build. Any thoughts?

MrDotOne avatar Feb 13 '21 17:02 MrDotOne

@MrDotOne any luck? I ran into the same issue

andrewrech avatar Apr 06 '21 01:04 andrewrech

@andrewrech and @MrDotOne I am running into a similar issue. Just wondered if you have tried installing gdal (in step 1 of https://github.com/hrbrmstr/ggalt/issues/22#issuecomment-370530510)?

I am resisting installing gdal as I don't want netcdf library conflicts on the machine I am currently on, but curious to know if that would solve the issue.

KayShelton avatar Apr 21 '21 10:04 KayShelton

@KayShelton, yes, I tried installing

  • proj (4.8.0-4.el7)
  • proj-devel (4.8.0-4.el7)
  • gdal (1.11.4-3.el7)
  • gdal-devel (1.11.4-3.el7)

confirming that the requested file was installed, and configuring PKG_CPPFLAGS/PKG_LIBS, but I receive the same error message as @MrDotOne.

@hrbrmstr could you perhaps point the three of us in the right direction?

Thanks

...
configure: error: libproj and/or proj.h/proj_api.h not found in standard search locations.

*** Install PROJ library and if necessary set PKG_CPPFLAGS/PKG_LIBS accordingly.
ERROR: configuration failed for package ‘proj4’
Linux 5.4.105-48.177.amzn2.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux

R version 4.0.2 (2020-06-22)
Platform: x86_64-koji-linux-gnu (64-bit)
Running under: Amazon Linux 2

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] 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
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
 [1] grid      parallel  stats4    graphics  grDevices datasets  stats
 [8] utils     methods   base

other attached packages:
 [1] ComplexHeatmap_2.6.2        HDCytoData_1.10.0
 [3] flowCore_2.2.0              ExperimentHub_1.16.0
 [5] AnnotationHub_2.22.0        BiocFileCache_1.14.0
 [7] dbplyr_2.1.1                single.cell_0.0.1
 [9] scater_1.18.6               SingleCellExperiment_1.12.0
[11] SummarizedExperiment_1.20.0 Biobase_2.50.0
[13] GenomicRanges_1.42.0        GenomeInfoDb_1.26.4
[15] IRanges_2.24.1              S4Vectors_0.28.1
[17] BiocGenerics_0.36.0         MatrixGenerics_1.2.1
[19] matrixStats_0.58.0          ggplot2_3.3.3
[21] magrittr_2.0.1              bit64_4.0.5
[23] bit_4.0.4                   data.table_1.14.0

andrewrech avatar Apr 21 '21 12:04 andrewrech

@ CentOS this helped me through:

sudo yum install proj.x86_64 \
proj-static.x86_64 \
proj-devel.x86_64 \
gdal-devel.x86_64 \
gdal-libs.x86_64 \
gdal.x86_64 \
openssl-devel.x86_64 \
openssl-libs.x86_64 \
openssl.x86_64 \
sqlite-devel.x86_64 \
libtiff-devel.x86_64

Probably there are a few not needed.

I presume that @jongmmm had either sqlite-devel.x86_64 or libtiff-devel.x86_64 already installed. At least one of these two is also required to resolve the issue.

yhoogstrate avatar Aug 12 '21 10:08 yhoogstrate

Thanks a lot @yhoogstrate. The answer was sqlite-devel!

@KayShelton

andrewrech avatar Aug 12 '21 15:08 andrewrech