ModiaSim / Modia.jl

Modeling and simulation of multidomain engineering systems
MIT License
321 stars 38 forks source link

Modia fails to precompile in v1.0 #84

Closed tpdsantos closed 5 years ago

tpdsantos commented 5 years ago

Even last week I was able to use Modia with no complications. Today I was trying to continue my work but now I can't even open Modia. This is what appears to me:

julia> using Modia
[ Info: Precompiling Modia [cb905087-75eb-5f27-8515-1ce0ec8e839e]

Welcome to Modia - Dynamic Modeling and Simulation with Julia
Version 0.2.2 (2018-10-12)
Type "?Modia" for help.

Importing ModiaMath version 0.2.6 from 2018-12-02 14:35
ERROR: LoadError: LoadError: LoadError: LoadError: LoadError: MethodError: no method matching replace_value(::Symbol)
Closest candidates are:
  replace_value(::Any, ::Expr) at /home/tsantos/.julia/packages/Unitful/A3sNy/src/user.jl:500
  replace_value(::Any, ::Symbol) at /home/tsantos/.julia/packages/Unitful/A3sNy/src/user.jl:525
  replace_value(::Any, ::Number) at /home/tsantos/.julia/packages/Unitful/A3sNy/src/user.jl:555
Stacktrace:
 [1] replace_value(::Symbol) at /home/tsantos/.julia/packages/Modia/kJUT1/src/language/Unitful_U_str.jl:56
 [2] @U_str(::LineNumberNode, ::Module, ::Any) at /home/tsantos/.julia/packages/Modia/kJUT1/src/language/Unitful_U_str.jl:27
 [3] #macroexpand#32 at ./expr.jl:92 [inlined]
 [4] macroexpand at ./expr.jl:91 [inlined]
 [5] docm(::LineNumberNode, ::Module, ::Any, ::Any, ::Bool) at ./docs/Docs.jl:509 (repeats 2 times)
 [6] @doc(::LineNumberNode, ::Module, ::String, ::Vararg{Any,N} where N) at ./boot.jl:451
 [7] include at ./boot.jl:317 [inlined]
 [8] include_relative(::Module, ::String) at ./loading.jl:1044
 [9] include at ./sysimg.jl:29 [inlined]
 [10] include(::String) at /home/tsantos/.julia/packages/Modia/kJUT1/src/Modia.jl:46
 [11] top-level scope at none:0
 [12] include at ./boot.jl:317 [inlined]
 [13] include_relative(::Module, ::String) at ./loading.jl:1044
 [14] include at ./sysimg.jl:29 [inlined]
 [15] include(::String) at /home/tsantos/.julia/packages/Modia/kJUT1/src/Modia.jl:46
 [16] top-level scope at none:0
 [17] include at ./boot.jl:317 [inlined]
 [18] include_relative(::Module, ::String) at ./loading.jl:1044
 [19] include(::Module, ::String) at ./sysimg.jl:29
 [20] top-level scope at none:2
 [21] eval at ./boot.jl:319 [inlined]
 [22] eval(::Expr) at ./client.jl:393
 [23] top-level scope at ./none:3
in expression starting at /home/tsantos/.julia/packages/Modia/kJUT1/src/models/Rotational.jl:20
in expression starting at /home/tsantos/.julia/packages/Modia/kJUT1/src/models/Rotational.jl:18
in expression starting at /home/tsantos/.julia/packages/Modia/kJUT1/src/models/Rotational.jl:18
in expression starting at /home/tsantos/.julia/packages/Modia/kJUT1/src/models/models.jl:3
in expression starting at /home/tsantos/.julia/packages/Modia/kJUT1/src/Modia.jl:121
ERROR: Failed to precompile Modia [cb905087-75eb-5f27-8515-1ce0ec8e839e] to /home/tsantos/.julia/compiled/v1.0/Modia/CBgbi.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] macro expansion at ./logging.jl:311 [inlined]
 [3] compilecache(::Base.PkgId, ::String) at ./loading.jl:1190
 [4] macro expansion at ./logging.jl:309 [inlined]
 [5] _require(::Base.PkgId) at ./loading.jl:947
 [6] require(::Base.PkgId) at ./loading.jl:858
 [7] macro expansion at ./logging.jl:309 [inlined]
 [8] require(::Module, ::Symbol) at ./loading.jl:840

Does everyone know what's going on?

Thanks in advance

MartinOtter commented 5 years ago

I am sorry: The reason is that Unitful is used in Modia and there was recently a new release in Unitful (0.14.0) that is not compatible how Unitful is used in the last Modia release (Modia uses a workaround to fix an issue with Unitful and this workaround does not longer work in Unitful 0.14.0). This issue has been already fixed on the master. So, the short-term fix is to define that the master version of Modia should be used:

julia
]
remove Modia
add Modia#master

We will try to soon release a new Modia version (but want to first fix some other issues too).

tpdsantos commented 5 years ago

Oh Ok, no problem! Thanks for the tip :)