Using "rebar" to work with LFE

68 views
Skip to first unread message

dysinger

unread,
Apr 1, 2010, 1:34:38 PM4/1/10
to Lisp Flavoured Erlang
I really encourage you all to give "rebar" a try (from the fine folks
at Basho). I have patched it to compile LFE code a while back and
it's working great.

# Install LFE as an otp release
git clone git://github.com/dysinger/lfe.git
cd lfe
make && make install
# see the Makefile - it uses rebar to compile ERL code
# & install it as an otp release in my erlang lib dir

# Now that LFE is installed in our erlang as a lib
# lets move to a hello world OTP project
git clone git://github.com/dysinger/lfe-otp-ping-pong.git
cd lfe-otp-ping-pong
./rebar compile verbose=1 ;# compiles LFE & ERL code (if any)
./rebar install ;# installs ping-pong OTP release in my erlang lib

:)

In this way you can use rebar to work with erl & lfe code
interchangeably and in the same project even. All you need is a .app
file in your ebin dir to tel rebar what modules you want to compile.
It will then look for the .erl and .lfe files in src and your deps in
"deps" dir (if any).

-Tim

dun...@cogitat.io

unread,
May 13, 2013, 1:17:58 AM5/13/13
to lisp-flavo...@googlegroups.com
I'm relatively new to Erlang, having spent most of that time playing with LFE directly. I wanted to try out the rebar compile possibilities with a new library I'm experimenting with (written in LFE).

I've got some deps defined in a rebar.config, and those are getting downloaded and compiled correctly.

However, the *.lfe files (well, just one right now) in src aren't getting compiled.

After a rebar clean, rebar compile -v shows everything that is getting compiled, but when it comes to the non-deps (current project), nothing happens. It prints the project name, but that's it.

In order to compile my *.lfe files, I had to do this:

ERL_LIBS=deps/eredis:deps/lfe deps/lfe/bin/lfec -o ebin src/*.lfe

Any thoughts one what's missing? What I need to do?

It's just a library, not an OTP app, so there's no need for a ebin/*.app nor src/*_app.lfe, right?

Thanks for any help!

d

rvirding

unread,
May 13, 2013, 11:31:42 AM5/13/13
to lisp-flavo...@googlegroups.com
I'm not a rebar expert but I am guessing that what is needed is a rule in rebar.config which tells rebar how to compile .lfe files. I will ask a friend who has worked with rebar how to do this. Perhaps how to tell rebar WHERE the lfe compiler is.

Robert

Duncan McGreggor

unread,
May 14, 2013, 10:16:36 PM5/14/13
to lisp-flavo...@googlegroups.com
I have a suspicion that the reason rebar has stopped working may be due to the change in LFE where the executable were moved into a bin dir.

I'm going to take a look at rebar right now and see if I can compile it to work -- apparently it used to work without issue, getting everything automatically...

d


On Mon, May 13, 2013 at 8:31 AM, rvirding <rvir...@gmail.com> wrote:
I'm not a rebar expert but I am guessing that what is needed is a rule in rebar.config which tells rebar how to compile .lfe files. I will ask a friend who has worked with rebar how to do this. Perhaps how to tell rebar WHERE the lfe compiler is.

Robert


--
You received this message because you are subscribed to the Google Groups "Lisp Flavoured Erlang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lisp-flavoured-e...@googlegroups.com.
To post to this group, send email to lisp-flavo...@googlegroups.com.
Visit this group at http://groups.google.com/group/lisp-flavoured-erlang?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Duncan McGreggor

unread,
May 14, 2013, 10:22:28 PM5/14/13
to lisp-flavo...@googlegroups.com
Nope, bad guess; the rebar lfe compiler uses no executables; it calls lfe_comp:file only. Oh well :-/

d

Reply all
Reply to author
Forward
0 new messages