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

Include gdal-config --cflags when building Python bindings #258

Closed
wants to merge 1 commit into from

Conversation

nikhaldi
Copy link

@nikhaldi nikhaldi commented Nov 1, 2017

The Python bindings didn't build out of the box in some environments,
for example Ubuntu 16.04 with standard libgdal-dev package installed.
It's because Ubuntu decides to put header files in /usr/include/gdal.
gdal-config --cflags on Ubuntu correctly has a matching include
flag but the setup script didn't make use of this.

This adds cflags from gdal-config as compiler args to extensions.

This also gets rid of sketchy retry logic when calling gdal-config.
The previous way of failing silently after retrying once doesn't
seem useful and breaks things if gdal-config is called multiple
times.

Fixes https://trac.osgeo.org/gdal/ticket/7118

The Python bindings didn't build out of the box in some environments,
for example Ubuntu 16.04 with standard libgdal-dev package installed.
It's because Ubuntu decides to put header files in /usr/include/gdal.
`gdal-config --cflags` on Ubuntu correctly has a matching include
flag but the setup script didn't make use of this.

This adds cflags from gdal-config as compiler args to extensions.

This also gets rid of sketchy retry logic when calling gdal-config.
The previous way of failing silently after retrying once doesn't
seem useful and breaks things if gdal-config is called multiple
times.

Fixes https://trac.osgeo.org/gdal/ticket/7118
@nikhaldi
Copy link
Author

nikhaldi commented Nov 1, 2017

Note the only build which failed in Travis is the OS X one. It looks to me like it actually passed, but there was some sort of time limit issue? This is the end of the build log:

  TEST: test_pct2rgb_4 ... skip

  TEST: test_rgb2pct_cleanup ... success



Succeeded: 4262

Failed:    0 (0 blew exceptions)

Skipped:   1285

Expected fail:9

Duration:  11m34.9s

As GDAL_DOWNLOAD_TEST_DATA environment variable is not defined, 100 tests relying on data to downloaded from the Web have been skipped

As GDAL_RUN_SLOW_TESTS environment variable is not defined, 18 "slow" tests have been skipped





travis_time:end:2e65f210:start=1509559618404330000,finish=1509560335757158000,duration=717352828000
�[0K

�[32;1mThe command "./gdal/ci/travis/${BUILD_NAME}/script.sh" exited with 0.�[0m

travis_fold:start:cache.2
�[0Kstore build cache

travis_time:start:0bc3c660
�[0K

travis_time:end:0bc3c660:start=1509560335897897000,finish=1509560335910168000,duration=12271000
�[0Ktravis_time:start:19fcbaf9
�[0K

The job exceeded the maximum time limit for jobs, and has been terminated.

@nikhaldi
Copy link
Author

nikhaldi commented Nov 1, 2017

I'm pretty sure the Travis failure is unrelated to my change. I might be missing something but I can't get Travis to rerun the build without modifying the branch. If requested, I can force push an amended commit or an an empty commit on top.

@rouault
Copy link
Member

rouault commented Nov 1, 2017

Yes, flaky test failure. Patch committed in trunk r40611. Thanks

@rouault rouault closed this Nov 1, 2017
rouault added a commit that referenced this pull request Nov 1, 2017
…en/gdal/trunk/gdal/gcore -I/home/even/gdal/trunk/gdal/alg -I/home/even/gdal/trunk/gdal/ogr -I/home/even/gdal/trunk/gdal/ogr/ogrsf_frmts -I/home/even/gdal/trunk/gdal/frmts/vrt -I/home/even/gdal/trunk/gdal/apps when building Python bindings (patch by nikhaldi, fixes #258)

git-svn-id: https://svn.osgeo.org/gdal/trunk@40611 f0d54148-0727-0410-94bb-9a71ac55c965
kwrobot pushed a commit to aashish24/gdal-svn that referenced this pull request Nov 1, 2017
…en/gdal/trunk/gdal/gcore -I/home/even/gdal/trunk/gdal/alg -I/home/even/gdal/trunk/gdal/ogr -I/home/even/gdal/trunk/gdal/ogr/ogrsf_frmts -I/home/even/gdal/trunk/gdal/frmts/vrt -I/home/even/gdal/trunk/gdal/apps when building Python bindings (patch by nikhaldi, fixes OSGeo/gdal#258)

git-svn-id: https://svn.osgeo.org/gdal/trunk/gdal@40611 f0d54148-0727-0410-94bb-9a71ac55c965
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

Successfully merging this pull request may close these issues.

None yet

2 participants