I am new to Julia and I love it. However, there are several issues I cannot fix.
At the moment this is the most annoying one:
I decided using Julia because of its infamous speed.
I’m writing scientific software which aims at solving large sparse eigenvalue systems.
For that reason I end up with very large *.jl files. By large I mean several kB up to a few MB file size.
Though these files are lengthy they basically define a long chain of matrix-vector -products and vector-vector-additions.
The key point here is that compilation takes very long while using the compiled function is actually fairly quick.
In order to avoid Julia compiling the function any time a new workspace was set up, I wrapped the code in a module contained in a custom julia package.
The module structure is kind of nested. It looks pretty much like this:
__precompile__() module mymodule __precompile__() module submoduleA #some code end __precompile__() module submoduleB importall ..submoduleA #the very very long bunch of code #containing the function which is crucial to be compiled end end
Now, when I load the package by “using” or “import” etc. after I did some changes to the source code, there appears a notification in the console that the package is going to be precompiled and a corresponding .*ji file is created in ~/.julia/lib . Seemingly, this is exactly what I want. However, when I import the relevant function, the first time it is invoked takes several minutes. Obviously, this is due to compilation. A behavior I intended to avoid by declaring the modules as precompiled.
What is it I am doing wrong?
Some more details:
I am using Julia 0.6 on an 64-bit ubuntu 17.04 system.
The large files are algorithmicly created by an auxiliary julia function which automatically generates the necessary julia code and saves it to a *.jl file. I know that julia has meta-programming features which should be able to do the same job without creating a lengthy source code file explicitly. However, as I am a beginner the current approach is more convenient for me.
Thank you very much,