Running Julia in Ubuntu

1,595 views
Skip to first unread message

Angshuman Goswami

unread,
Aug 30, 2016, 1:26:29 AM8/30/16
to julia-users
I was running Julia to run my MPC code. I needed to upgrade and hence i deleted the folder i cloned from git hub. Now I have two problems:

1) Installing julia by sudo get-apt install julia, I get the following message:

Reading package lists... Done
Building dependency tree      
Reading state information... Done
Package julia is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'julia' has no installation candidate

2) When I cloned the github link by  git clone https://github.com/JuliaLang/julia.git

I tried make -j N

it didn't work

3) I then used
git pull && make

Now Julia was updated to 0.4.7
And now I thought it will finally work.
But now when I do i) using PyCall or ii) using RobotOS
I get the following error:
julia: codegen.cpp:3155: llvm::Value* emit_expr(jl_value_t*, jl_codectx_t*, bool, bool): Assertion `ctx->gensym_assigned.at(idx)' failed.

signal (6): Aborted
ERROR: LoadError: Failed to precompile PyCall to /home/odroid/.julia/lib/v0.4/PyCall.ji
while loading /home/odroid/.julia/v0.4/RobotOS/src/RobotOS.jl, in expression starting on line 3

M stuck

Henri Girard

unread,
Aug 30, 2016, 2:55:30 AM8/30/16
to julia...@googlegroups.com

WHICH UBUNTU VERSION ?

Kaj Wiik

unread,
Aug 30, 2016, 4:55:54 AM8/30/16
to julia-users
I have been using the third route very successfully:

Download the binary from e.g.
or


cd /opt

sudo tar xzvf tarball.tgz
A directory like julia-2e358ce975 will be created.

Then make a symlink
sudo ln -s /opt/julia-2e358ce975/bin/julia /usr/local/bin

That's it, very easy.

Note that now you can support multiple versions by making symlinks e.g. julia-v0.5, that's not possible (or very difficult) with the deb packages.

Cheers,
Kaj

Tim Holy

unread,
Aug 30, 2016, 5:34:13 AM8/30/16
to julia...@googlegroups.com
I'm rather surprised that building from source gave you version 0.4.7; I don't
think that makes sense (it should have been master). Are you sure you know
what you're running? (Try `.julia` from the directory in which you built
julia, rather than just `julia`.)

Best,
--Tim

Angshuman Goswami

unread,
Aug 30, 2016, 10:00:29 PM8/30/16
to julia-users
14.04

Angshuman Goswami

unread,
Aug 30, 2016, 10:34:25 PM8/30/16
to julia-users
I did that and now I am getting this error when I type julia to run in the command line
bash: /usr/local/bin/julia: cannot execute binary file: Exec format error

Angshuman Goswami

unread,
Aug 30, 2016, 10:58:39 PM8/30/16
to julia-users
I am running julia on a 32 bit system and I made sure the version i downloaded is 32 bit

Angshuman Goswami

unread,
Aug 31, 2016, 12:08:33 AM8/31/16
to julia-users
julia> Pkg.status()
7 required packages:
 - AmplNLWriter                  0.2.2
 - CoinOptServices               0.1.2
 - IJulia                        1.2.0
 - Ipopt                         0.2.4
 - JuMP                          0.14.0
 - PyCall                        1.7.1
 - RobotOS                       0.4.1
19 additional packages:
 - BinDeps                       0.4.3
 - Calculus                      0.1.15
 - Cbc                           0.2.3
 - Clp                           0.2.2
 - Compat                        0.8.8
 - Conda                         0.2.3
 - DataStructures                0.4.5
 - ForwardDiff                   0.2.4
 - JSON                          0.7.0
 - Lazy                          0.11.0
 - LightXML                      0.3.0
 - MacroTools                    0.3.2
 - MathProgBase                  0.5.4
 - NaNMath                       0.2.1
 - Nettle                        0.2.4
 - ReverseDiffSparse             0.5.8
 - SHA                           0.2.1
 - URIParser                     0.1.6
 - ZMQ                           0.3.4

Angshuman Goswami

unread,
Aug 31, 2016, 12:53:24 AM8/31/16
to julia-users
When i performed build again errors cropped up.

Pkg.build("PyCall")
WARNING: unable to determine host cpu name.
INFO: Building PyCall
INFO: No system-wide Python was found; got the following error:
could not spawn `/usr/local/lib/python2.7 -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'))"`: permission denied (EACCES)
using the Python distribution in the Conda package
INFO: Downloading miniconda installer ...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 24.7M  100 24.7M    0     0  2401k      0  0:00:10  0:00:10 --:--:-- 2743k
INFO: Installing miniconda ...
PREFIX=/home/odroid/.julia/v0.4/Conda/deps/usr
installing: _cache-0.0-py27_x0 ...
installing: python-2.7.11-0 ...
installing: conda-env-2.4.5-py27_0 ...
installing: openssl-1.0.2g-0 ...
installing: pycosat-0.6.1-py27_0 ...
installing: pyyaml-3.11-py27_1 ...
installing: readline-6.2-2 ...
installing: requests-2.9.1-py27_0 ...
installing: sqlite-3.9.2-0 ...
installing: tk-8.5.18-0 ...
installing: yaml-0.1.6-0 ...
installing: zlib-1.2.8-0 ...
installing: conda-4.0.5-py27_0 ...
installing: pycrypto-2.6.1-py27_0 ...
installing: pip-8.1.1-py27_1 ...
installing: wheel-0.29.0-py27_0 ...
installing: setuptools-20.3-py27_0 ...
/home/odroid/.julia/v0.4/Conda/deps/usr/installer.sh: line 288: /home/odroid/.julia/v0.4/Conda/deps/usr/pkgs/python-2.7.11-0/bin/python: cannot execute binary file: Exec format error
ERROR:
cannot execute native linux-32 binary, output from 'uname -a' is:
Linux odroid 3.10.69 #1 SMP PREEMPT Thu Feb 12 15:22:14 BRST 2015 armv7l armv7l armv7l GNU/Linux
===============================[ ERROR: PyCall ]================================

LoadError: failed process: Process(`/home/odroid/.julia/v0.4/Conda/deps/usr/installer.sh -b -f -p /home/odroid/.julia/v0.4/Conda/deps/usr`, ProcessExited(1)) [1]
while loading /home/odroid/.julia/v0.4/PyCall/deps/build.jl, in expression starting on line 17

================================================================================

================================[ BUILD ERRORS ]================================

WARNING: PyCall had build errors.

 - packages with build errors remain installed in /home/odroid/.julia/v0.4
 - build the package(s) and all dependencies with `Pkg.build("PyCall")`
 - build a single package by running its `deps/build.jl` script

================================================================================

Lutfullah Tomak

unread,
Aug 31, 2016, 2:54:38 AM8/31/16
to julia-users
You are on an arm cpu so Conda cannot install python for you. Also, you tried downloading x86 cpu linux binaries, instead try arm nightlies.
To get away with PyCall issues you have to manually install all depencies. 

Kaj Wiik

unread,
Aug 31, 2016, 3:26:40 AM8/31/16
to julia-users
Ah, sorry, I assumed you are using x86_64. Find the arm binary tarball and follow the instructions otherwise. See

Angshuman Goswami

unread,
Aug 31, 2016, 4:48:32 PM8/31/16
to julia-users
I don't get how to do that.

Can you please tell me the steps. Its all too confusing and I am very new to Ubuntu or Julia. Mostly used to work on Matlab. I have no idea how to install dependancies

Angshuman Goswami

unread,
Aug 31, 2016, 4:49:13 PM8/31/16
to julia-users
I don't know how to do this manually. can you please guide.

Jeffrey Sarnoff

unread,
Aug 31, 2016, 11:13:44 PM8/31/16
to julia-users
click on this 
   (doing that should start the downloading of a prebuit-for-arm copy of the development version of julia 
              usually, you would not want the development version -- here, the alternative is to rebuild julia 
              and that is something you may not want to do even more than using a development version. )
when the file finishes downloading, click the file to decompress its contents into a directory of your choice
   (if you have no preference, use the default directory it offers .. but add (without the quotes) "/julia")
after the file expands, go into the julia directory and find the subdirectory "bin" in that subdirectory
   there should be a file named julia.  That is the one to run to start Julia.

I am not familiar with the Arm stuff -- if you have additional questions, post them here (along with any
  helpful context) and someone else is likely to continue on.

Lutfullah Tomak

unread,
Sep 1, 2016, 2:24:43 AM9/1/16
to julia-users
You've already built julia I guess. You need to install python using ubuntu's package system. In command prompt
sudo apt-get install `pkg-name`
will install the package you want to install by asking you your password.
For python
sudo apt-get install python
will install python. Close prompt and open julia and try again building PyCall.jl by Pkg.build().

Angshuman Goswami

unread,
Sep 1, 2016, 5:31:54 PM9/1/16
to julia-users
Thanks everyone for the help.

I managed to install Julia using Nightly builds .

Now I have new problems. When I run the program. I am getting this error.

EXIT: Optimal Solution Found.
finished initial solve!
  ERROR: LoadError: MethodError: no method matching RobotOS.Subscriber{T}(::String, ::Type{barc.msg.Z_KinBkMdl}, ::#SE_callback; queue_size=10)
Closest candidates are:
  RobotOS.Subscriber{T}(::Any...) at /home/odroid/.julia/v0.6/RobotOS/src/pubsub.jl:24 got an unsupported keyword argument "queue_size"
while loading /home/odroid/barc/workspace/src/barc/src/controller_MPC_ARC01.jl, in expression starting on line 198

Angshuman Goswami

unread,
Sep 1, 2016, 5:36:12 PM9/1/16
to julia-users
When I remove the queue I get this error.

ERROR: LoadError: Subscribing to a topic is currently broken on julia v0.5 and above. See
https://github.com/jdlangs/RobotOS.jl/issues/15 for ongoing efforts to fix this.

while loading /home/odroid/barc/workspace/src/barc/src/controller_MPC_ARC01.jl, in expression starting on line 198


Angshuman Goswami

unread,
Sep 1, 2016, 5:38:10 PM9/1/16
to julia-users
I want to use Julia 0.4.6. Can you guide me through the process as if I am a novice

On Thursday, September 1, 2016 at 2:24:43 AM UTC-4, Lutfullah Tomak wrote:

Angshuman Goswami

unread,
Sep 1, 2016, 6:11:07 PM9/1/16
to julia-users
I have downloaded the Julia 0.4.6 from the repository: https://github.com/JuliaLang/julia/releases/tag/v0.4.6
I extracted the folder and copied to opt folder
sudo ln -s /opt/julia-0.4.6/src/julia.h  /usr/local/bin

I made the folder executable using sudo chmod +x *

But I am getting the error:
bash: julia: command not found

Kaj Wiik

unread,
Sep 1, 2016, 6:52:41 PM9/1/16
to julia-users
Hi!

You symlink a wrong file, first 
sudo rm /usr/local/bin/julia.h

The correct symlink line is
sudo ln -s /opt/julia-0.4.6/bin/julia  /usr/local/bin

Angshuman Goswami

unread,
Sep 1, 2016, 7:52:09 PM9/1/16
to julia-users
But there is no folder /bin/julia in the one I downloaded from https://github.com/JuliaLang/julia/releases/tag/v0.4.6

What should be the simlink when I try to build with this ??

Angshuman Goswami

unread,
Sep 1, 2016, 10:09:09 PM9/1/16
to julia-users
I am running on a ARM and I think the latest release 0.4.6 has problems with even the 32 bit (x84)

Can anyone help?

Josh Langsfeld

unread,
Sep 1, 2016, 10:15:05 PM9/1/16
to julia-users
This link is only to an archive of the source code; you would still have to build julia after downloading this.

Ideally what you want is an ARM binary that's version 0.4 instead of a nightly build but I don't see anywhere obvious where that can be downloaded.

RobotOS will start working on 0.5 and up eventually, but you may still need to wait a few weeks.

Angshuman Goswami

unread,
Sep 6, 2016, 4:12:24 PM9/6/16
to julia-users
Anyone has a working version of Julia running on ARM processors?

Lutfullah Tomak

unread,
Sep 6, 2016, 4:21:48 PM9/6/16
to julia-users
I use julia 0.4.6 package from Debian Stretch in arm cpu(with chroot environment in my android phone). It works well and IJulia works too.

Henri Girard

unread,
Sep 7, 2016, 10:24:00 AM9/7/16
to julia-users
I use 0.5 dev, it's very easy to compile and for me works better than the ubuntu versions

Páll Haraldsson

unread,
Sep 8, 2016, 9:26:09 AM9/8/16
to julia-users
On Tuesday, September 6, 2016 at 8:21:48 PM UTC, Lutfullah Tomak wrote:
I use julia 0.4.6 package from Debian Stretch in arm cpu(with chroot environment in my android phone). It works well and IJulia works too.

You mean you use Julia straight on Android, not on Debian or Ubuntu (in a VM under Android)? Interesting.. I had heard of the latter in a VM.

I think I know what chroot is, not quite a VM, lightweight, and you get the file system hierarchy you expect. Was that the point?

[Android isn't strictly supported, only the Linux [kernel], but this indicates to me that nothing more in userspace is needed and only file system changes/chroot is needed (if that..).]


Lutfullah Tomak

unread,
Sep 8, 2016, 9:53:17 AM9/8/16
to julia-users
There are some non-root google play apps(debian noroot by pelya and GNURoot Debian by corbin) that basically provide
chroot into another linux system by using proot library. `Chroot`ing is not using a VM but using a boxed system under a regular android(or any unix) system.
AFAIK,it runs programs natively but some filesystem and socket operations(or some privileged operations)
go through proot(or used chroot library) library to simulate a root system.

Páll Haraldsson

unread,
Sep 8, 2016, 10:16:57 AM9/8/16
to julia-users
On Thursday, September 8, 2016 at 1:53:17 PM UTC, Lutfullah Tomak wrote:
There are some non-root google play apps(debian noroot by pelya and GNURoot Debian by corbin) that basically provide
chroot into another linux system by using proot library.

I was aware of debian-noroot "Debian running on Android [..] This app is NOT full Debian OS - it is a compatibility layer, which allows you to run Debian applications."

Are you saying that is needed (it includes a lot)? I'm thinking what you could minimally get away with. I'm thinking Android Julia applications, not Debian Julia applications. I know other GUI (with complications..), and even "Hello world" (CLI style wouldn't work), just putting that aside (non-"Linux"/X11 compatibility), what does Julia itself require?

Only
https://en.wikipedia.org/wiki/Chroot [or proot, that I'm not familiar with]

command required?

--
Palli.
 

Lutfullah Tomak

unread,
Sep 8, 2016, 11:03:45 AM9/8/16
to julia-users
I didn't say it is required in general in Android. Mostly, we need a way to compile fortran based dependencies.
Google uses llvm compiler toolchain(called android ndk) for native apps but it doesn't have fortran compiler yet.
If those dependencies are left out, julia can be built plainly without FFTW, Blas, and lapack. Other than that only a terminal interface would be required.
Reply all
Reply to author
Forward
0 new messages