Search code examples
ubuntuerlangvirtualboxhipekerl

Erlang vm loads without hipe support on ubuntu vm


I recently installed Ubuntu 16.04 Server on a Virtualbox vm. After that I wanted to install erlang using the following script:

#!/bin/sh
DESTDIR="$HOME/workspace/erlang"
ACTIVATE=". $DESTDIR/activate"
KERL_CONFIGURE_DISABLE_APPLICATIONS="odbc"
KERL_CONFIGURE_OPTIONS="--enable-dirty-schedulers --enable-hipe --with-openssl" 

curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl
chmod a+x kerl
./kerl update releases
mkdir -p "$DESTDIR"
./kerl build 19.0 erlang.19.0.dirty_sched.ssl
./kerl install erlang.19.0.dirty_sched.ssl "$DESTDIR"
echo "$ACTIVATE" >> "$HOME/.bashrc"
"$ACTIVATE"

The script works fine, but even though I explicitly enabled hipe the erlang vm boots up without hipe support:

$ erl
Erlang/OTP 19 [erts-8.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [kernel-poll:false]

Eshell V8.0  (abort with ^G)
1>

I tried to ./configure & make otp manually in the kerl build directory, and it seems hipe support is enabled fine. However, the same problem persists with the manual build:

~/.kerl/builds/erlang.19.0.dirty_sched.ssl/otp_src_19.0/bin$ ./erl
Erlang/OTP 19 [erts-8.0] [source] [64-bit] [smp:8:8] [async-threads:10] [kernel-poll:false]

Eshell V8.0  (abort with ^G)
1>

I use the same setup on a physical Ubuntu host and there hipe works seamlessly so I'm starting to wonder if this has to do with the fact that this machine is virtualized: are there any cpu features that hipe requires? What am I missing?


Solution

  • As listed in Erlang/OTP Build and Install page, there are some Required Utilities needed for the installation. As mentioned their:

    These are the tools you need in order to unpack and build Erlang/OTP.
    . . .

    • GNU m4 -- If HiPE (native code) support is enabled.

    So you would need to install GNU m4 in order to have HiPE support enabled.
    Install it using the following command:

    sudo apt-get install m4