evetion / GeoArrays.jl

Simple geographical raster interaction built on top of ArchGDAL, GDAL and CoordinateTransformations
https://www.evetion.nl/GeoArrays.jl/dev/
MIT License
51 stars 13 forks source link

In GeoArrays.read, ERROR: UndefVarError: allregister not defined #26

Closed vlandau closed 4 years ago

vlandau commented 4 years ago

I'm trying to read in a file with GeoArrays.read and I'm getting an error that allregister isn't defined.

ERROR: UndefVarError: allregister not defined
Stacktrace:
 [1] read(::String) at /root/.julia/packages/GeoArrays/SV5MC/src/io.jl:13
 [2] top-level scope at untitled-97594d953fa6b8541389f5f1dda0f0a5:4

It has to do with GDAL.allregister() in GeoArrays.Read()

I'm using Julia 1.4-rc2:

julia> versioninfo()
Julia Version 1.4.0-rc2.0
Commit b99ed72c95 (2020-02-24 16:51 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Xeon(R) E-2176M  CPU @ 2.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 2
  JULIA_EDITOR = atom  -a

I'm wondering if this issue could have something to do with that? It also may very well be an issue in GDAL.jl itself, but I figured posting an issue here was a good place to start.

Thanks for any help!

visr commented 4 years ago

Hmm I think this is probably related to package versions. Which version of GeoArrays / ArchGDAL / GDAL are you using? Note that GeoArrays v0.2 was released just a few days ago, and no longer directly uses GDAL.jl (only through ArchGDAL.jl).

vlandau commented 4 years ago

Looks like it's not picking up GeoArrays v0.2. Here's the output from installing GeoArrays.

(@v1.4) pkg> add GeoArrays
  Resolving package versions...
  Installed Rotations ───────────────── v0.13.0
  Installed Zlib_jll ────────────────── v1.2.11+8
  Installed ArchGDAL ────────────────── v0.3.1
  Installed CEnum ───────────────────── v0.2.0
  Installed DataStreams ─────────────── v0.4.2
  Installed CoordinateTransformations ─ v0.5.1
  Installed Parameters ──────────────── v0.12.0
  Installed LibSSH2_jll ─────────────── v1.9.0+1
  Installed WeakRefStrings ──────────── v0.6.2
  Installed PROJ_jll ────────────────── v6.3.0+0
  Installed SQLite_jll ──────────────── v3.31.1+0
  Installed GDAL_jll ────────────────── v3.0.4+0
  Installed GeoStatsBase ────────────── v0.4.3
  Installed GEOS_jll ────────────────── v3.8.0+4
  Installed GeoArrays ───────────────── v0.1.0
  Installed GeoInterface ────────────── v0.5.3
  Installed LibCURL_jll ─────────────── v7.68.0+0
  Installed GDAL ────────────────────── v1.1.0
Downloading artifact: GEOS
Downloading artifact: LibCURL
Downloading artifact: Zlib
Downloading artifact: LibSSH2
Downloading artifact: GDAL
Downloading artifact: PROJ
Downloading artifact: SQLite
   Updating `~/.julia/environments/v1.4/Project.toml`
  [2fb1d81b] + GeoArrays v0.1.0
   Updating `~/.julia/environments/v1.4/Manifest.toml`
  [c9ce4bd3] + ArchGDAL v0.3.1
  [fa961155] + CEnum v0.2.0
  [150eb455] + CoordinateTransformations v0.5.1
  [9a8bc11e] + DataStreams v0.4.2
  [add2ef01] + GDAL v1.1.0
  [a7073274] + GDAL_jll v3.0.4+0
  [d604d12d] + GEOS_jll v3.8.0+4
  [2fb1d81b] + GeoArrays v0.1.0
  [cf35fbd7] + GeoInterface v0.5.3
  [323cb8eb] + GeoStatsBase v0.4.3
  [deac9b47] + LibCURL_jll v7.68.0+0
  [29816b5a] + LibSSH2_jll v1.9.0+1
  [58948b4f] + PROJ_jll v6.3.0+0
  [d96e819e] + Parameters v0.12.0
  [6038ab10] + Rotations v0.13.0
  [76ed43ae] + SQLite_jll v3.31.1+0
  [ea10d353] + WeakRefStrings v0.6.2
  [83775a58] + Zlib_jll v1.2.11+8
visr commented 4 years ago

There is probably some other package installed that has not yet declared compatibility with GeoArrays 0.2, you can see which by add GeoArrays@0.2. You are getting 0.1.0, the very first release, probably because the version after that upper bounded GDAL. This first release was before GDAL.jl 1.0, which was breaking, hence this allregister error.

Maybe we should upper bound GDAL in the registry entry for GeoArrays 0.1.0, if that stops people from ending up with the oldest release.

visr commented 4 years ago

Ha I guess we won't have to edit the registry ourselves, I see there is this huge PR: https://github.com/JuliaRegistries/General/pull/11114. If I read https://github.com/JuliaRegistries/General/blob/e2b84a846c5aafc3011234e251f5d4b7d56d86ab/G/GeoArrays/Compat.toml correctly, it will add the upper bound of GDAL 0.2 for GeoArrays 0.1.0. So that would prevent people ending up with latest GDAL and oldest GeoArrays.

vlandau commented 4 years ago

Looks like forcing installation of GeoArrays v0.2.0 with ]add GeoArrays@0.2 did the trick!

However, after using GeoArrays:

julia> using GeoArrays
[ Info: Precompiling GeoArrays [2fb1d81b-e6a0-5fc5-82e6-8e06903437ab]
WARNING: Method definition dot(Any, Any, Any) in module LinearAlgebra at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/LinearAlgebra/src/generic.jl:924 overwritten in module Optim at /root/.julia/packages/Optim/Agd3B/src/multivariate/precon.jl:23.
  ** incremental compilation may be fatally broken for this module **

WARNING: Method definition dot(Any, Any, Any) in module LinearAlgebra at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/LinearAlgebra/src/generic.jl:924 overwritten in module Optim at /root/.julia/packages/Optim/Agd3B/src/multivariate/precon.jl:23.
  ** incremental compilation may be fatally broken for this module **

WARNING: Method definition dot(Any, Any, Any) in module LinearAlgebra at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/LinearAlgebra/src/generic.jl:924 overwritten in module Optim at /root/.julia/packages/Optim/Agd3B/src/multivariate/precon.jl:23.
  ** incremental compilation may be fatally broken for this module **

Not sure what that all means, but wanted to post it here for completeness.

Given that this solved the issue I was having, I'll leave it up to you to close this issue.

Thanks for the help!

visr commented 4 years ago

Nice, glad it worked. The dot thing looks like an Optim.jl issue, that overwrites a LinearAlgebra method.

evetion commented 4 years ago

Thanks for the very quick help @visr. @vlandau, let us know when you run into more issues or have questions.

visr commented 4 years ago

Reopening this for visibility. https://github.com/JuliaRegistries/General/pull/11114 is not yet merged. Perhaps we should just add those caps ourselves.

evetion commented 4 years ago

With the registry fix now merged, this shouldn't happen anymore on newer installs. Let me know if you still run into problems.