Simplest way to start Julia with threading on MacOS

Simplest way to start Julia with threading on MacOS

Hi!

I have a collaborator with a Mac computer but without admin rights.
Julia is installed on the computer, but not added to path.

Now, I want to find the simplest possible way to start Julia with threading. (My knowledge of MacOS is limited.)

Some alternatives:

  1. Set a persistent environment variable JULIA_NUM_THREADS. Is this possible without admin rights? How do I do it so that it affects Julia when run from the dock/launchpad and not only from the terminal?

  2. Create a shell script launching julia with -t auto. The user must then use this instead of launching Julia from the dock/launchpad.

Are there other ways?

It seems like it should be simple, but I really don’t know how to achieve this in a way that’s convenient for the user.

The user has no experience with a terminal or environment variables, but I can get access to the computer if that’s necessary.

Using VSCode + setting the path to Julia and number of threads in the options of the extension?

1 Like

Thanks, I didn’t think of that since I don’t use VSCode myself.
But it does sound easier than my other alternatives!

Unfortunately it’s also not possible to install VSCode without admin rights, so if possible I would like to avoid that. (But going to IT again and ask them to install another program should be possible.)

Use a startup.jl file?

It’s too late to set JULIA_NUM_THREADS in startup.jl, isn’t it?
https://docs.julialang.org/en/v1/manual/environment-variables/