-
-
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
Add function to get libjulia path at runtime #5045
Conversation
just rebased this. Just to clarify this: Are there situations where the system image is not located in the libjulia path? (maybe @vtjnash) |
I believe the current default is for it to be at |
ah ok thanks. I thought that I have seen these files in the same directory on the windows installation. |
This generally seems to be useful to have. |
So this is pretty old, but I wanted to point out that you can get this from julia very easily via |
@staticfloat: Yes, this PR was not intended to provide the location of If I recall correctly the system image is detected relative to the julia_home_dir. With this PR one could alternatively or additionally look if the system image is located in the same directory as libjulia or a subfolder |
@tknopp could you update this PR? This would be useful to have in 0.4. |
@jakebolewski: done. But I am not entirely sure how useful this change alone is. My idea behind this was to change the system image lookup to use a relative path to libjulia.dll |
6c7c7e3
to
1a4c02f
Compare
Please update the indenting and brace placement style to match the rest of our code. |
fix coding style
@JeffBezanson: Alright Jeff. I have updated the code, hopefully it is now conform with the style guide. Do you want to merge/use this? |
FWIW #9266 will allow for directly retrieving the location of the sys.ji file used to launch julia. i don't think that affects this pull request, however, which is more about retrieving the location of libjulia.dll (and potentially using that to find the sys.ji image in the first place) |
@vtjnash Yes this was the motivation when I wrote this. At that time I tried to get embedded Julia running in MSVC and it seemed that JULIA_HOME was not properly set so that the path finding code in julia_init failed. And for this reason I thought it would be more clever to say that sys.so is in a relative path to libjulia. |
@JeffBezanson's comment in #7801 seems relevant here. If Julia can tell you the path you need, why not just fix it so that |
This is about finding libjulia, not sys.ji |
Yes, but the whole point of this patch, as I understand it, is to use the libjulia path to find sys.jl and other files. i.e. it is not the libjulia path itself that is desired or useful. If the goal is to set |
both is true. This is only about libjulia and was meant as a utility function with the motivation to fix jl_init. And #9691 shows that this is still not fixed. If Steven has a better fix this is great. IMHO jl_init should not have an argument. |
@tknopp, I'm not saying that we shouldn't use the libjulia location to fix |
Yes this function does not have to be exported. The |
Closing as fixed by #21299 ( |
This adds a function "jl_get_libjulia_path" that gives the path of the libjulia library at runtime.
I would propose that this path should be the first location where the sys.ji (or sys.so in the future) is searched (in jl_init and repl.c). Once the static compilation branch is merged I can make a PR for changes in jl_init and repl.c
In this PR only the addition of the function is included.