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

Precompilation error on Julia v0.6 #631

Closed
juliohm opened this issue Jul 2, 2017 · 30 comments
Closed

Precompilation error on Julia v0.6 #631

juliohm opened this issue Jul 2, 2017 · 30 comments

Comments

@juliohm
Copy link
Contributor

juliohm commented Jul 2, 2017

Currently I am unable to compile Distributions.jl on Julia v0.6:

julia> using Distributions
INFO: Recompiling stale cache file /home/juliohm/.julia/lib/v0.6/Distributions.ji for module Distributions.
WARNING: The call to compilecache failed to create a usable precompiled cache file for module Distributions. Got:
WARNING: Module FFTW uuid did not match cache file.
ERROR: LoadError: Declaring __precompile__(true) is only allowed in module files being imported.
Stacktrace:
 [1] __precompile__(::Bool) at ./loading.jl:335
 [2] include_from_node1(::String) at ./loading.jl:569
 [3] eval(::Module, ::Any) at ./boot.jl:235
 [4] _require(::Symbol) at ./loading.jl:483
 [5] require(::Symbol) at ./loading.jl:398
while loading /home/juliohm/.julia/v0.6/Distributions/src/Distributions.jl, in expression starting on line 1

Similar issue has happened with Combinatorics.jl: JuliaMath/Combinatorics.jl#48

What exactly is happening? How can I fix this myself?

@ararslan
Copy link
Member

ararslan commented Jul 2, 2017

You might have to delete the contents of ~/.julia/lib/v0.6.

@juliohm
Copy link
Contributor Author

juliohm commented Jul 2, 2017

Thank you @ararslan , I deleted it, but the problem remains. Any other suggestion that I can try locally?

@ararslan
Copy link
Member

ararslan commented Jul 2, 2017

Hm, I'm not sure, I can't reproduce the failure locally. What's your Pkg.status() and versioninfo()?

@juliohm
Copy link
Contributor Author

juliohm commented Jul 2, 2017

This is the output of both commands:

julia> versioninfo()
Julia Version 0.6.1-pre.0
Commit dcf39a1dda* (2017-06-19 13:06 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, skylake)
julia> Pkg.status("Distributions")
 - Distributions                 0.14.0             master
julia> Pkg.status("FFTW")
 - FFTW                          0.0.2

And the version of fftw on my system in case it is relevant:

$ pacman -Qi fftw
Name            : fftw
Version         : 3.3.6-2
Description     : A library for computing the discrete Fourier transform (DFT)
Architecture    : x86_64
URL             : http://www.fftw.org/
Licenses        : GPL2
Groups          : None
Provides        : None
Depends On      : bash  gcc-libs
Optional Deps   : None
Required By     : alsa-utils  libofa
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 5.54 MiB
Packager        : Antonio Rojas <[email protected]>
Build Date      : Sun 02 Apr 2017 02:16:46 PM PDT
Install Date    : Mon 03 Apr 2017 10:49:03 AM PDT
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature

@ararslan
Copy link
Member

ararslan commented Jul 2, 2017

Can you try it from the 0.6 release binary rather than a build of the release-0.6 branch?

@juliohm
Copy link
Contributor Author

juliohm commented Jul 2, 2017

Same issue on the precompiled binary, just tried it.

What exactly is .julia/lib and .julia/.cache? Can I safely delete the latter and try again?

@ararslan
Copy link
Member

ararslan commented Jul 2, 2017

Uhhhhh sure, give it a try ¯\_(ツ)_/¯

@ararslan
Copy link
Member

ararslan commented Jul 2, 2017

lib is the precompiled cache files (.ji) and .cache is the git tracking info for each installed package. So maybe don't delete the latter...

@juliohm
Copy link
Contributor Author

juliohm commented Jul 2, 2017

Tried it, nothing changed. And apparently this didn't cause any issue locally, I am able to load other packages and run the tests without a .cache folder.

@juliohm
Copy link
Contributor Author

juliohm commented Jul 2, 2017

A Pkg.update() will create the .cache again, so I am back to the original state, any other place where you think the issue lies?

@nalimilan
Copy link
Member

Can you try using FFTW in a clean session?

@juliohm
Copy link
Contributor Author

juliohm commented Jul 2, 2017

Thank you @nalimilan, just tried it, and everything works. I get an expected warning:

julia> using FFTW
WARNING: imported binding for FFTW overwritten in module Main

@juliohm
Copy link
Contributor Author

juliohm commented Jul 2, 2017

In the other issue I pointed (JuliaMath/Combinatorics.jl#48), they solved it by replacing Iterators.jl with IterTools.jl. Is it an issue with FFTW.jl or the fact that it is now part of Base?

@ararslan
Copy link
Member

ararslan commented Jul 2, 2017

Yes it's likely because FFTW.jl has the same name as the FFTW submodule in Base.

@juliohm
Copy link
Contributor Author

juliohm commented Jul 2, 2017

I don't understand why this issue is only affecting me though, are you guys using Julia v0.6 as well?

Thank you for opening the issue in FFTW.jl @ararslan 👍

@ararslan
Copy link
Member

ararslan commented Jul 2, 2017

I am. I don't think anyone is quite sure what exactly causes this issue, though I think some people have had luck nuking their entire ~/.julia folder. Quite unfortunate but a possible solution.

@nalimilan
Copy link
Member

Just a guess, but maybe the failure happens when some packages which have been precompiled and are dependencies of Distributions use functions from Base.FFTW? Then it would depend on the order in which packages are precompiled, which itself depends on the packages you have installed and the order in which you used them.

@juliohm
Copy link
Contributor Author

juliohm commented Jul 3, 2017

Just tried deleting the entire .julia folder, the issue is still there. I appreciate if someone can work on this issue with FFTW, my work is stuck on this front.

@juliohm
Copy link
Contributor Author

juliohm commented Jul 3, 2017

Since FFTW is part of Base now, shouldn't Distributions.jl use it instead of the FFTW.jl package?

@KristofferC
Copy link
Member

FFTW is no longer part of Base.

@ararslan
Copy link
Member

ararslan commented Jul 3, 2017

Yeah, it's the opposite situation: FFTW was part of Base up until quite recently, in 0.7-DEV. To support Julia nightly we need to add a dependency on the FFTW package, which contains the code moved out of Base.

@ChrisRackauckas
Copy link

With the Combinatorics/Iterators issue, using Iterators, Combinatorics before using ... fixed it. So for now, using FFTW, using Distributions is probably the quick workaround.

But it's fundamentally an issue with naming that hopefully will get solved. See JuliaLang/julia#21969

@juliohm
Copy link
Contributor Author

juliohm commented Jul 3, 2017

This is already of big help @ChrisRackauckas, thank you for sharing. I can proceed with my work meanwhile.

@ChrisRackauckas
Copy link

ChrisRackauckas commented Jul 5, 2017

Can this change be reverted until FFTW.jl stabilizes a bit and gets some of its kinks worked out? This error is quite annoying to have in a pretty widely used package, and it doesn't build on RHEL/Fedora/CentOS. Right now the current release requires FFTW and does get in the way of normal v0.6 usage only for the benefit of users on the nightly. I think it should have a release version which is solid on v0.6 and a v0.7 branch for users to checkout if needed, at least until this is all sorted out.

Of course, the downside is you get less people coerced into testing this for you hehe. While users can just pin the previous version, it is a little difficult to track down this is the reason.

@ararslan
Copy link
Member

ararslan commented Jul 5, 2017

Which change do you mean, the deprecation in Base or the addition of FFTW as a dependency for Distributions? JuliaMath/FFTW.jl#17 would get this working, there's just significant disagreement over the best approach to take on that front.

I had also suggested simply using a pure Julia implementation of the N2 algorithm to avoid a dependency on FFTW altogether, since the only use of an FFT in this package is in computing the Poisson binomial PDF.

@ChrisRackauckas
Copy link

ChrisRackauckas commented Jul 5, 2017

I was thinking that you should just create a new release which doesn't have FFTW.jl which won't work on v0.6, and have a branch with FFTW.jl setup and waiting for the solution to be worked out before merging and releasing with it. I think the majority of people are on v0.6 so this'll help a lot of non-power users who don't know the workaround, and in the meantime it's not a difficult branch to maintain. Unless the solution is coming really soon that is. But this Iterators.jl thing has been happening for awhile, so I'm skeptical :).

@mauro3
Copy link

mauro3 commented Jul 6, 2017

From scanning this long thread: One work-around for this is to delete lines


and
import FFTW.fft!

Is this the preferred work-around? Maybe the preferred work-around could be inserted into the top post (@juliohm).

@ararslan
Copy link
Member

ararslan commented Jul 6, 2017

Deleting a dependency that's present in the package isn't really a good workaround...

@mauro3
Copy link

mauro3 commented Jul 6, 2017

Yep, that is why I'm asking for a good work around. Note though it passes the tests fine. If that should not be the case, then a test should be added.

@liamhenry
Copy link

Julia Version 0.6.0
Commit 903644385b* (2017-06-19 13:05 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i5-2540M CPU @ 2.60GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.9.1 (ORCJIT, sandybridge)

Pkg.status("Distributions")

  • Distributions 0.14.2

Was experiencing similar problems. I am not as savvy to mess about with manually deleting .julia libraries or anything, but I followed the discussions mentioned here and couldn't resolve it.

The solution I got was inspired by another issue, JuliaLang/julia#19017 .
I turned it off and on again... and it now works!

From messing about, I don't remember the original error message, but the one I was getting most recently was along the lines of:
"WARNING: Module Compat with uuid 9269499719553 is missing from the cache"

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

7 participants