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

Cannot precompile with Julia v0.6.3 #91

Closed
jaakkor2 opened this issue May 31, 2018 · 14 comments
Closed

Cannot precompile with Julia v0.6.3 #91

jaakkor2 opened this issue May 31, 2018 · 14 comments

Comments

@jaakkor2
Copy link

jaakkor2 commented May 31, 2018

using GLAbstraction leads to error

julia> using GLAbstraction
INFO: Precompiling module GLAbstraction.
ERROR: LoadError: LoadError: TypeError: UnionAll: expected Type, got Int64
Stacktrace:
 [1] include_from_node1(::String) at .\loading.jl:576
 [2] include(::String) at .\sysimg.jl:14
 [3] include_from_node1(::String) at .\loading.jl:576
 [4] include(::String) at .\sysimg.jl:14
 [5] anonymous at .\<missing>:2
while loading C:\Users\jr\.julia\v0.6\GLAbstraction\src\GLMatrixMath.jl, in expression starting on line 218
while loading C:\Users\jr\.julia\v0.6\GLAbstraction\src\GLAbstraction.jl, in expression starting on line 112
ERROR: Failed to precompile GLAbstraction to C:\Users\jr\.julia\lib\v0.6\GLAbstraction.ji.
Stacktrace:
 [1] compilecache(::String) at .\loading.jl:710
 [2] _require(::Symbol) at .\loading.jl:497
 [3] require(::Symbol) at .\loading.jl:405

versioninfo()

Julia Version 0.6.3
Commit d55cadc350* (2018-05-28 20:20 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, broadwell)
@jaakkor2
Copy link
Author

using Quaternions
using GeometryTypes

function (::Type{M})(q::Quaternions.Quaternion) where M <: Mat4
    T = eltype(M)
    sx, sy, sz = 2q.s*q.v1,  2q.s*q.v2,   2q.s*q.v3
    xx, xy, xz = 2q.v1^2,    2q.v1*q.v2,  2q.v1*q.v3
    yy, yz, zz = 2q.v2^2,    2q.v2*q.v3,  2q.v3^2
    T0, T1 = zero(T), one(T)
    Mat{4}(
        T1-(yy+zz), xy+sz,      xz-sy,      T0,
        xy-sz,      T1-(xx+zz), yz+sx,      T0,
        xz+sy,      yz-sx,      T1-(xx+yy), T0,
        T0,         T0,         T0,         T1
    )
end

function (::Type{M})(q::Quaternions.Quaternion) where M <: Mat3
    T = eltype(M)
    sx, sy, sz = 2q.s*q.v1, 2q.s*q.v2,  2q.s*q.v3
    xx, xy, xz = 2q.v1^2,   2q.v1*q.v2, 2q.v1*q.v3
    yy, yz, zz = 2q.v2^2,   2q.v2*q.v3, 2q.v3^2
    T0, T1 = zero(T), one(T)
    Mat{3}(
        T1-(yy+zz), xy+sz,      xz-sy,
        xy-sz,      T1-(xx+zz), yz+sx,
        xz+sy,      yz-sx,      T1-(xx+yy)
    )
end

results in
ERROR: TypeError: UnionAll: expected Type, got Int64

@jaakkor2
Copy link
Author

using GeometryTypes

function (::Type{M})(q) where M <: Mat4
    1
end

function (::Type{M})(q) where M <: Mat3
    2
end

results in
ERROR: TypeError: UnionAll: expected Type, got Int64
on Julia v0.6.3, but is ok on Julia v0.6.2 .

@oschulz
Copy link

oschulz commented Jun 1, 2018

I just ran into the same issue (CentOS-7, Julia v0.6.3, custom build).

@SimonDanisch
Copy link
Member

I opened an issue: JuliaLang/julia#27361

@oschulz
Copy link

oschulz commented Jun 2, 2018

Until the Julia issue is fixed, would this do as a workaround?

function (::Type{Mat4{T}})(q::Quaternions.Quaternion) where T
    # ...
end

function (::Type{Mat3{T}})(q::Quaternions.Quaternion) where T
    # ...
end

@DealPete
Copy link

DealPete commented Jun 2, 2018

I can't use GLVisualize at all, because when I import it it tries to precompile, and fails on GLAbstraction.

@SimonDanisch
Copy link
Member

If it solves it, feel free to open a PR :)

@SimonDanisch
Copy link
Member

(and thanks for figuring it out!)

@oschulz
Copy link

oschulz commented Jun 4, 2018

Question is, do we want to implement a workaround, and do an interim release of GLAbstraction, or hope for a speedy Julia-0.6.4. There seem to be more regressions in 0.6.3 (JuliaLang/julia#27381, JuliaLang/julia#27345), but I have no idea whether there will be a quick bug-fix release or not ...

@SimonDanisch
Copy link
Member

If you have it ready locally & it helps people, I'd be happy to merge & tag!

@getzze
Copy link

getzze commented Jun 11, 2018

Maybe the Rotation.jl package could be used for some functions in GLAbstraction, according to JuliaArrays/StaticArrays.jl#423 (comment)
It would reduce code redundancy and bugs.

@SimonDanisch
Copy link
Member

Would be nice! I have never looked a lot into this, since I've had GLMatrixMath, a 270 loc file, since forever and never needed anything more ;) Not sure if Rotations.jl even covers the functionality ...

@SimonDanisch
Copy link
Member

Should be fixed now: JuliaLang/METADATA.jl#15225 I

@oschulz
Copy link

oschulz commented Jun 20, 2018

@SimonDanisch , thanks! Sorry, I didn't get around to do the PR for you, was a bit overloaded.

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

5 participants