centos7安装erlang时执行./configure命令报错解决

Windows上传erlang安装包到虚拟机上

安装上传文件程序:

# yum install -y lrzsz

上传文件:

# rz

解压包:

# tar -zxvf otp_src_24.3.2.tar.gz

进入解压目录:

# cd /-自己的路径-/otp_src_24.3.2/

执行./configure --prefix=/usr/local/erlang命令报错,提示:

[root@localhost 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

解决方案:

安装C++编译环境:sudo yum install gcc-c++

[root@localhost 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!

安装完后,重新执行./configure命令发现又出现新的问题:

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

接着我们再安装另外一个

# yum install perl

接着又出现新的问题:

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

此时需要安装日志库:

# yum -y install ncurses-devel

然后重新执行./configure命令,无异常!~

设置环境变量:

# vi /etc/profile

按Enter键走到最底部,再按键盘i键进入编辑模式 ,配置环境变量:

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

配置完成,按Esc退出编辑模式,输入保存命令:

:wq

刷新配置文件,使其生效:

# source /etc/profile

查看erlang是否安装成功:

[root@localhost otp_src_24.3.2]# erl -version
Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 12.3

大功告成!

  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值