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

mac binary that works better with IJulia #4222

Closed
JeffBezanson opened this issue Sep 6, 2013 · 15 comments
Closed

mac binary that works better with IJulia #4222

JeffBezanson opened this issue Sep 6, 2013 · 15 comments
Labels
mac Affects only macOS priority This should be addressed urgently
Milestone

Comments

@JeffBezanson
Copy link
Sponsor Member

My understanding is that the mac binary does not include a script to start julia with the right environment variables without also opening a terminal. There should be a script suitable for starting kernels inside IJulia.

@ViralBShah
Copy link
Member

The fastest thing to do is to detect if we are shipping out own git and if so, set the environment variables during Julia startup. No script should be necessary here. @staticfloat how are you doing it right now?

ViralBShah pushed a commit that referenced this issue Sep 8, 2013
Currently, this duplicates the stuff in contrib/mac/app/script, but
it should not hurt.

Hoping this helps #4222
@ViralBShah
Copy link
Member

@stevengj This should hopefully fix the issue you were facing. I cannot test this setup on my mac since I have Xcode installed.

@staticfloat This is a slightly different approach than the wrapper.

Also Cc: @loladiro @vtjnash

@stevengj
Copy link
Member

See also JuliaLang/IJulia.jl#67 for another path-related problem in the Mac binaries.

Currently, I'm working around all of these issues by manually updating the path, but a longer-term solution would be nice.

@JeffBezanson
Copy link
Sponsor Member Author

Would be nice to make some progress on this and #4241. Students are running into this repeatedly.

@ViralBShah
Copy link
Member

Can ijulia invoke a script rather than a binary? @staticfloat had a branch with s potential fix but it was not working the last I tried.

@stevengj
Copy link
Member

One option is for IJulia on OSX to have IPython invoke Julia via bash -lc "/path/to/julia /path/to/kernel.jl".

However, that doesn't solve the issue that PyCall won't work when people run the Mac binary directly (since python won't invoke the correct version of Python). So Julia might need to be a script as well (which should work once we explicitly invoke bash in the IPython profile).

@JeffBezanson, are students still running into this, despite my workaround of invoking bash -lc "which python" and setting the PATH in the IJulia kernel?

@vtjnash
Copy link
Sponsor Member

vtjnash commented Sep 17, 2013

How about adding a juliarc.jl file to the dist and have it loaded at startup. That should allow this sort of customization without any external scripts needed (which seem to inevitably just add confusion).

@staticfloat
Copy link
Sponsor Member

Actually, the .juliarc.jl idea is the best one yet. Can it live inside of
the .app, or do we have to "install" it to the users home directory?
On Sep 17, 2013 5:52 AM, "Jameson Nash" notifications@github.com wrote:

How about adding a juliarc.jl file to the dist and have it loaded at
startup. That should allow this sort of customization without any external
scripts needed (which seem to inevitably just add confusion).


Reply to this email directly or view it on GitHubhttps://github.com//issues/4222#issuecomment-24585390
.

@stevengj
Copy link
Member

I'm not sure I follow. Is the proposal that people should make any PATH modifications in both .profile and .juliarc.jl? That makes life harder, because automated installers like Anaconda's only know about .profile.

@staticfloat
Copy link
Sponsor Member

The problem is that the environment modifications we need to make are
Julia-specific. I don't think its reasonable or even a good idea to ask
users to modify their system-wide environment to get a .app to run.

bash -l won't help us here, for the above stated rationale.

I like the .juliarc.jl idea because it's an existing mechanism and is
completely transparent to the shell, so there (ideally) shouldn't be ways
to invoke Julia without getting these environment variables set. (As there
are now)

Is .juliarc.jl read on IJulia kernel startup?

@staticfloat
Copy link
Sponsor Member

@ViralBShah; taking a look at your setupenv.jl, those lines are going to be baked into the system image, which isn't what we want; we want to evaluate those lines whenever Julia starts up. I think what we need is a .juliarc.jl that the user can edit (what we have now with ~/.juliarc.jl) and a juliarc.jl that lives inside the distribution, which is invoked before ~/.juliarc.jl, so that users can override the its settings.

What do you guys think? I'll submit a PR for reading in JULIA_HOME/etc/julia/juliarc.jl at startup if you think this is a reasonable idea.

@ViralBShah
Copy link
Member

juliarc.jl seems to be the right solution. Perhaps we can have a command line parameter for alternate locations of this file, and also look by default in a couple of other places, like inside the app directory structure on OS X.

@staticfloat
Copy link
Sponsor Member

On second thought, I think etc/ is the proper place for this. So on an installed system, you would edit <prefix>/etc/julia/juliarc.jl

@vtjnash
Copy link
Sponsor Member

vtjnash commented Sep 17, 2013

@staticfloat that's what i was thinking. perhaps the name shouldn't be the same, to reduce confusion? but perhaps it is better that they are the same to commonality? I was also thinking of suggesting other names such as site.jl, but it was tough to type too much more on my phone.

If you do that, I have a few lines windows-only lines that are currently in repl.jl::_start which would probably be more appropriate for this file (setting various environment variables and such).

@staticfloat
Copy link
Sponsor Member

This should be fixed by #4351

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mac Affects only macOS priority This should be addressed urgently
Projects
None yet
Development

No branches or pull requests

5 participants