-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Can't compile crystal --release #3939
Comments
I can compile a simple hello_world (with a puts statement) with --release (with the 0.20.5 binary). |
Ok, this might be a false alert. Someone told me it should take a few minutes. I finally got it working after 30 minutes of waiting. Will try again on LLVM 3.9 next. |
Yes, bc+obj will execute all LLVM optimisations in aggressive mode, but 30 minutes is a lot. What happens if you rebuild Crystal, using the just built compiler? How long does it take? |
Note that the optimisation step is slower and slower on each LLVM release. |
Ok, so I'm building 0.20.5 --release WITH 0.20.5 (binary from github releases) with LLVM 3.9.1.
Why is the distributed compiler showing such "poor" performance vs the one I built? Also interesting: The second and 3rd builds are exactly the same size (down to the byte) but they are not matching binaries. |
Maybe LLVM took wrong assumptions when tuning optimizations for your CPU? Or maybe this is how LLVM itself is built (it's statically linked)? I'm not sure which LLVM is used for osx packages or homebrew (built manually? homebrew's one)? Around 5 or 6 minutes is expected with LLVM 3.9. I have no idea why the difference. I know it happened to me when cross-compiling to another OS (e.g. FreeBSD or OpenBSD). It's often quicker to build without |
I was using the x86 binary provided from github for 0.20.5... this is all on my own outside of homebrew (homebrew is just providing the dependencies).
Now that is interesting. I wonder how hard it would be to make homebrew do that. |
You misunderstood me: it's better to use an optimized build in the whole majority of cases! But in some unidentified cases, the initial build may take a very long time, so first building without optimizations then with optimizations may be faster, but only when it takes forever the first time. |
Guess I'm having trouble believing my experience is that much of an edge case. :-) |
I'll close this now though since the only issue was how slow it was, not that the actual compile was broken. |
@yyyc514 Regarding your three separate compiles, what happens if you delete Compiling the compiler with In any case, we only compile the compiler in release mode for releases, and waiting a few hours there (because we compile for several platforms) isn't that terrible. |
Compiling the compiler cleanly with
I don't know what's going on here but I don't think its fair to blame LLVM. |
Hey, it's true! On my machine:
But with the binary extracted from the tar.gz in the release page:
That gives a light of hope: I thought that the compile times went higher because the compiler size grew, but I originally expected it would grow linearly. And it seems to be the case, there's something strange with the one we distribute. It might be because it's statically linked against a patched LLVM 3.5.1... maybe it was built with assertions and without optimizations, but I don't know, I think this was used to generate the LLVM binaries we have in s3. |
Should I create a new issue for slow compile time with the release binary? |
I experienced the similar problem. Three cross-compile builds took all the night... my build script:
The targets are x86_64-alpine-linux-musl, x86_64-apple-darwin and x86_64-unknown-linux-gnu. Both on Mac yosemite 2015 8GB RAM and Ubuntu 14.04.05 4GB RAM (dockerized). |
I'm trying to build crystal. I have all the dependencies via homebrew. I've tried compiling both 0.20.5 and HEAD (15032cc). I'm using the x86 build provided in the 0.20.5 release for the bootstrap. I can build the compiler fine, but NOT with --release. It seems to hang forever on Codegen (bc+obj) (when running stats):
The binary compiler I'm using
PATH="../crystal-0.20.5-1/bin:$PATH" ./bin/crystal -v
:What I'm running exactly:
Previously I was using the latest LLVM (3.9.1) from homebrew. Going back to 3.8 doesn't seem to have had any noticeable effect.
I get them same hang when trying
brew install crystal-lang
.brew install crystal-lang --without-release
works just fine.Please advise. Any help would be appreciated.
The text was updated successfully, but these errors were encountered: