tip for using Julia on OS X

465 views
Skip to first unread message

Kevin Owens

unread,
Nov 28, 2015, 4:00:50 PM11/28/15
to julia-users
tl;dr: how to make a symbolic link in OS X.

So, if you don't want to build Julia from source, you can download the .app on OS X. For me, this doesn't work well because it opens Terminal when I double click on the .app, and I like to use Iterm. Also, there's not an easy way to open or use Julia from the terminal.

The solution is a symbolic link, and running something like this in a terminal:

sudo ln
-s /Applications/Julia-0.4.1.app/Contents/Resources/julia/bin/julia /usr/bin/julia
sudo ln
-s /Applications/Julia-0.4.1.app/Contents/Resources/julia/bin/julia-debug /usr/bin/julia-debug



which creates links in /usr/bin to julia and julia-debug.

David P. Sanders

unread,
Nov 29, 2015, 12:19:22 AM11/29/15
to julia-users
Or just add an alias to ".bash_profile" in your home directory: 

 

Sheehan Olver

unread,
Nov 29, 2015, 5:56:20 AM11/29/15
to julia-users
This won't work in El Capitan as even root is not allowed to write to /usr/bin.  

You could put it in /usr/local/bin if /usr/local exists, otherwise use the alias version, or add "/Applications/Julia-0.4.1.app/Contents/Resources/julia/bin/" to PATH

James Gilbert

unread,
Nov 29, 2015, 10:09:14 AM11/29/15
to julia-users
I have ~/bin in my PATH, and a symlink to julia in there.

Bryan Rivera

unread,
Jan 14, 2016, 12:35:53 AM1/14/16
to julia-users
This works on El Capitan:

sudo nano /etc/paths



Add this line to end of file:

/Applications/Julia-0.4.2.app/Contents/Resources/julia/bin



Ctrl-O then enter to save.

Jeremy Cavanagh

unread,
Jan 14, 2016, 9:47:33 AM1/14/16
to julia-users
Hi Kevin,

I am not a great authority on this but I have been through similar problems using OS X 10.9.5, and believe me things can get messy and you never really get things stable and easily upgradeable by creating lots of links. If you are really keen on doing lots of programming and related topics might I suggest an alternative approach which although initially is quite a lot of work results in the long run with a more reliable system.

That is to use "homebrew", it will make many things eaiser to install as well as keeping them upto date and stored in the correct place. It is easy to find with your favourite search engine. Might I suggest looking at a very helpful article :


This will give good instructions for whatever your version of OS X is.

Once you have homebrew installed simply run:

brew install julia

After this you will need to edit your .bash_profile, here is a copy of mine


PATH=/usr/local/sbin:$PATH

# Set architecture flags
export ARCHFLAGS="-arch x86_64"

# Ensure user-installed binaries take precedence
PATH
=/usr/local/bin:$PATH

# ATTEMPT TO CORRECT PROBLEM WITH OPENBLAS IN JULIA/ATOM
PATH
=/usr/local/opt:$PATH

# Ensure julia is first thing in path
export PATH=/usr/local/bin/julia:$PATH

# Load .bashrc if it exists
test
-f ~/.bashrc && source ~/.bashrc


Then you can run julia from whatever your favourite terminal app is. I have downloaded iTerm and it does work.

I hope this helps, good luck

Reza Malehmir

unread,
Jan 16, 2016, 11:46:39 AM1/16/16
to julia-users
I simply made an alias for julia in my ~/.bashrc file and that should be good enough:
after saving, you just need to source your .bashrc:
source ~/.bashrc
Reply all
Reply to author
Forward
0 new messages