Erlang使用Rebar进行部署,hipe错误{“init终止于do_boot”,{'无法加载',hipe,get_file}}

时间:2012-11-09 18:29:42

标签: erlang rebar hipe

对Erlang来说很新,任何尝试使用钢筋运行简单的hello world程序都会导致以下错误:

./rel/mysample/bin/mysample console
Exec: /home/jwong/erlang_examples/mysample/rel/mysample/erts-5.9.2/bin/erlexec -boot   /home/jwong/erlang_examples/mysample/rel/mysample/releases/1/mysample -mode embedded -config   /home/jwong/erlang_examples/mysample/rel/mysample/releases/1/sys.config -args_file    /home/jwong/erlang_examples/mysample/rel/mysample/releases/1/vm.args -- console
Root: /home/jwong/erlang_examples/mysample/rel/mysample
{"init terminating in do_boot",{'cannot load',hipe,get_file}}

Crash dump was written to: erl_crash.dump
init terminating in do_boot ()

erl -init_debug

{progress,preloaded}
{progress,kernel_load_completed}
{progress,modules_loaded}
{start,heart}
{start,error_logger}
{start,application_controller}
{progress,init_kernel_started}
{apply,{application,load,[{application,stdlib,[{description,"ERTS  CXC 138 10"},{vsn,"1.18.2"},{id,[]},{modules,[array,base64,beam_lib,binary,c,calendar,dets,dets_server,dets_sup,dets_utils,dets_v8,dets_v9,dict,digraph,digraph_utils,edlin,edlin_expand,epp,eval_bits,erl_bits,erl_compile,erl_eval,erl_expand_records,erl_internal,erl_lint,erl_parse,erl_posix_msg,erl_pp,erl_scan,erl_tar,error_logger_file_h,error_logger_tty_h,escript,ets,file_sorter,filelib,filename,gb_trees,gb_sets,gen,gen_event,gen_fsm,gen_server,io,io_lib,io_lib_format,io_lib_fread,io_lib_pretty,lib,lists,log_mf_h,math,ms_transform,orddict,ordsets,otp_internal,pg,pool,proc_lib,proplists,qlc,qlc_pt,queue,random,re,sets,shell,shell_default,slave,sofs,string,supervisor,supervisor_bridge,sys,timer,unicode,win32reg,zip]},{registered,[timer_server,rsh_starter,take_over_monitor,pool_master,dets]},{applications,[kernel]},{included_applications,[]},{env,[]},{maxT,infinity},{maxP,infinity}]}]}}
{progress,applications_loaded}
{apply,{application,start_boot,[kernel,permanent]}}
Erlang R15B02 (erts-5.9.2) [source] [64-bit] [smp:4:4] [async-threads:0] [kernel-poll:false]

{apply,{application,start_boot,[stdlib,permanent]}}
{apply,{c,erlangrc,[]}}
{progress,started}
Eshell V5.9.2  (abort with ^G)

我正在运行ubuntu 12.04,使用的是使用没有标志选项的kerl编译的erlang。我对生成的reltool.config进行的唯一修改是将“../../”添加到lib_dirs。

它看起来非常相似[这个问题] [1]但是在reltool.config中添加“hipe”会导致错误:

{'EXIT',{{badmatch,{error,"Illegal option: [{app,mysample,hipe,[{mod_cond,app},{incl_cond,include}]}]"}}

发生了什么,我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

这与the linked question

完全相同

问题是我在reltool.config中的错误区域添加了这行。

钢筋生成:

app, mysample, [{mod_cond, app}, {incl_cond, include}]}

自动配置。而不是使用“hipe”编辑行,或将其添加到文件的底部,正确的配置是将其添加到生成的应用程序下面的sys数组中,以便它看起来像:

{app, mysample, [{mod_cond, app}, {incl_cond, include}]},
{app, hipe, [{incl_cond, exclude}]}