如何在Ubuntu Karmic上安装LFE? [英] How do I install LFE on Ubuntu Karmic?

查看:155
本文介绍了如何在Ubuntu Karmic上安装LFE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Erlang已安装:

  $ dpkg -l | grep erlang 
ii erlang 1:13.b .3-dfsg-2ubuntu2并发的实时分布式功能
ii erlang-appmon 1:13.b.3-dfsg-2ubuntu2 Erlang / OTP应用程序监视器
ii erlang-asn1 1:13。 b.3-dfsg-2ubuntu2用于ASN.1的Erlang / OTP模块支持
ii erlang-base 1:13.b.3-dfsg-2ubuntu2 Erlang / OTP虚拟机和基础应用程序
ii erlang- common-test 1:13.b.3-dfsg-2ubuntu2用于自动测试的Erlang / OTP应用程序
ii erlang-debugger 1:13.b.3-dfsg-2ubuntu2用于调试的Erlang / OTP应用程序和
ii erlang-dev 1:13.b.3-dfsg-2ubuntu2 Erlang / OTP开发库和头
[...更多]

Erlang似乎工作:

  $ erl 
Erlang R13B03(erts-5.7.4)[source] [64位] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false ]

Eshell V5.7.4(中止与^ G)
1>

我从github下载了lfe并签出了0.5.2:

  git clone http://github.com/rvirding/lfe.git 
cd lfe
git checkout -b local0.5.2 e207eb2cad

$ configure
configure:命令未找到

$ make
mkdir -p ebin
erlc -I包含-o ebin -W0 -Ddebug + debug_info src / *。erl
#erl -I -pa ebin -noshell -eval -noshell -run edoc文件src / leex.erl -run init stop
#erl -I -pa ebin -noshell -eval -noshell -run edoc_run应用程序'Leex'''。''[no_packages]'
#mv src / *。html doc /

必须是愚蠢的我错过了:o

  $ sudo make安装
make:***没有规则使目标`install'。停止。

$ erl -noshell -noinput -s lfe_boot start
{init终止do_boot,{undef,[{lfe_boot,start,[]},{init,start_it,1} ,{init,start_em,1}]}}

崩溃转储已写入:erl_crash.dump
init终止于do_boot()
/ pre>

有没有一个例子,我将如何创建一个hello世界源文件并编译并运行它?

解决方案

不,没有你错过的。 LFE中的Makefile是不完美,应该被忽略,在下一个版本中将会得到改进。要补偿已经编译的所有需要​​的文件,并且.beam文件位于 ebin 目录中。因为它不是OTP的一部分,我不认为它应该安装在那里。



最简单的方法来处理这个创建一个私人erlang库目录并指向环境变量ERL_LIBS给它。然后只需放置整个LFE目录。当erlang启动时,代码服务器将自动将 lfe / ebin 目录添加到路径中,并自动找到并加载.beam文件。这将适用于包含ebin目录的任何软件包。这也适用于Windows。所以:


  1. 创建一个libs目录,说〜/ erlang / lib li>
  2. 设置环境变量ERL_LIBS, export ERL_LIBS =〜/ erlang / lib

  3. 把整个LFE目录有

当您启动erlang时,您将看到 / Users / rv / erlang / lib / lfe在代码路径( code:get_path())中的/ ebin (或者无论你拥有它)。然后,您也可以直接使用

 启动LFE shell erl -noshell -noinput -s lfe_boot start 

将有一个 lfe lfe.bat 这将包括在未来。



与erlang一样,任何文本编辑器都可以编辑LFE。对于emacs,有一个LFE模式仍然是基本的,但是工作。您不能在窗口中运行LFE。不久。包含这个的最好方法是将以下内容放在.emacs文件中:

  ;; LFE模式。 
(setq load-path(cons/ Users / rv / erlang / lib / lfe / emacsload-path))
(require'lfe-start)

lfe / examples 中有一些示例文件,都应该工作。在 lfe / test / visual 中有一堆我的测试文件已被包括为示例文件。要从正常的erlang shell编译LFE文件,请执行

  lfe_comp:file(foo)。 
l(foo)。 %没有autloload这里,这样做确保加载

而从LFE shell做:

 (c'foo);这将自动加载

lfe / docs 中有一堆文档,这是非常准确的,但 user_guide.txt 需要扩展。

  http://groups.google.se/group/lisp-flavoured-erlang还有一个Google群组的LFE 

其中包含一些有趣的讨论,人们在github LFE wiki中写了很多。 >

这是我想的。如果/有更多问题,请联系我。


Erlang was already installed:

$dpkg -l|grep erlang
ii  erlang                          1:13.b.3-dfsg-2ubuntu2            Concurrent, real-time, distributed function
ii  erlang-appmon                   1:13.b.3-dfsg-2ubuntu2            Erlang/OTP application monitor
ii  erlang-asn1                     1:13.b.3-dfsg-2ubuntu2            Erlang/OTP modules for ASN.1 support
ii  erlang-base                     1:13.b.3-dfsg-2ubuntu2            Erlang/OTP virtual machine and base applica
ii  erlang-common-test              1:13.b.3-dfsg-2ubuntu2            Erlang/OTP application for automated testin
ii  erlang-debugger                 1:13.b.3-dfsg-2ubuntu2            Erlang/OTP application for debugging and te
ii  erlang-dev                      1:13.b.3-dfsg-2ubuntu2            Erlang/OTP development libraries and header
[... many more]

Erlang seems to work:

$ erl
Erlang R13B03 (erts-5.7.4) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.7.4  (abort with ^G)
1> 

I downloaded lfe from github and checked out 0.5.2:

git clone http://github.com/rvirding/lfe.git
cd lfe
git checkout -b local0.5.2 e207eb2cad

$ configure
configure: command not found

$ make
mkdir -p ebin
erlc -I include -o ebin -W0 -Ddebug +debug_info src/*.erl
#erl -I -pa ebin -noshell -eval -noshell -run edoc file src/leex.erl -run init stop
#erl -I -pa ebin -noshell -eval -noshell -run edoc_run application "'Leex'" '"."' '[no_packages]'
#mv src/*.html doc/

Must be something stupid i missed :o

$ sudo make install
make: *** No rule to make target `install'.  Stop.

$ erl -noshell -noinput -s lfe_boot start
{"init terminating in do_boot",{undef,[{lfe_boot,start,[]},{init,start_it,1},{init,start_em,1}]}}

Crash dump was written to: erl_crash.dump
init terminating in do_boot ()

Is there an example how I would create a hello world source file and compile and run it?

解决方案

No, there is nothing you missed. The Makefile in LFE is "less than perfect" and should be ignored, it will be improved upon in the next release. To compensate all the needed files have already compiled and the .beam files are in the ebin directory. As it is not part of OTP I don't think it should ever install there.

The easiest way to handle this to create a private erlang library directory and point the environment variable ERL_LIBS to it. Then just drop the whole LFE directory there. When erlang starts the code server will automatically add the lfe/ebin directories into the path and the .beam files there will automagically be found and loaded. This will work with any package that contains an ebin directory. This also works on Windows. So:

  1. Make an libs directory, say ~/erlang/lib
  2. Set the environment variable ERL_LIBS, export ERL_LIBS=~/erlang/lib
  3. Put the whole LFE directory there

When you start erlang you will then see /Users/rv/erlang/lib/lfe/ebin (or wherever you have it) in the code path (code:get_path()). You will then also be able to start the LFE shell directly with

erl -noshell -noinput -s lfe_boot start

There will be an lfe and an lfe.bat which does this included as well in the future.

As with erlang any text editor will work to edit LFE. For emacs there is an LFE mode which is still rather basic but works. You cannot yet run LFE in a window. Soon. The best way to include this is to put the following in your .emacs file:

;; LFE mode.
(setq load-path (cons "/Users/rv/erlang/lib/lfe/emacs" load-path))
(require 'lfe-start)

There are some example files in lfe/examples, all should work. In lfe/test/visual there is a bunch of my test files which have been included as example files. To compile an LFE file from the normal erlang shell do

lfe_comp:file("foo").
l(foo).                 %No autloload here, do this to ensure loading

while from the LFE shell do:

(c '"foo")              ;This will autoload

There is a bunch of documentation in lfe/docs which is quite accurate but the user_guide.txt needs to be extended. There is also a Google group for LFE at

http://groups.google.se/group/lisp-flavoured-erlang

which contains some interesting discussions and people have written quite a lot in the github LFE wiki.

That's about it I think. contact me if/when you have more questions.

这篇关于如何在Ubuntu Karmic上安装LFE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆