Julia:JLD包在运行Julia开发版时不起作用

时间:2016-07-15 09:33:41

标签: julia

Julia的当前版本是0.4.6。但是,我正在运行开发版本0.5。突然间,JLD无法运作。它已安装并更新。昨天我使用JLD编译代码,但今天早上它没有工作。

julia> using JLD
INFO: Precompiling module JLD...
WARNING: Method definition convert(Type{#T<:AbstractString}, AbstractArray{#S<:Union{Char, Int32, UInt32}, 1}) in module Base at unicode/utf32.jl:131 overwritten in module LegacyStrings at /root/.julia/v0.5/LegacyStrings/src/utf32.jl:133.
WARNING: Method definition isvalid(Array{Char, 1}) in module Base at unicode/utf32.jl:177 overwritten in module LegacyStrings at /root/.julia/v0.5/LegacyStrings/src/utf32.jl:179.
WARNING: New definition 
    string(Union{Char, LegacyStrings.UTF8String, LegacyStrings.ASCIIString}...) at /root/.julia/v0.5/LegacyStrings/src/utf8.jl:161
is ambiguous with: 
    string(Union{Char, UTF8String, ASCIIString}...) at unicode/utf8.jl:166.
To fix, define 
    string(Char...)
before the new definition.
WARNING: both LegacyStrings and Base export "UTF16String"; uses of it in module JLD must be qualified
ERROR: LoadError: LoadError: UndefVarError: UTF16String not defined
 in include(::ASCIIString) at ./boot.jl:234
 in include_from_node1(::ASCIIString) at ./loading.jl:417
 in include(::ASCIIString) at ./boot.jl:234
 in include_from_node1(::ASCIIString) at ./loading.jl:417
 [inlined code] from ./boot.jl:237
 in anonymous at ./<no file>:4294967295
 in eval(::Module, ::Any) at ./boot.jl:237
 [inlined code] from ./sysimg.jl:11
 in process_options(::Base.JLOptions) at ./client.jl:239
 in _start() at ./client.jl:318
while loading /root/.julia/v0.5/JLD/src/jld_types.jl, in expression starting on line 11
while loading /root/.julia/v0.5/JLD/src/JLD.jl, in expression starting on line 130
ERROR: Failed to precompile JLD to /root/.julia/lib/v0.5/JLD.ji
 in error(::ASCIIString) at ./error.jl:21
 in compilecache(::ASCIIString) at ./loading.jl:496
 in compilecache(::Symbol) at ./loading.jl:485
 in require(::Symbol) at ./loading.jl:355
 in eval(::Module, ::Any) at ./boot.jl:237

2 个答案:

答案 0 :(得分:3)

使用Julia的开发版本时,您需要使用软件包的开发版本(适用于开发人员保持最新版本但尚未标记的软件包)。如果你运行Pkg.checkout("JLD")结帐主机,JLD应该可以工作(在我的机器上工作。注意你可能需要Pkg.update()才能退房,你可能需要退出Julia并重新打开它以重新编译新版)。

但请注意,不要使用Julia的开发版本作为测试方法。请记住,语言仍处于alpha状态,并且无法保证软件包生态系统或Julia本身可以与日常主服务器一起使用。这些日报对于处理语言和为下一个版本准备软件包很有用(我猜也很麻烦)。

答案 1 :(得分:1)

嗯,你正在使用仍在开发中的Julia 0.5。如果你切换到0.4.6那么它应该没问题。我正在使用它,JLD对我来说很好。您还可以尝试运行Pkg.update()关闭Julia,然后重新打开,看看是否有帮助。