Blog Categories
Ad Space
Twitter Updates
    follow me on Twitter
    Currently Reading
    Powered by Squarespace
    Git Projects
    « A knock knock joke | Main | Contact List using SproutCore, Mochiweb and Mnesia »
    Thursday
    13Nov

    Adding Erlang library locations

    When adding Erlang libraries there are a few possible ways. The easy way is to add the libraries into the directory /usr/local/lib/erlang/lib. All directories there will be added to the library paths by default. The problem with that is that I don't like mixing 3rd party libraries with the core libraries.

    Enter the ERL_LIBS environment variable. Set that to a directory and all the subdirectories of it that include code will the added automatically to the code path. To add it open up the file /etc/bashrc and add the following:

    ERL_LIBS=/Library/Erlang/lib
    if [ -d $HOME/Library/Erlang/lib ]; then
      ERL_LIBS=$HOME/Library/Erlang/lib:$ERL_LIBS
    fi
    export ERL_LIBS
    

    This way all libraries under /Library/Erlang/lib and /Users/JoeUser/Library/Erlang/lib will be added to Erlangs code paths. The libraries will be in priority before the system libraries but after the -pa code paths. Now you can add things like Mochiweb, Eunit, Nitrogen and more under the /Library/Erlang/lib directory.

    You could also put this in the file /usr/local/bin/erl

    Reader Comments

    There are no comments for this journal entry. To create a new comment, use the form below.

    PostPost a New Comment

    Enter your information below to add a new comment.

    My response is on my own website »
    Author Email (optional):
    Author URL (optional):
    Post:
     
    Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
    Fork me on GitHub