Mac OS X 搭建erlang开发环境

来源:互联网 发布:如何关闭windows更新 编辑:程序博客网 时间:2024/04/30 13:42

一、erlang源码包下载

到elang官网下载.tar.gz文件,下载地址为:http://www.erlang.org/download.html


这里使用的是17.4版本

二、得到otp_src_17.4.tar.gz源码包并解压安装

  1. 进入下载目录
  2. 执行解压命令:tar -zxvf otp_src_17.4.tar.gz 
  3. cd到解压之后的目录:cd otp_src_17.4
  4. 执行./configure ,如果出现以下问题:

    Ignoring the --cache-file argument since it can cause the system to be erroneously configuredDisabling cachingchecking build system type... i386-apple-darwin14.1.0checking host system type... i386-apple-darwin14.1.0checking for gcc... gccchecking for C compiler default output file name... configure: error: C compiler cannot create executablesSee `config.log' for more details.
    这时候就需要检查config.log文件,看到下面的这句话:
    You have not agreed to the Xcode license agreements, please run 'xcodebuild -license' (for user-level acceptance) or 'sudo xcodebuild -license' (for system-wide acceptance) from within a Terminal window to review and agree to the Xcode license agreements.configure:2210: $? = 69configure: failed program was:| /* confdefs.h.  */
    表明自己安装的Xcode从来没有运行过,这时候需要运行一次.点击同意协议之后,Xcode会安装一些组件。安装完之后就可以使用./configure指令了。

  5. 接下来执行make指令,一直等它执行完......。

  6. 最后一步执行sudo make install指令,最后打印出了以下几步,表明安装已经完成。

    ln -s ../lib/erlang/bin/erl erlln -s ../lib/erlang/bin/erlc erlcln -s ../lib/erlang/bin/epmd epmdln -s ../lib/erlang/bin/run_erl run_erlln -s ../lib/erlang/bin/to_erl to_erlln -s ../lib/erlang/bin/dialyzer dialyzerln -s ../lib/erlang/bin/typer typerln -s ../lib/erlang/bin/escript escriptln -s ../lib/erlang/bin/ct_run ct_run
    注:以上在安装过程中出现的警告信息可直接忽略。

三、检查安装是否成功

  1. 在bash环境下输入erl指令出现:
    Erlang/OTP 17 [erts-6.3] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]Eshell V6.3  (abort with ^G)1> 
    恭喜你!erlang环境已经搭建成功。

0 0
原创粉丝点击