Deployment error from local to connect server: proj_api.h not found in standard or given locations

103 views Asked by At

I am trying to use terra library in my code which is working locally but while deploying code to posit connect server (2023.01.0) getting error - proj_api.h not found in standard or given locations

Connect server is hosted in AWS EC2 Amazon Linux 2.

On connect server: Upgraded required GDAL and Proj package version manually using steps given in - https://gist.github.com/abelcallejo/e75eb93d73db6f163b076d0232fc7d7e

GDAL version is 3.2.1 pkg-config proj --modversion returns 6.1.1 proj --version returns 6.1.1

Note: when I run 'sudo yum list proj-devel' it shows 4.8.0 epel version only on the server.

locate proj_api.h returns following locations - /usr/local/include, /usr/include/ and /home/ec2-user/temp/proj-6.1.1/src/

Added above paths in PKG_CONFIG_PATH environment variable.

When I run below command directly in connect server, terra package gets installed successfully. R -e 'install.packages(c("terra"))'

Issue is occurring only when user is trying to deploy code from local to connect server.

Sample local R notebook code:

'''{r} library("terra") x=x+1 '''

Error logs -

configure: GDAL: 3.2.1 configure: pkg-config proj exists, will use it checking for proj_api.h... no configure: error: proj_api.h not found in standard or given locations. ERROR: configuration failed for package 'terra'

0

There are 0 answers