在CentOS下,源码安装Erlang:
下载Erlang源码
安装:官网地址,http://www.erlang.org
# cd /opt/
# wget http://www.erlang.org/download/otp_src_R15B02.tar.gz
解压:
- # tar -zxvf otp_src_R15B02.tar.gz
- # cd otp_src_R15B02
# tar -zxvf otp_src_R15B02.tar.gz
# cd otp_src_R15B02
安装依赖:
- # yum install build-essential m4
- # yum install openssl
- # yum install openssl-devel
- # yum install unixODBC
- # yum install unixODBC-devel
- # yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel
# yum install build-essential m4
# yum install openssl
# yum install openssl-devel
# yum install unixODBC
# yum install unixODBC-devel
# yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel
配置configure
- # ./configure --prefix=/usr/local/erlang --enable-hipe --enable-threads --enable-smp-support --enable-kernel-poll
-
- make
-
- make install
# ./configure --prefix=/usr/local/erlang --enable-hipe --enable-threads --enable-smp-support --enable-kernel-poll
make
make install
完成之后,设置环境变量
- vim /etc/profile
-
- ERL_HOME=/usr/local/erlang
- PATH=$ERL_HOME/bin:$PATH
- export ERL_HOME PATH
vim /etc/profile
ERL_HOME=/usr/local/erlang
PATH=$ERL_HOME/bin:$PATH
export ERL_HOME PATH
完成后保存
source /etc/profile
让环境变量立即生效
然后输入erl,出现erlang shell,如下:
- Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]
-
- Eshell V5.9.1 (abort with ^G)
- 1>
Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.9.1 (abort with ^G)
1>
hipe:支持Erlang编译成本地代码。好处:提高Erlang虚拟机执行代码性能。
参考文献:
[1] http://jinghong.iteye.com/blog/1075165
[2] http://my.oschina.net/hanyu363/blog/29727
[3] http://www.linuxidc.com/Linux/2011-07/39156.htm
重启centos
yum install git
mkdir erl_lib
cd erl_lib
git clone git://github.com/nitrogen/nitrogen.git
cd nitrogen
修改deps 目录中的源码,重新生成rel目录才会生效
make rel_inets //编译生成rel目录
进入rel目录 cd rel/nitrogen
./
bin/nitrogen console 启动服务器
open http://localhost:8000
访问页面http://localhost:8000成功
修改 nitrogen/deps/nitrogen_core/src/elements/other/element_google_chat.erl
在 Type = [ 中加入
overlapped_vertical_bar -> "bvo";
overlapped_horizontal_bar -> "bho";
两个chart type 类别
在 BarSize = case MaxValueLength of 中加入
overlapped_horizontal_bar -> Record#google_chart.height;
overlapped_vertical_bar -> Record#google_chart.width;
两个新的条件控制其最大值
运行状态下:
sync:go() 实时编译命令
bin/dev compile 重编译命令
关闭状态下:
make compile 重编译