Centos7 OS
R version 3.6.0
Proj4 6.1.9 installed to default /usr/local location with ./configure, make, sudo make install
GDAL 3.0.0 installed to default /usr/local location with ./configure, make, sudo make install
GEOS 3.7.2 installed to default /usr/local location with ./configure, make, sudo make install
/etc/ld.so.conf.d/libgdal-x86_64.conf contains /usr/local/lib
then sudo ldconfig
remotes::install_github("r-spatial/sf", configure.args = "--with-gdal-config=/usr/local/bin/gdal-config --with-geos-config=/usr/local/bin/geos-config --with-proj-include=/usr/local/include/ --with-proj-lib=/usr/local/lib/")
Downloading GitHub repo r-spatial/sf@masterroj-lib=/usr/local/lib/")
Running R CMD build...
I'm stumped! I see proj_api.h here: /usr/local/include/proj_api.h
Suggestions please?
Proj4 6.1.9 does not exist.
What I see is
checking GDAL: checking whether PROJ is available for linking:... yes
checking GDAL: checking whether PROJ is available fur running:... yes
configure: pkg-config proj exists, will use it
checking proj.h usability... yes
checking proj.h presence... yes
checking for proj.h... yes
...
Is it possible that you don't have e.g. this working:
root@43c5e412d3ee:/# pkg-config proj --libs
-L/usr/local/lib -lproj
please check & report back.
Sorry, I meant Proj4 version 6.1.0
Is this on one line?
pkg-config proj --libs -L/usr/local/lib -lproj
If so, it errors in Centos:
pkg-config --libs -L/usr/local/lib -lproj
Unknown option -L/usr/local/lib
Not one line, run:
pkg-config --libs
with
-L/usr/local/lib -lproj
the expected output.
Okay, thanks. Here's the output:
# pkg-config --libs
Must specify package names on the command line
No: please try
pkg-config proj --libs
# pkg-config proj --libs
Package proj was not found in the pkg-config search path.
Perhaps you should add the directory containing `proj.pc'
to the PKG_CONFIG_PATH environment variable
No package 'proj' found
# pkg-config proj --libs
Package proj was not found in the pkg-config search path.
Perhaps you should add the directory containing `proj.pc'
to the PKG_CONFIG_PATH environment variable
No package 'proj' found
Which is weird because:
# echo $PKG_CONFIG_PATH
/usr/local/lib/pkgconfig/
# ls $PKG_CONFIG_PATH
gdal.pc proj.pc
Well, at least it gives you a direction to search for a solution.
Interesting, I had thought R picked up my Bash environment variables by default but it doesn't.
Doing the following led me to build 'sf' successfully:
> print(Sys.setenv(PKG_CONFIG_PATH = "/usr/local/lib/pkgconfig/"))
Thanks for your patience and help!
R picks up environment variables, when they are properly set in the environment in which R is started.
Most helpful comment
Interesting, I had thought R picked up my Bash environment variables by default but it doesn't.
Doing the following led me to build 'sf' successfully:
> print(Sys.setenv(PKG_CONFIG_PATH = "/usr/local/lib/pkgconfig/"))Thanks for your patience and help!