# Failed to compile Erlang 25.0.2 on Redhat7

**URL:** <https://erlangforums.com/t/failed-to-compile-erlang-25-0-2-on-redhat7/1575>\
**Category:** Questions / Help\
**Tags:** erlang-otp\
**Created:** [June 23, 2022, 9:43am UTC](https://erlangforums.com/t/failed-to-compile-erlang-25-0-2-on-redhat7/1575 "2022-06-23T09:43:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zabrane](https://erlangforums.com/letter_avatar_proxy/v4/letter/z/7ba0ec/32.png) [@zabrane](https://erlangforums.com/u/zabrane)\
**Post date:** [June 23, 2022, 9:43am UTC](https://erlangforums.com/t/failed-to-compile-erlang-25-0-2-on-redhat7/1575/1 "2022-06-23T09:43:10Z")

</div>

Hi guys,

I’m trying to compile Erlang 25.0.2 on Redhat7 but got this error:

```nohighlight
[...]
gmake[3]: Entering directory '/home/zab/.kerl/builds/25.0.2/otp_src_25.0.2/lib/os_mon/src'
 ERLC ../ebin/disksup.beam
 ERLC ../ebin/memsup.beam
 ERLC ../ebin/cpu_sup.beam
Function: cpu_util_rel/3
Sub pass ssa_opt_type_start
cpu_sup.erl: internal error in pass beam_ssa_opt:
exception error: no function clause matching beam_types:make_float(NaN,NaN)
  in function beam_ssa_type:'-normalized_types/2-lc$^0/1-0-'/2
  in call from beam_ssa_type:simplify/2
  in call from beam_ssa_type:simplify/5
  in call from beam_ssa_type:sig_is/7
  in call from beam_ssa_type:sig_bs/8
  in call from beam_ssa_type:sig_function_1/4
  in call from beam_ssa_type:do_sig_function/4
gmake[3]: *** [/home/zab/.kerl/builds/25.0.2/otp_src_25.0.2/make/x86_64-pc-linux-gnu/otp.mk:129: ../ebin/cpu_sup.beam] Error 1
gmake[3]: Leaving directory '/home/zab/.kerl/builds/25.0.2/otp_src_25.0.2/lib/os_mon/src'
gmake[2]: *** [/home/zab/.kerl/builds/25.0.2/otp_src_25.0.2/make/otp_subdir.mk:29:

```

My config:

- gcc: 11.2.1
- lsb\_release: Redhat 7.9

Note: compiling 24.3.4.2 went fine

Help appreciated.

---

<div class="post-metadata">

**Author:** ![mikpe](https://erlangforums.com/letter_avatar_proxy/v4/letter/m/b487fb/32.png) [@mikpe](https://erlangforums.com/u/mikpe)\
**Post date:** [June 23, 2022, 3:03pm UTC](https://erlangforums.com/t/failed-to-compile-erlang-25-0-2-on-redhat7/1575/2 "2022-06-23T15:03:13Z")

</div>

Try a git bisect. NaNs and Infs are strictly prohibited in the Erlang VM (unless that changed recently and I failed to notice).

Is that you own gcc installation? AFAIK stock RHEL-7.9 should have a much older 4.8.something gcc.

---

<div class="post-metadata">

**Author:** ![zabrane](https://erlangforums.com/letter_avatar_proxy/v4/letter/z/7ba0ec/32.png) [@zabrane](https://erlangforums.com/u/zabrane)\
**Post date:** [June 23, 2022, 3:44pm UTC](https://erlangforums.com/t/failed-to-compile-erlang-25-0-2-on-redhat7/1575/3 "2022-06-23T15:44:42Z")

</div>

Hi Mikael  
That’s correct, RH7 is shipped with an old gcc v4.8.  
We don’t use it because Redhat also offers devtoolset-11 (gcc 11.2.1).  
All our builds 22,23,24 compile just fine with gcc 11.2.1.

---

<div class="post-metadata">

**Author:** ![zabrane](https://erlangforums.com/letter_avatar_proxy/v4/letter/z/7ba0ec/32.png) [@zabrane](https://erlangforums.com/u/zabrane)\
**Post date:** [June 23, 2022, 4:57pm UTC](https://erlangforums.com/t/failed-to-compile-erlang-25-0-2-on-redhat7/1575/4 "2022-06-23T16:57:28Z")

</div>

Same error on Ubuntu 20.04LTS:

```nohighlight
$ tail /home/zab/.kerl/builds/25.0.2/otp_build_git.log
make[3]: Leaving directory '/home/zab/.kerl/builds/25.0.2/otp_src_git/lib/crypto/c_src'
make[3]: Entering directory '/home/zab/.kerl/builds/25.0.2/otp_src_git/lib/crypto/doc/src'
make[3]: Nothing to be done for 'opt'.
make[3]: Leaving directory '/home/zab/.kerl/builds/25.0.2/otp_src_git/lib/crypto/doc/src'
=== Leaving application crypto
make[2]: Leaving directory '/home/zab/.kerl/builds/25.0.2/otp_src_git/lib/crypto'
make[2]: Entering directory '/home/zab/.kerl/builds/25.0.2/otp_src_git/lib/os_mon'
=== Entering application os_mon
make[3]: Entering directory '/home/zab/.kerl/builds/25.0.2/otp_src_git/lib/os_mon/src'
 ERLC ../ebin/disksup.beam
 ERLC ../ebin/memsup.beam
 ERLC ../ebin/cpu_sup.beam
Function: cpu_util_rel/3
Sub pass ssa_opt_type_start
cpu_sup.erl: internal error in pass beam_ssa_opt:
exception error: no function clause matching beam_types:make_float(NaN,NaN)
  in function beam_ssa_type:'-normalized_types/2-lc$^0/1-0-'/2
  in call from beam_ssa_type:simplify/2
  in call from beam_ssa_type:simplify/5
  in call from beam_ssa_type:sig_is/7
  in call from beam_ssa_type:sig_bs/8
  in call from beam_ssa_type:sig_function_1/4
  in call from beam_ssa_type:do_sig_function/4
make[3]: *** [/home/zab/.kerl/builds/25.0.2/otp_src_git/make/x86_64-pc-linux-gnu/otp.mk:129: ../ebin/cpu_sup.beam] Error 1
make[3]: Leaving directory '/home/zab/.kerl/builds/25.0.2/otp_src_git/lib/os_mon/src'
make[2]: *** [/home/zab/.kerl/builds/25.0.2/otp_src_git/make/otp_subdir.mk:29: opt] Error 2
make[2]: Leaving directory '/home/zab/.kerl/builds/25.0.2/otp_src_git/lib/os_mon'
make[1]: *** [/home/zab/.kerl/builds/25.0.2/otp_src_git/make/otp_subdir.mk:29: opt] Error 2
make[1]: Leaving directory '/home/zab/.kerl/builds/25.0.2/otp_src_git/lib'
make: *** [Makefile:511: libs] Error 2

```

```nohighlight
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal

```

```nohighlight
$ gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0

```

My .kerlrc config:

```nohighlight
export ERTS_OPCODE_COUNTER_SUPPORT=1
export CFLAGS="-march=x86-64 -O3 -fstack-protector -fomit-frame-pointer -fexpensive-optimizations"

```

Have anyone succeed compiling 25.0.2?

---

<div class="post-metadata">

**Author:** ![zabrane](https://erlangforums.com/letter_avatar_proxy/v4/letter/z/7ba0ec/32.png) [@zabrane](https://erlangforums.com/u/zabrane)\
**Post date:** [June 23, 2022, 6:20pm UTC](https://erlangforums.com/t/failed-to-compile-erlang-25-0-2-on-redhat7/1575/5 "2022-06-23T18:20:27Z")

</div>

OK guys. Dropping “-fexpensive-optimizations” from CFLAGS makes it compile just fine.  
Thanks for your help
