I am trying to install the sf
package in a CentOS machine but I keep getting this error
proj_api.h not found in standard or given locations
Even though when I run locate proj_api.h
it is found in /usr/local/include/proj_api.h
I am trying to install the sf
package in a CentOS machine but I keep getting this error
proj_api.h not found in standard or given locations
Even though when I run locate proj_api.h
it is found in /usr/local/include/proj_api.h
I my case help when I was set PKG_CONFIG_PATH envirmoment, and point them to place where was "proj.pc" file:
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
Try this from the command line. It worked for me when I got the same error message on Mac Mojave:
R CMD INSTALL sf_0.7-4.tar.gz --configure-args='-with-gdal-config=/Library/Frameworks/GDAL.framework/Versions/2.4/unix/bin/gdal-config -with-geos-config=/Library/Frameworks/GEOS.framework/Versions/3B/unix/bin/geos-config --with-proj-include=/Library/Frameworks/PROJ.framework/unix/include --with-proj-lib=/Library/Frameworks/PROJ.framework/unix/lib'
You will need to confirm locations of gdal-config, geos-config, include, and lib for PROJ. and your most recent versions for each installation and the .tar.gz file. I found a similar issue and the answer here
Recently the configure of sf
changed a lot with regard to proj
. Installing the development version from github solved the the failing configure in my case
remotes::install_github('r-spatial/sf')