I have started using Julia as my language of choice for mathematical programming. It is very nice, faster than Python, open source unlike Matlab, and an intuitive syntax so that migrating is simple. There are precompiled packages that can be downloaded from the website, but for whatever reason I had problems with them. One particular example was when performing a Cholesky decomposition of a matrix. As the matrix size increased the result became less and less similar to the Matlab decomposition of the same matrix and then crashed above a certain size. After googling for quite a while I found it was similar to issues other people had with the linear algebra subroutines. I found that downloading the source from github and compiling on my computer fixed the problem. Hence this is what I would recommend.
This is how to install from a clean install of Linux Mint 17.1, but it should be effectively the same as for any Ubuntu based Linux distribution. Firstly install git
sudo apt-get install git
and clone the latest stable release of julia (at the moment version 0.4) into your folder of choice
git clone -b release-0.4 https://github.com/JuliaLang/julia.git
Then start compiling by typing
make
The chances are that there will be some errors along the way where necessary packages are not installed. The short story is that I needed to install build-essential, gfortran, m4 and cmake.
The long version is that I received the following
checking for gcc... gcc -m64
checking whether the C compiler works... no
configure: error: in `/home/[user]/Documents/git/julia/deps/libuv':
configure: error: C compiler cannot create executables
See `config.log' for more details
make[1]: *** [libuv/config.status] Error 77
make: *** [julia-deps] Error 2
Inside the mentioned log file (./deps/libuv/config.log) there were lines
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: cannot find -lc
/usr/bin/ld: cannot find crtn.o: No such file or directory
Which apparently is caused by missing the libc6-dev
sudo apt-get install build-essential
The next error was
make[2]: gfortran: Command not found
This is clearly because gfortran isn't installed, so
sudo apt-get install gfortran
Then
checking for suitable m4... configure: error: No usable m4 in $PATH or /usr/5bin (see config.log for reasons).
This is fixed by installing m4
sudo apt-get install m4
The final error was
/bin/sh: 2: cmake: not found
which is fixed (unsurprisingly) by
sudo apt-get install cmake
After these the compilation finished without further problems. Julia is then ready to use. Hopefully this list of errors and solutions will be of use to someone.
This is how to install from a clean install of Linux Mint 17.1, but it should be effectively the same as for any Ubuntu based Linux distribution. Firstly install git
sudo apt-get install git
and clone the latest stable release of julia (at the moment version 0.4) into your folder of choice
git clone -b release-0.4 https://github.com/JuliaLang/julia.git
Then start compiling by typing
make
The chances are that there will be some errors along the way where necessary packages are not installed. The short story is that I needed to install build-essential, gfortran, m4 and cmake.
The long version is that I received the following
checking for gcc... gcc -m64
checking whether the C compiler works... no
configure: error: in `/home/[user]/Documents/git/julia/deps/libuv':
configure: error: C compiler cannot create executables
See `config.log' for more details
make[1]: *** [libuv/config.status] Error 77
make: *** [julia-deps] Error 2
Inside the mentioned log file (./deps/libuv/config.log) there were lines
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: cannot find -lc
/usr/bin/ld: cannot find crtn.o: No such file or directory
Which apparently is caused by missing the libc6-dev
package. To install this and other useful packages install the build-essential packagesudo apt-get install build-essential
The next error was
make[2]: gfortran: Command not found
This is clearly because gfortran isn't installed, so
sudo apt-get install gfortran
Then
checking for suitable m4... configure: error: No usable m4 in $PATH or /usr/5bin (see config.log for reasons).
This is fixed by installing m4
sudo apt-get install m4
The final error was
/bin/sh: 2: cmake: not found
which is fixed (unsurprisingly) by
sudo apt-get install cmake
After these the compilation finished without further problems. Julia is then ready to use. Hopefully this list of errors and solutions will be of use to someone.
Comments
Post a Comment