-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Support building of system image in binary builds #8074
Conversation
Some new results now that this PR has been re-created to run on top of the latest
And then run
Note that the |
The above numbers seem to indicate that there is indeed a difference in the system images now, so that's great. There must have been something wrong with LLVM and my Haswell CPU last time I tried this, (which is indeed what Keno guessed at in the previous PR). Particularly, we can see an increase in performance in |
Why is native slower than core2? |
I noticed that
So you can see that all the |
@staticfloat So what's the replacement for |
First off, something I didn't know until recently is that you should be using |
@staticfloat Thanks. Ideally I would like Julia to run on any i386,I'm only passing |
f8f5854
to
b279fac
Compare
6c7c7e3
to
1a4c02f
Compare
I forgot this wasn't merged yet, probably because it's hard to get eyes on an issue that helps binary users, and not source-builds. @JeffBezanson any concerns with this? |
I'm currently rebasing, but shouldn't need any large changes, I don't think. |
In its current form, your More importantly, will this be installed somewhere in a predictable location? Or do we tell people to download it off github and just |
b279fac
to
18f023a
Compare
I'm thinking we could shove it into I tried
|
The opensuse build service is going through another broken phase, I wasn't able to install Nettle yesterday for example (bad timing, as I was trying to get a colleague to try Julia and installing IJulia couldn't work without WinRPM). I'm pretty sure I have gotten |
Yeah, sounds good. Let's add it to the todo list. If you can find/write a quick tutorial on setting up an RPM repository, we can host it on AWS. |
@nalimilan do you know by any chance? Otherwise I'll go googling, something else to learn how to do. |
@staticfloat try installing binutils again, I was able to get it to work again (from Windows - I'm not sure whether WinRPM is supposed to work elsewhere). curl is still broken though, it's unresolvable because one of its dependencies has an issue. I have a request in to fix it (https://build.opensuse.org/request/show/258347), but Tk is also broken and that one I don't know how to fix. |
a5f226c
to
15c0d61
Compare
Alright, I've attempted some Windows compatibility, but I don't have any from-source windows builds, so I can't test this branches changes on windows. Could someone else try it out? This works pretty well on mac for me. Specifically, testing out the |
15c0d61
to
cacfba3
Compare
Updated to not use |
This will be great to have. Packages included through
But I noticed a slowdown in startup time. Is this to be expected?
|
It's possible that is simply due to the fact that your system image now includes Gadfly and all dependencies. If you build one without Gadfly included at all, do you see a similar slowdown? |
Oh right, distributions probably won't like putting a .jl file next to |
I'm not sure what the distributions' policy is with regard to files with extensions in /usr/bin, but there are very few files named like that in that directory, and I don't find typing |
I'm not sure if we expect people to run this often enough for it to be worth a command-line flag (also command-line flags aren't very Windows-friendly, since the default command prompt is terrible and people don't use it much). I personally wouldn't mind having this available in base like |
@JeffBezanson how would you best like this code to be callable? The comment in question is this one, and I agree with you that the code doesn't need to be in the standard library. The way I see it, we have three options:
|
I guess |
Yeah, on second thought, I definitely like option 3 the best, and I can't imagine Jeff has anything to say against it. I'm trying to find a good place to put documentation about this. Can anyone give me a hint as to a good place to advertise this functionality? |
My vote would be either for http://docs.julialang.org/en/latest/devdocs/julia/ or a new section in devdocs about system image building / modifying code in base. |
Ah, |
What are these "time zones" you speak of? Aside from a spike around 2 am, according to https://osrc.dfm.io/tkelman/#schedule my likelihood of being online is almost uniform over the day. |
33f9472
to
4821016
Compare
I'm going to merge this tonight, barring any discussions. |
Maybe squash the commits a bit before merging? |
This commit adds a few new pieces of functionality: * The `contrib/build_sysimg.jl` script which builds a new system image. This method can save the system image wherever the user desires, e.g. it could be stored in `~/.julia`, to allow for per-user system images each customized with packages in their own `userimg.jl`. Or on a restricted system, this allows for creation of a system image without root access. * The removal of compile-time `JULIA_CPU_TARGET`, in favor of runtime `--cpu-target`/`-C` command-line flags which default to `"native"` but can be set to `"native"`, `"i386"`, `"core2"` or any other LLVM cpu target. This allows the creation of a system image targeting user-supplied cpu features, e.g. `cd base; ../julia -C i386 --build /tmp/sys_i386 sysimg.jl`. * I implemented runtime selection of the cpu target by adding a new member to the `jl_compileropts_t` structure called `cpu_target`. * Because all julia executables are now created equal, (rather than before where a julia executable needed to have the same `JULIA_CPU_TARGET` set internally as the system image had when it was built) we need to know what CPU feature set the system image is targeting before we initialize code generation. So a new function `jl_get_system_image_cpu_target()` is exported, which does exactly what it sounds like. * I added newlines to the end of a few error messages. * I found an old parser option `-T` which hadn't been removed yet, so I took the opportunity to do so. * Documentation on this has been added to doc/devdocs/sysimg.rst
ba0fd83
to
dab8a35
Compare
Squashed and rebased. This is by far the most rebased PR I have ever worked on. Once that little travis light turns green, I'm going to merge. |
We've still got windows breakage, but that doesn't seem to be a part of this. MERGING. |
Support building of system image in binary builds
Yeah, not your fault. That was premature merging of Jameson's stuff before it actually worked on Windows. |
@staticfloat this will require manual conflict resolution to backport, can you prepare a PR while we test this on master? edit: backport is at #9376 |
This commit adds a few new pieces of functionality:
contrib/build_sysimg.jl
script which builds a new system image. This method can save the system image wherever the user desires, e.g. it could be stored in~/.julia
, to allow for per-user system images each customized with packages in their ownuserimg.jl
, for instance. Or on a restricted system, this allows for creation of a system image without root access.JULIA_CPU_TARGET
, in favor of runtime--cpu-target
/-C
command-line flags which default to"native"
but can be set to"native"
,"i386"
or"core2"
. This allows the creation of a system image targeting user-supplied cpu features, e.g.cd base; ../julia -C i386 --build /tmp/sys_i386 sysimg.jl
.jl_compileropts_t
structure calledcpu_target
.JULIA_CPU_TARGET
set internally as the system image had when it was built) we need to know what CPU feature set the system image is targeting before we initialize code generation. So a new functionjl_get_system_image_cpu_target()
is exported, which does exactly what it sounds like.-T
which hadn't been removed yet, so I took the opportunity to do so.When testing this change out, I found this gist helpful to put into my
~/.juliarc.jl