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

[Bug] build: "ogr_srs_api.h: No such file or directory" and "cdefs.h syntax error" errors #4258

Open
mshukuno opened this issue Aug 30, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@mshukuno
Copy link
Contributor

Describe the bug

When I compile the project, I get an error fatal error: ogr_srs_api.h: No such file or directory. This issue was previously reported #1649 and it seemed resolved at that point. So, I am wondering if my configuration is to blame. I run the line below for configuration:

./configure --with-gdal=/usr/bin/gdal-config --with-geos=/usr/local/bin/geos-config --with-blas --with-lapack

Please let me know if this issue has anything to do with my configuration settings. If so, would you be so kind as to share with me what I need to change or add in order to solve this problem?

INFO: Status: gcc -E       -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -D__GLIBC_HAVE_LONG_LONG -U __GNUC__ -dD "-D__extension__=" "-D__const=const" "-D__asm__(x)=" "-D__asm(x)=" "-DCTYPESGEN=1" "/tmp/tmp0ltw0i5t.h"
ERROR: gcc -E       -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -D__GLIBC_HAVE_LONG_LONG: In file included from /tmp/tmpk7h2ptj1.h:1:
ERROR: gcc -E       -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -D__GLIBC_HAVE_LONG_LONG: /home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include/grass/gprojects.h:57:10: fatal error: ogr_srs_api.h: No such file or directory
ERROR: gcc -E       -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -D__GLIBC_HAVE_LONG_LONG:    57 | #include <ogr_srs_api.h>
ERROR: gcc -E       -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -D__GLIBC_HAVE_LONG_LONG:       |          ^~~~~~~~~~~~~~~
ERROR: gcc -E       -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -D__GLIBC_HAVE_LONG_LONG: compilation terminated.

The cdefs.h. file also has errors as follwoing. This error was reported in ctypesgen, so I assume it is a known issue on Linux.

ERROR: /usr/include/x86_64-linux-gnu/sys/cdefs.h:281: Syntax error at '\n'
ERROR: /usr/include/x86_64-linux-gnu/sys/cdefs.h:308: Syntax error at '\n'
ERROR: /usr/include/x86_64-linux-gnu/sys/cdefs.h:315: Syntax error at '\n'
ERROR: /usr/include/x86_64-linux-gnu/sys/cdefs.h:321: Syntax error at '\n'
ERROR: /usr/include/x86_64-linux-gnu/sys/cdefs.h:330: Syntax error at '\n'
ERROR: /usr/include/x86_64-linux-gnu/sys/cdefs.h:331: Syntax error at '\n'
ERROR: /usr/include/x86_64-linux-gnu/sys/cdefs.h:339: Syntax error at '\n'
ERROR: /usr/include/x86_64-linux-gnu/sys/cdefs.h:397: Syntax error at '\n'
ERROR: /usr/include/x86_64-linux-gnu/sys/cdefs.h:406: Syntax error at '\n'
ERROR: /usr/include/x86_64-linux-gnu/sys/cdefs.h:433: Syntax error at '\n'

Despite having errors in the log, the compilation ends without errors. Do those not count as errors rather than warnings?

GRASS GIS 8.5.0dev cdb62825a3 compilation log
--------------------------------------------------
Started compilation: Fri Aug 30 11:54:41 AM EDT 2024
--
Errors in:
No errors detected.
--
Finished compilation: Fri Aug 30 11:57:03 AM EDT 2024

Expected behavior

  • If the cause is not my configuration, the fatal error: ogr_srs_api.h: No such file or directory need to be resolved.
  • I assume that errors will be reported at the end when there is one or more errors.
  • It would be helpful to know at the end of the compilation log or website whether certain errors can be ignored. In this way, I won't have to wonder if my settings are to blame for the errors.

System description

  • Operating System: Ubuntu 22.04 LTS
  • GRASS GIS version:
    version=8.5.0dev
    date=2024
    revision=cdb62825a3
    build_date=2024-08-30
    build_platform=x86_64-pc-linux-gnu
    build_off_t_size=8
    libgis_revision=b794d95393
    libgis_date=2024-08-23T16:29:27+00:00
    proj=9.1.1
    gdal=3.6.4
    geos=3.12.2
    sqlite=3.37.2
  • wxPython
    3.10.12 (main, Jul 29 2024, 16:56:48) [GCC 11.4.0]
    4.2.1 gtk3 (phoenix) wxWidgets 3.2.2.1
@mshukuno mshukuno added the bug Something isn't working label Aug 30, 2024
@echoix
Copy link
Member

echoix commented Aug 30, 2024

Just to make sure before searching too deeply, when you compiled, did you clean and rerun configure before? If there were some changes when updating your repo and some C/C++ (native) code or libraries aren't recompiled, there can be some weird errors.

@mshukuno
Copy link
Contributor Author

Just to make sure before searching too deeply, when you compiled, did you clean and rerun configure before? If there were some changes when updating your repo and some C/C++ (native) code or libraries aren't recompiled, there can be some weird errors.

I found the part of the code below from your comment.
Each new build I run as follwing:

sudo rm -r /usr/local/grass85
sudo rm /usr/local/bin/grass
cd {project root: grass}
make libsclean distclean clean
./configure --with-gdal=/usr/bin/gdal-config --with-geos=/usr/local/bin/geos-config --with-blas --with-lapack
make -j 6 > ../make_terminal.txt 2>&1
sudo make install

I also tried following just now. It is the same result.

sudo rm -f /usr/local/grass85
sudo rm /usr/local/bin/grass

git clone https://github.com/OSGeo/grass.git
cd grass
git rev-parse HEAD
make libsclean distclean clean
./configure --with-gdal=/usr/bin/gdal-config --with-geos=/usr/local/bin/geos-config --with-blas --with-lapack
make -j 6 > ../make_terminal.txt 2>&1
sudo make install

@echoix
Copy link
Member

echoix commented Aug 30, 2024

Ok, so it doesn't seem a user error, as you went the overkill way and removed everything and did a fresh clone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants