3

I use erlIDE (based on Eclipse) to work on Erlang projects. Till today everything was fine, but today I have to use external library (couchbeam) in my application. I found out, what is hell, btw.)

The problem is simple – I cannot include external library to compiler path. I've used rebar to get couchbeam's dependencies and it also downloaded ibrowse, mochiweb and ejson.

How can I include those libraries to compiler path without modifing ERL_LIBS to work on project in erlIDE?

I do not want modify ERL_LIBS, because I can change projects's path, start new one (then I should modify ERL_LIBS again) and so on.

I've tried compiler options in erlIDE:

{pa, {pa, 'site_stater/deps/couchbeam/'}}

or

{pa, {pa, '../deps/couchbeam/'}}

where 'site_stater' – is project's name

I wonder how professional erlang programmers organaze their projects workflow (where they write erlang progs, how debuggin it, deal with external libraries and so on).

Many thanks for your attension.

UPDATE I wrote simple function to load libraries, but I think it is still wrong way to deal with this problem:

load_libraries() ->
    ProjectRoot = filename:join([filename:absname("./"), "site_stater"]),
    {ok, DepsList} = file:list_dir(ProjectRoot ++ "/deps/"),
    lists:foreach(fun (Folder) ->
                       RealFolder = ProjectRoot ++ "/deps/" ++ Folder,
                       case filelib:is_dir(RealFolder) of
                           true ->
                               code:add_patha(filename:join([RealFolder, "/ebin"]));
                           false -> ok
                       end
                  end,
                DepsList),
    ok.
Dmitrii Dushkin
  • 3,070
  • 4
  • 26
  • 37
  • 1
    I know very little about erlIDE but I think it very strange that you should double-nest the directory in a `{pa,...}` directory. – rvirding Jun 11 '11 at 23:54

1 Answers1

3

I can't verify it right now, but you should be able to use {pa, '../deps/couchbeam/'} in the compiler options. If that doesn't work, please try using an absolute path.

The compiler settings are not finished yet, we plan to have some simpler way to refer to external libraries but we're not there yet. Every such query from users increases the importance of fixing it!

regards, Vlad

Vlad Dumitrescu
  • 931
  • 5
  • 11
  • I'm also looking for the solution how to add dependencies to other libraries, in erlide. any news? – etxalpo Oct 25 '13 at 13:13
  • Can you please explain this further? Where in Eclipse do I add paths to external libraries, which my project depends upon. Are there any user guide explaining this? I use erlide 0.23.1.201306270640. – etxalpo Oct 25 '13 at 13:17
  • The project properties have an "Erlang compiler" page where there is a field for miscellaneous options. There you can add Erlang terms (like in the argument for compile:file/2) with configuration that doesn't have UI. – Vlad Dumitrescu Oct 25 '13 at 14:58
  • Just a note, I am currently working on integrating make/emake/rebar builders, so it will no longer be necessary to do these "magic" configs. It will take a few weeks until it's ready for beta testing. – Vlad Dumitrescu Oct 25 '13 at 15:00
  • @VladDumitrescu It appears in 2015 the same questions are still relevant. Trying to embed yaws into an erlide project and also spent a while trying to find a solution on how to reference it. Why not simply add a "references" folder to the project tree view - visual studio style? (Right click - Add Reference)?! – BitTickler Aug 29 '15 at 03:32
  • @BitTickler - that's a good suggestion. The problem is that I don't want to add another way to configure projects, but move to using rebar.config or the like. But there are projects that don't use those and it's tricky to make things work in all cases. Maybe I should stop trying to get a perfect solution and live with a "good enough" one. – Vlad Dumitrescu Aug 31 '15 at 10:37
  • Having done a quite wide survey on old and new programming languages in the past months (fun ride!), looking at "alien" technologies (LISP, Prolog, ,...), at all those related build systems and IDE-attempts, as well as getting a bit into "programming language theory", I am inclined to say that the next big things will/should be: 1. The perfect "Add new language to IDE XY- wizard" 2. A well working GLR parser tool chain. A powerful logic library (unification + temporal logic + ...). All 75% there, none 100%. @VladDumitrescu I am aware how tough it is to get stuff done in this 75% world.. – BitTickler Aug 31 '15 at 17:51