Oops! Thanks!

I put __precompile__() before the module definitions in both Foo.jl and 
Bar.jl. The problem is still there though. 

- Rohit

On Friday, 21 October 2016 17:23:16 UTC-4, Michele Zaffalon wrote:
>
> I am not sure if this is the reason, but the manual (
> http://docs.julialang.org/en/release-0.5/manual/modules/) says you should 
> put _precompile_() before the module starts.
>
> On Fri, Oct 21, 2016 at 10:56 PM, Rohit Varkey Thankachan <
> rohit...@gmail.com <javascript:>> wrote:
>
>> Hi,
>>
>> I've been trying to use julia on one of my university machines and having 
>> precompilation issues. The machine runs Linux x84_46 and I'm using the 0.5 
>> generic linux binary.
>>
>> I was trying to use JLD.jl and kept getting precompilation failures for 
>> HFD5. On trying to do `using HDF5` in the REPL, it was giving me the same 
>> error for Compat.jl. By running `using <module>` for all modules for which 
>> precompilation was failing when trying to use JLD(HDF5->(Compat, Blosc), 
>> FileIO) I got them all precompiled successfully. However JLD also needed 
>> LegacyStrings to be precompiled, which does not have precompilation enabled 
>> and has to be precompiled from another module. At which point I was stuck 
>> and I decided to just go with `julia --compilecache=no`.
>>
>> julia> using JLD
>> INFO: Precompiling module JLD.
>> ERROR: LoadError: LoadError: Failed to precompile LegacyStrings to 
>> /nethome/rvt7/.julia/lib/v0.5/LegacyStrings.ji.
>>  in compilecache(::String) at ./loading.jl:593
>>  in require(::Symbol) at ./loading.jl:393
>>  in include_from_node1(::String) at ./loading.jl:488 (repeats 2 times)
>>  in macro expansion; at ./none:2 [inlined]
>>  in anonymous at ./<missing>:?
>>  in eval(::Module, ::Any) at ./boot.jl:234
>>  in process_options(::Base.JLOptions) at ./client.jl:239
>>  in _start() at ./client.jl:318
>> while loading /nethome/rvt7/.julia/v0.5/JLD/src/jld_types.jl, in 
>> expression starting on line 1
>> while loading /nethome/rvt7/.julia/v0.5/JLD/src/JLD.jl, in expression 
>> starting on line 130
>> ERROR: Failed to precompile JLD to /nethome/rvt7/.julia/lib/v0.5/JLD.ji.
>>  in compilecache(::String) at ./loading.jl:593
>>  in require(::Symbol) at ./loading.jl:422
>>
>> julia> using LegacyStrings
>> WARNING: could not import Base.lastidx into LegacyStrings
>> WARNING: using LegacyStrings.utf8 in module Main conflicts with an 
>> existing identifier.
>> WARNING: using LegacyStrings.ascii in module Main conflicts with an 
>> existing identifier.
>>
>> julia> using JLD
>> INFO: Precompiling module JLD.
>> WARNING: Module LegacyStrings with uuid 25677385416258011 is missing from 
>> the cache.
>> This may mean module LegacyStrings does not support precompilation but is 
>> imported by a module that does.
>> ERROR: LoadError: LoadError: Declaring __precompile__(false) is not 
>> allowed in files that are being precompiled.
>>  in require(::Symbol) at ./loading.jl:385
>>  in include_from_node1(::String) at ./loading.jl:488 (repeats 2 times)
>>  in macro expansion; at ./none:2 [inlined]
>>  in anonymous at ./<missing>:?
>>  in eval(::Module, ::Any) at ./boot.jl:234
>>  in process_options(::Base.JLOptions) at ./client.jl:239
>>  in _start() at ./client.jl:318
>> while loading /nethome/rvt7/.julia/v0.5/JLD/src/jld_types.jl, in 
>> expression starting on line 1
>> while loading /nethome/rvt7/.julia/v0.5/JLD/src/JLD.jl, in expression 
>> starting on line 130
>> ERROR: Failed to precompile JLD to /nethome/rvt7/.julia/lib/v0.5/JLD.ji.
>>  in compilecache(::String) at ./loading.jl:593
>>  in require(::Symbol) at ./loading.jl:422
>>
>> On a hunch that this was occurring due to a package with precompilation 
>> enabled trying to use another precompilation enabled package which hadn't 
>> been precompiled yet, I tried making a minimal example to check this. I 
>> created 2 packages Foo and Bar, both of which have precompilation enabled.
>>  
>> ~/.julia/v0.5/Foo/Foo.jl:
>> module Foo
>>
>> __precompile__()
>> using Bar
>>
>> import Bar: bar
>>
>> end
>>
>> ~/.julia/v0.5/Bar/src/Bar.jl:
>>
>> module Bar
>>
>> __precompile__()
>>
>> export bar
>>
>> const bar = "foo"
>>
>> end
>>
>> Now when I try using Foo, I get a precompilation failed error for Bar. 
>> Foo does precompile when Bar is already precompiled though!
>>
>>                _
>>    _       _ _(_)_     |  A fresh approach to technical computing
>>   (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
>>    _ _   _| |_  __ _   |  Type "?help" for help.
>>   | | | | | | |/ _` |  |
>>   | | |_| | | | (_| |  |  Version 0.5.0 (2016-09-19 18:14 UTC)
>>  _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
>> |__/                   |  x86_64-pc-linux-gnu
>>
>> julia> using Foo
>> INFO: Precompiling module Foo.
>> ERROR: LoadError: Failed to precompile Bar to 
>> /nethome/rvt7/.julia/lib/v0.5/Bar.ji.
>>  in compilecache(::String) at ./loading.jl:593
>>  in require(::Symbol) at ./loading.jl:393
>>  in include_from_node1(::String) at ./loading.jl:488
>>  in macro expansion; at ./none:2 [inlined]
>>  in anonymous at ./<missing>:?
>>  in eval(::Module, ::Any) at ./boot.jl:234
>>  in process_options(::Base.JLOptions) at ./client.jl:239
>>  in _start() at ./client.jl:318
>> while loading /nethome/rvt7/.julia/v0.5/Foo/src/Foo.jl, in expression 
>> starting on line 4
>> ERROR: Failed to precompile Foo to /nethome/rvt7/.julia/lib/v0.5/Foo.ji.
>>  in compilecache(::String) at ./loading.jl:593
>>  in require(::Symbol) at ./loading.jl:422
>>
>> julia> using Bar
>> INFO: Precompiling module Bar.
>> WARNING: replacing module Bar.
>>
>> julia> reload("Foo")
>> WARNING: replacing module Foo
>> INFO: Precompiling module Foo.
>> WARNING: replacing module Foo.
>>
>> julia> versioninfo()
>> Julia Version 0.5.0
>> Commit 3c9d753 (2016-09-19 18:14 UTC)
>> Platform Info:
>>   System: Linux (x86_64-pc-linux-gnu)
>>   CPU: Intel(R) Xeon(R) CPU           X5650  @ 2.67GHz
>>   WORD_SIZE: 64
>>   BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
>>   LAPACK: libopenblas64_
>>   LIBM: libopenlibm
>>   LLVM: libLLVM-3.7.1 (ORCJIT, westmere)
>>
>> Any ideas why this might be occurring?
>>
>> Thanks,
>> Rohit
>>
>>
>

Reply via email to