[erlang-bugs] --enable-native-libs is broken

Kostis Sagonas kostis@REDACTED
Fri Jul 18 09:18:21 CEST 2014


On 07/18/2014 07:46 AM, Louis-Philippe Gauthier wrote:
> Hi,
> I've been trying to compile 17.1 with native libs... without any
> success. I get different errors on Linux and OSX.
>
> Linux:
>
> % build
>
> tar -xzf otp_src_17.1.tar.gz && cd otp_src_17.1/
> ./configure --enable-smp-support --enable-threads --enable-kernel-poll
> --enable-hipe --enable-native-libs
> make
>
> % install
>
> sudo su
> rm -rf /usr/local/lib/erlang/
> make install
>
> % test
>
> erl
> Erlang/OTP 17 [erts-6.1] [source] [64-bit] [smp:2:2] [async-threads:10]
> [hipe] [kernel-poll:false]
>
> Eshell V6.1  (abort with ^G)
> 1> code:is_loaded(gen_server).
> {file,"/usr/local/lib/erlang/lib/stdlib-2.1/ebin/gen_server.beam"}
> 2> code:is_module_native(gen_server).
> false

This is a known issue.  It's due to the fact that the tar balls that are 
distributed by Ericsson have prebuilt .beam files in them, which do not 
contain native code.  For these files, the options supplied to configure 
are ineffective. (I would actually classify this as a bug.)

So, one needs to do a make clean after unpacking.  Try the following 
sequence of commands:

tar -xzf otp_src_17.1.tar.gz && cd otp_src_17.1/
make clean
./configure --enable-smp-support --enable-threads --enable-kernel-poll 
--enable-hipe --enable-native-libs
make

This should give you a system with .beam files containing native code 
for the main applications (e.g. kernel, stdlib, compiler, ...)


For the OSX issues I cannot help you much I am afraid since I do not 
have access to such an environment to try it out.

Kostis



More information about the erlang-bugs mailing list