Skip to content

Fix GDAL Python bindings and add import tests#8482

Merged
adamjstewart merged 1 commit intospack:developfrom
adamjstewart:packages/gdal-python
Jun 15, 2018
Merged

Fix GDAL Python bindings and add import tests#8482
adamjstewart merged 1 commit intospack:developfrom
adamjstewart:packages/gdal-python

Conversation

@adamjstewart
Copy link
Copy Markdown
Member

Fixes #8469.

I accidentally broke our GDAL Python binding support in #8263 when I removed the py-numpy dependency. GDAL doesn't have great installation documentation, and numpy isn't listed anywhere, so it got lost in the sea of dependencies. If you dig deep enough and read the swig/python/setup.py file, you'll see that numpy is an optional dependency needed to convert GeoTIFF files read by GDAL into numpy arrays.

GDAL was also installing its Python bindings directly to the site-packages directory of the Python installation prefix, not to the GDAL installation prefix. This is now fixed.

I also added import tests. If you run spack install --test=root gdal+python, Spack will try to import common osgeo modules. Hopefully this will catch things next time someone erroneously removes py-numpy from the dependency list.

I also removed GDAL's swig dependency. Swig is needed to generate language bindings, but these bindings are already present in the downloaded tarball, so swig is not necessary.

Note: I encountered a couple of bugs while debugging this package. The first was #8475. For some reason, Spack was trying to apply the JasPer patch to GDAL even though I disabled JasPer support. I had to comment out the JasPer dependency to avoid this. The second was #987. Spack doesn't really support packages with multiple extends() directives at the moment. In order to run the import tests, I needed to comment out the perl dependency so that Spack could correctly detect that GDAL extends Python. I'm surprised that no one else encountered these problems.

@neilflood. @michaelkuhn may also be interested in this.

@adamjstewart adamjstewart added python dependencies tests General test capability(ies) labels Jun 14, 2018
@adamjstewart adamjstewart force-pushed the packages/gdal-python branch from 9610fc1 to cfaeda7 Compare June 15, 2018 13:17
@adamjstewart adamjstewart merged commit cea5d04 into spack:develop Jun 15, 2018
@adamjstewart adamjstewart deleted the packages/gdal-python branch June 15, 2018 15:14
smuething added a commit to smuething/spack that referenced this pull request Jun 18, 2018
* upstream-develop: (430 commits)
  There's only one 'u' in "configuration" (spack#8498)
  Add new versions for TAU and PDT package (spack#8497)
  Add changes to the Krell packages with version updates and ranges for  the latest release. (spack#8468)
  docs: remove vendored sphinx_rtd_theme (spack#8496)
  Trilinos needs parallel-netcdf as an explicit dependency to avoid concretization errors when netcdf is an external. (spack#8493)
  superlu_dist: 'master' is branch - not tag (spack#8495)
  SAMRAI: new versions, handle deprecation of boost in latest version. (spack#8494)
  Fix GDAL Python bindings and add import tests (spack#8482)
  Add newer likwid versions 4.3.1 and 4.3.2 (spack#8488)
  Package/geopm: Update to version 0.5.0 (spack#8487)
  [mfem] Add BLAS+LAPACK to the required dependencies of SuperLU_DIST. (spack#8485)
  openssl: add new version 1.0.2o (spack#8486)
  Update the clang compiler definition to use IBM XL Fortran compiler (spack#8389)
  Patch trilinos for xlf when using clang (spack#8391)
  Use no mangling for all spack compiler definitions that use the XL (spack#8392)
  Use the name of the Fortran compiler to determine what name mangling (spack#8393)
  A new package: megahit. (spack#8471)
  neovim: add info for v0.3.0 (spack#8472)
  oce: add 0.18.3 (spack#8477)
  netgen should depend on zlib (spack#8473)
  ...
smuething added a commit to smuething/spack that referenced this pull request Jun 18, 2018
* upstream-develop: (430 commits)
  There's only one 'u' in "configuration" (spack#8498)
  Add new versions for TAU and PDT package (spack#8497)
  Add changes to the Krell packages with version updates and ranges for  the latest release. (spack#8468)
  docs: remove vendored sphinx_rtd_theme (spack#8496)
  Trilinos needs parallel-netcdf as an explicit dependency to avoid concretization errors when netcdf is an external. (spack#8493)
  superlu_dist: 'master' is branch - not tag (spack#8495)
  SAMRAI: new versions, handle deprecation of boost in latest version. (spack#8494)
  Fix GDAL Python bindings and add import tests (spack#8482)
  Add newer likwid versions 4.3.1 and 4.3.2 (spack#8488)
  Package/geopm: Update to version 0.5.0 (spack#8487)
  [mfem] Add BLAS+LAPACK to the required dependencies of SuperLU_DIST. (spack#8485)
  openssl: add new version 1.0.2o (spack#8486)
  Update the clang compiler definition to use IBM XL Fortran compiler (spack#8389)
  Patch trilinos for xlf when using clang (spack#8391)
  Use no mangling for all spack compiler definitions that use the XL (spack#8392)
  Use the name of the Fortran compiler to determine what name mangling (spack#8393)
  A new package: megahit. (spack#8471)
  neovim: add info for v0.3.0 (spack#8472)
  oce: add 0.18.3 (spack#8477)
  netgen should depend on zlib (spack#8473)
  ...
smuething added a commit to smuething/spack that referenced this pull request Jun 18, 2018
* upstream-develop: (430 commits)
  There's only one 'u' in "configuration" (spack#8498)
  Add new versions for TAU and PDT package (spack#8497)
  Add changes to the Krell packages with version updates and ranges for  the latest release. (spack#8468)
  docs: remove vendored sphinx_rtd_theme (spack#8496)
  Trilinos needs parallel-netcdf as an explicit dependency to avoid concretization errors when netcdf is an external. (spack#8493)
  superlu_dist: 'master' is branch - not tag (spack#8495)
  SAMRAI: new versions, handle deprecation of boost in latest version. (spack#8494)
  Fix GDAL Python bindings and add import tests (spack#8482)
  Add newer likwid versions 4.3.1 and 4.3.2 (spack#8488)
  Package/geopm: Update to version 0.5.0 (spack#8487)
  [mfem] Add BLAS+LAPACK to the required dependencies of SuperLU_DIST. (spack#8485)
  openssl: add new version 1.0.2o (spack#8486)
  Update the clang compiler definition to use IBM XL Fortran compiler (spack#8389)
  Patch trilinos for xlf when using clang (spack#8391)
  Use no mangling for all spack compiler definitions that use the XL (spack#8392)
  Use the name of the Fortran compiler to determine what name mangling (spack#8393)
  A new package: megahit. (spack#8471)
  neovim: add info for v0.3.0 (spack#8472)
  oce: add 0.18.3 (spack#8477)
  netgen should depend on zlib (spack#8473)
  ...
smuething added a commit to smuething/spack that referenced this pull request Jun 18, 2018
* upstream-develop: (430 commits)
  There's only one 'u' in "configuration" (spack#8498)
  Add new versions for TAU and PDT package (spack#8497)
  Add changes to the Krell packages with version updates and ranges for  the latest release. (spack#8468)
  docs: remove vendored sphinx_rtd_theme (spack#8496)
  Trilinos needs parallel-netcdf as an explicit dependency to avoid concretization errors when netcdf is an external. (spack#8493)
  superlu_dist: 'master' is branch - not tag (spack#8495)
  SAMRAI: new versions, handle deprecation of boost in latest version. (spack#8494)
  Fix GDAL Python bindings and add import tests (spack#8482)
  Add newer likwid versions 4.3.1 and 4.3.2 (spack#8488)
  Package/geopm: Update to version 0.5.0 (spack#8487)
  [mfem] Add BLAS+LAPACK to the required dependencies of SuperLU_DIST. (spack#8485)
  openssl: add new version 1.0.2o (spack#8486)
  Update the clang compiler definition to use IBM XL Fortran compiler (spack#8389)
  Patch trilinos for xlf when using clang (spack#8391)
  Use no mangling for all spack compiler definitions that use the XL (spack#8392)
  Use the name of the Fortran compiler to determine what name mangling (spack#8393)
  A new package: megahit. (spack#8471)
  neovim: add info for v0.3.0 (spack#8472)
  oce: add 0.18.3 (spack#8477)
  netgen should depend on zlib (spack#8473)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies python tests General test capability(ies)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GDAL should have dependency on py-numpy when building with +python

2 participants