./configure Command Execute error (Centos7 Install erlang)

Windows uploads Erlang installation package to virtual machine

Install the file upload program:

# yum install -y lrzsz

Upload file:

# rz

Unzip package:

# tar -zxvf otp_src_24.3.2.tar.gz

Enter the decompression Directory:

# cd /-My_PATH-/otp_src_24.3.2/

Execute “./configure –prefix=/usr/local/erlang” command error:

[[email protected] otp_src_24.3.2]# ./configure --prefix=/usr/local/erlang
=== Running configure in /usr/local/software/otp_src_24.3.2/erts ===
./configure '--prefix=/usr/local/erlang' --disable-option-checking --cache-file=/dev/null --srcdir="/usr/local/software/otp_src_24.3.2/erts"
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/usr/local/software/otp_src_24.3.2/erts':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
ERROR: /usr/local/software/otp_src_24.3.2/erts/configure failed!
Killed

Solution:

Install C + + compilation environment: sudo yum install gcc-c++

[[email protected] otp_src_24.3.2]# sudo yum install gcc-c++
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.sjtu.edu.cn
 * extras: mirrors.nju.edu.cn
 * updates: mirrors.nju.edu.cn
Resolving Dependencies

--------------------------省略!!------------------------

Installed:
  gcc-c++.x86_64 0:4.8.5-44.el7                                                                            

Dependency Installed:
  cpp.x86_64 0:4.8.5-44.el7                               gcc.x86_64 0:4.8.5-44.el7                       
  glibc-devel.x86_64 0:2.17-325.el7_9                     glibc-headers.x86_64 0:2.17-325.el7_9           
  kernel-headers.x86_64 0:3.10.0-1160.59.1.el7            libmpc.x86_64 0:1.0.1-3.el7                     
  libstdc++-devel.x86_64 0:4.8.5-44.el7                   mpfr.x86_64 0:3.1.1-4.el7                       

Dependency Updated:
  glibc.x86_64 0:2.17-325.el7_9                    glibc-common.x86_64 0:2.17-325.el7_9                   

Complete!

After installation, re-execute . /configure command again and found a new problem.

configure: error: Perl version 5 is required to build the emulator!
ERROR: /usr/local/otp_src_24.3.2/erts/configure failed!
Killed

Then we install another one

# yum install perl

Then there are new problems:

configure: error: No curses library functions found
ERROR: /usr/local/otp_src_24.3.2/erts/configure failed!
Killed

At this time, you need to install the log Library:

# yum -y install ncurses-devel

Then re-execute ./configure command, no exception~

Set environment variables:

# vi /etc/profile

Press Enter to go to the bottom, then press keyboard i to enter edit mode and configure the environment variables.

#set erlang environment
export PATH=$PATH:/usr/local/erlang/bin

After the configuration is completed, press ESC to exit the editing mode and enter the Save command:

:wq

Refresh the profile to take effect:

# source /etc/profile

Check whether Erlang is successfully installed:

[[email protected] otp_src_24.3.2]# erl -version
Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 12.3

Done!

Read More: