Ubuntu上安装Julia

Ubuntu下安装Julia

需要在Julia下进行编程。首先我们需要安装ubuntu14-desktop版本。然后在此基础上安装julia。

1.首先需要在线下载julia的源程序,为了下载源程序,我们必须更新各种包。在终端下执行sudo apt-get update来更新包。

2.安装编译需要的包,执行sudo apt-get install 包名 来安装程序。

GNU make —building dependencies.

gcc, g++ —compiling and linking C, C++

clang — clang isthe default compiler on OS X (Need at least v3.1, Xcode 4.3.3 on OS X)

gfortran —compiling and linking fortran libraries

git — versioncontrol and package management.

perl —preprocessing of header files of libraries.

wget, curl, orfetch (FreeBSD) — to automatically download external libraries.

m4 — needed tobuild GMP.

patch — formodifying source code.

还有这个包libncurses5-dev

3.下载Julia源码包

git clonegit://github.com/JuliaLang/julia.git

或者

git config--global url."https://".insteadOf git://

4.全部下载完成后,进入julia目录cd julia/

执行make命令。

等待大约两个小时,安装完成。

5.安装完成,在根目录下执行julia/julia就可以了。

6.命令行下执行export PATH=~/julia/:$PATH可以配置path变量

这样可以直接执行julia来跑命令了。

7.执行简单测试程序1+1回车,输出2。typeof(ans)输出Int32

Ubuntu上安装Julia

         Tips:

         1.请查看您是否正以root用户运行

sudo -i输入密码之后切换到root用户

或者sudo apt-get install julia

 

2.注意事项

Linux

GCC version 4.6or later is recommended to build Julia.

If the buildfails trying to compile OpenBLAS, set OPENBLAS_TARGET_ARCH to BARCELONA on AMD,or NEHALEM on Intel CPUs in Make.inc and build again.

On some Linuxdistributions you may need to change how the readline library is linked. If youget a build error involving readline, setUSE_SYSTEM_READLINE=1 in Make.user.

On Ubuntusystems, you may also need to install the package libncurses5-dev.

On CentOS 5systems, the default compiler (gcc 4.1) is too old to build Julia.