[erlang-questions] Native code

Kostis Sagonas kostis@REDACTED
Thu Feb 2 08:51:56 CET 2012


On 02/02/12 05:54, József Bérces wrote:
> Hi,
>
> It seems that even after compiling erlang with hipe support, the system modules do not have the native code. For example, beam_lib:info does not show any HX86 section for lists.
>
> Would the system benefit from compiling all files with native code? If yes, is there an easy way to do that? Maybe I missed some switches during compilation?

As somebody else already mentioned, you can use the configure option: 
--enable-native-libs.

However, this currently does not compile all files to native code. It 
only enables native code compilation of files in kernel, stdlib, hipe, 
dialyzer, typer and syntax_tools. There is no fundamental reason for 
this: it is just laziness from my part that I've never bothered adding 
the following lines to the Makefiles of the remaining applications:

ifeq ($(NATIVE_LIBS_ENABLED),yes)
ERL_COMPILE_FLAGS += +native
endif

Ideally, (something like) the above should be added in the `master' 
Makefile instead of on each and every individual Makefile.  Perhaps 
somebody at OTP who knows the Makefile structure better than I do can do 
this change.

Kostis



More information about the erlang-questions mailing list