Sf: PROJ and sqlite3 are available for linking:... no

Created on 14 Feb 2020  Â·  21Comments  Â·  Source: r-spatial/sf

Hello,
First of all, my system is Centos 7.6 OS.

My goal was installing the monocle3,
but always failed to here that installing the "sf".

here is my code

remotes::install_github('r-spatial/sf', configure.args=
('--with-gdal-config=/usr/local/bin/gdal-config
--with-proj-lib=/usr/local/lib
--with-proj-include=/usr/local/include
--with-proj-share=/usr/local/share/proj
--with-proj-data=/usr/local/share/proj
--with-geos-config=/usr/local/bin/geos-config'))

image
image
image

I already installed the sqlite3-dev , and also PKG_CONFIG_PATH was good, too.

please, can you tell me what should I do & what was the problem?

Thank you

Most helpful comment

@edzer Were you thinking of https://lists.osgeo.org/pipermail/proj/2020-March/009505.html? @caiohamamura you may want to use the PROJ master to see whether the fixes for proj.pc address your problem. I'd do this outside CI to simplify the possible distractors.

All 21 comments

I can try if you provide a dockerfile that builds the system to reproduce your problem.

I'm really sorry for the late reply!!

I tried to install sf with a docker.
I don't know why, but I can't install docker because of a problem with the internet connection of the server, so I'm just installing it as rstudio.

Is there any solution we can do with rstudio?

Have you followed the instructions for fedora given here: https://github.com/r-spatial/sf ?

Hi all,

I have the same problem as well. My OS is macOS Catalina 10.15.4. I tried the R CMD install method but still, have the same problem.
libproj not found in standard or given locations

Screen Shot 2020-03-26 at 10 20 06 am

Appreciate if anyone could help to provide any advice.

Hello. Same issue here. Only differences with @vwtlin is that I've got GDAL 3.0.4 and I'm on macOS Catalina 10.15.3. Thanks!

Hello. Same issue as @EllaKaye . Got GDAL 3.0.4 and libproj not found.

For all those who get here, use OSX, and don't know what is going on: please stick to using binary distributions; they typically show up on CRAN 1-2 weeks after new versions are distributed as source.

It seems like the build system is actually fine with gdal, proj and sqlite3 installed from the default package manager. Maybe the problem is within the configure.ac script itself.

If I may give you a suggestion, can't you change sqlite3 cheking to the default ax_lib_sqlite3 from the autoconf-archive.

GDAL also have a macro from the autoconf archive, and it also checks for minimum version. I always try to use those macros to avoid these kind of issues, since they were already tested in multiple platforms.

@caiohamamura feel free to submit a PR. Your travis testing is a bit quite a bit more extensive than sf's, and sf is moving to github actions. Note that many platforms suffer PROJ installations problems because of a bug in proj.pc / pkg-config installation present in released PROJ.

@edzer Were you thinking of https://lists.osgeo.org/pipermail/proj/2020-March/009505.html? @caiohamamura you may want to use the PROJ master to see whether the fixes for proj.pc address your problem. I'd do this outside CI to simplify the possible distractors.

Sorry for writing in a quite old thread, but I think I am encountering the same issue. I am trying to build a Docker image based on GDAL Ubuntu full Docker with the manual addition of rocker/geospatial features, in order to debug {sen2r} on the more recent GDAL/PROJ environment (https://github.com/ranghetti/sen2r/issues/350). Here you find attached the dockerfile together with three patch files: Docker_gdal_geospatial.zip.

While installing {sf} from GitHub source, the following error occurs:

Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)                                                                                                     
* installing *source* package ‘sf’ ...                                                                                        
** using staged installation                                                                                                  
configure: CC: gcc
configure: CXX: g++ -std=gnu++11
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 3.2.0
checking GDAL version >= 2.0.1... yes
checking for gcc... gcc
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 gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -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/share/gdal/pcs.csv readable... no
checking GDAL: checking whether PROJ is available for linking:... yes
checking GDAL: checking whether PROJ is available fur running:... yes
configure: GDAL: 3.2.0
configure: pkg-config proj exists, will use it
configure: using proj.h.
configure: PROJ: 7.2.0
checking PROJ: checking whether PROJ and sqlite3 are available for linking:... no
configure: error: libproj or sqlite3 not found in standard or given locations.
ERROR: configuration failed for package ‘sf’
* removing ‘/usr/local/lib/R/site-library/sf’
* restoring previous ‘/usr/local/lib/R/site-library/sf’
Error: Failed to install 'sf' from GitHub:
  (converted from warning) installation of package ‘/tmp/Rtmpdc99GY/file5e526a98cbd9/sf_0.9-7.tar.gz’ had non-zero exit status
Execution halted

If I understood well in https://github.com/r-spatial/sf/issues/1268#issuecomment-605426776, the issue should have ben fixed since PROJ 7.0.1, while I am using version 7.2.0.

Thank you for any possible advice,

@ranghetti could you check whether libsqlite3-dev was installed in the container, and if not whether installing it resolves the problem?

@ranghetti could you check whether libsqlite3-dev was installed in the container, and if not whether installing it resolves the problem?

Yes, it was.

OK. Does the Dockerfile reproduce the problem, or do I need to apply the patches to it first? If so, could you please provide the docker file after applying the patches?

Ah, sorry, I see the patch files are used and applied inside the docker file...

libproj.so is not found in a standard directory; it is in /usr/local/lib, but this is not specified with configure flags when installing sf.

You are right, sorry. Nevertheless, this does not solve (using remotes::install_github('r-spatial/sf', configure.args='--with-proj-lib=/usr/local/lib/'), the same error is returned.
Maybe there are some incompatibilities between GDAL/PROJ local installation and packages installed subsequently:

root@2f59abfce005:/# sudo ldconfig -p | grep libproj
        libproj.so.19 (libc6,x86-64) => /usr/local/lib/libproj.so.19
        libproj.so.15 (libc6,x86-64) => /lib/x86_64-linux-gnu/libproj.so.15

where /lib/x86_64-linux-gnu/libproj.so.15 was installed by libproj15, a libspatialite7 dependency.
I will search for additional information regarding the use of a GDAL/PROJ source installation and eventually open a specific issue.
Thank you

Heads-up @ranghetti I've had a similar issue but with a different solution. Please take a look here if still of use/interest and try to reproduce with the steps outlined there: https://github.com/r-spatial/sf/issues/1518

Interested to hear if that works for you, I'm trying to tackle the issue as far upstream as possible with input to the rocker-org/versioned2 repo as you'll see if you follow the links. Great to see others installing sf on on Docker images with recent versions of GDAL.

Thank you @Robinlovelace for linking here the abovementioned issue. I tried your reproducible example in https://github.com/r-spatial/sf/issues/1518#issue-726392150, but unfortunately the error persists (I am commenting in https://github.com/r-spatial/sf/issues/1518 about that). The same in my example using the suggestion in https://github.com/r-spatial/sf/issues/1518#issuecomment-713509001.

For anyone else having this problem, I just solved it by setting the PKG_CONFIG_PATH environment variable:

export PKG_CONFIG_PATH=/path/to/proj/lib/pkgconfig/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jsta picture jsta  Â·  4Comments

kendonB picture kendonB  Â·  3Comments

ekarsten picture ekarsten  Â·  4Comments

faridcher picture faridcher  Â·  4Comments

adrfantini picture adrfantini  Â·  4Comments