Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"proj_api.h not found in standard or given locations" in OSX Mojave #1091

Closed
akhst7 opened this issue Jun 24, 2019 · 10 comments
Closed

"proj_api.h not found in standard or given locations" in OSX Mojave #1091

akhst7 opened this issue Jun 24, 2019 · 10 comments

Comments

@akhst7
Copy link

akhst7 commented Jun 24, 2019

I had a trouble installing sf through a recommend OSX installation and I tried this CMD Install, command;

R CMD INSTALL ~/Documents/GitHub/sf --configure-args='-with-gdal-config=/usr/local/Cellar/gdal/2.4.1_1/bin/gdal-config -with-geos-config=/usr/local/Cellar/geos/3.7.2/bin/geos-config'

But I am still getting the same error regarding pros_api,

proj_api.h not found in standard or given locations

I have a Brew install PROJ6,

/usr/local/Cellar/proj/6.1.0/bin/cct /usr/local/Cellar/proj/6.1.0/bin/cs2cs /usr/local/Cellar/proj/6.1.0/bin/geod /usr/local/Cellar/proj/6.1.0/bin/gie /usr/local/Cellar/proj/6.1.0/bin/invgeod /usr/local/Cellar/proj/6.1.0/bin/invproj /usr/local/Cellar/proj/6.1.0/bin/proj /usr/local/Cellar/proj/6.1.0/bin/projinfo /usr/local/Cellar/proj/6.1.0/include/proj/ (9 files) /usr/local/Cellar/proj/6.1.0/include/ (7 files) /usr/local/Cellar/proj/6.1.0/lib/libproj.15.dylib /usr/local/Cellar/proj/6.1.0/lib/pkgconfig/proj.pc /usr/local/Cellar/proj/6.1.0/lib/ (3 other files) /usr/local/Cellar/proj/6.1.0/share/man/ (8 files) /usr/local/Cellar/proj/6.1.0/share/proj/ (12 files)

The installer does not see the brew installed proj6 even though /usr/local is ahead in the path. Is it possible to manually set a path to proj6 in CMD Install ?

@edzer
Copy link
Member

edzer commented Jun 24, 2019

We need to see the complete output of the configure step.

@akhst7
Copy link
Author

akhst7 commented Jun 24, 2019

Here is the output of config.
output.txt

@edzer
Copy link
Member

edzer commented Jun 24, 2019

I'd suggest to update GDAL to 3.0.0, and use that with PROJ 6.1.0.

@akhst7
Copy link
Author

akhst7 commented Jun 24, 2019

can't install GDAL 3.0.0 (from the source). I get the same error;

`checking for PROJ >= 6 library... checking for proj_create_from_wkt in -lproj... yes
checking proj.h usability... no

checking proj.h presence... no
checking for proj.h... no
configure: error: proj.h not found`

@edzer
Copy link
Member

edzer commented Jun 24, 2019

Well, that suggests that there is a problem with your PROJ installation, or you need to set --with-proj= arguments. Which might help with sf as well: do run ./configure --help in the sf directory.

@akhst7
Copy link
Author

akhst7 commented Jun 26, 2019

Ok I specified a path to pros_api.h as follows;

R CMD INSTALL ~/Documents/GitHub/sf --configure-args='-with-gdal-config=//usr/local/Cellar/gdal/2.4.1_1/bin/gdal-config --with-proj=/usr/local/Cellar/proj/6.1.0/include/proj_api.h -with-geos-config=/usr/local/Cellar/geos/3.7.2/bin/geos-config'

But I am still getting the same error. Any suggestions for a workaround ?

Thanks.

@edzer
Copy link
Member

edzer commented Jun 26, 2019

I think it should be --with-proj=/usr/local/Cellar/proj/6.1.0/

@akhst7
Copy link
Author

akhst7 commented Jun 26, 2019

I tried with --with-proj=/usr/local/Cellar/proj/6.1.0/ but still get the same error;

./configure: line 3648: pkg-config: command not found
checking proj_api.h usability... no
checking proj_api.h presence... no
checking for proj_api.h... no
configure: error: proj_api.h not found in standard or given locations.

I did reinstall PROJ6 by brew but the same result.

@akhst7
Copy link
Author

akhst7 commented Jun 26, 2019

The problem was not having a pkg-config. After installing it, sf was installed seamlessly.

Thanks.

@akhst7 akhst7 closed this as completed Jun 26, 2019
@ChuliangXiao
Copy link

The problem was not having a pkg-config. After installing it, sf was installed seamlessly.

Thanks.

Had the same issue. After brew install pkg-config, sf was installed. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants