Compiling Erlang on Ubuntu

For playing with distributed stuff, I’m using a bunch of Ubuntu ‘machines’ running under VMWare Server. There’s no particular reason for using Ubuntu other than that I happened to have a VM image (Ubuntu-6.06.1-desktop-i386) kicking around already, and it’s not really necessary to compile as packages are available, but I prefer it that way. Anyway, for reference, here is a quick guide to compiling Erlang from the starting point of a basic Ubuntu installation:

  1. From your home directory, get the Erlang source: wget http://www.erlang.org/download/otp_src_R11B-5.tar.gz
  2. Unpack it: tar -xzf otp_src_R11B-5.tar.gz
  3. Get a working gcc: sudo apt-get install build-essential
  4. Get the ncurses development libraries: sudo apt-get install libncurses5-dev
  5. Get m4: sudo apt-get install m4
  6. Optionally, get the ssl libraries: sudo apt-get install libssl-dev
  7. Go into the erlang source directory: cd otp_src_R11B-5
  8. Run the configuration script: ./configure
  9. Compile it all: make
  10. Install it: sudo make install

The above should all go smoothly, leaving you with a working Erlang setup. To confirm this, type erl to get an Erlang prompt.

  1. Januar Simarmata’s avatar

    It looks doesn’t work for new version of Erlang, R12B-1.

    Reply

  2. Januar Simarmata’s avatar

    Yeah… to be sure I build from R11-5 source and confirm that building is working fine.

    But, it is not the case for R12-1. The error after ‘make’ is below:

    januarvs@kubuntuku:~/otp_src_R12B-1$ make
    cd erts/emulator && ERL_TOP=/home/januarvs/otp_src_R12B-1 make generate depend
    make[1]: Entering directory `/home/januarvs/otp_src_R12B-1/erts/emulator’
    make -f i686-pc-linux-gnu/Makefile generate
    make[2]: Entering directory `/home/januarvs/otp_src_R12B-1/erts/emulator’
    gcc -g -O3 -I/home/januarvs/otp_src_R12B-1/erts/i686-pc-linux-gnu -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DHAVE_CONFIG_H -Wall -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS -Ibeam -Isys/unix -Isys/common -Ii686-pc-linux-gnu/opt/plain -Ii686-pc-linux-gnu -Izlib -Ihipe -I../include/internal -I../include/internal/i686-pc-linux-gnu -c hipe/hipe_mkliterals.c -o obj/i686-pc-linux-gnu/opt/plain/hipe_mkliterals.o
    hipe/hipe_mkliterals.c:388: error: \u2018X86_LEAF_WORDS\u2019 undeclared here (not in a function)
    hipe/hipe_mkliterals.c:389: error: \u2018X86_NR_ARG_REGS\u2019 undeclared here (not in a function)
    make[2]: *** [obj/i686-pc-linux-gnu/opt/plain/hipe_mkliterals.o] Error 1
    make[2]: Leaving directory `/home/januarvs/otp_src_R12B-1/erts/emulator’
    make[1]: *** [generate] Error 2
    make[1]: Leaving directory `/home/januarvs/otp_src_R12B-1/erts/emulator’
    make: *** [depend] Error 2
    januarvs@kubuntuku:~/otp_src_R12B-1$

    I tried to build without hipe, by submitting ‘configure –disable-hipe’ but still not lucky.

    Reply

  3. Peter’s avatar

    I encountered the same errors. I did a

    make clean
    and then a
    make
    and the errors went away.

    Peter

    Reply

  4. Krzysztof Kliś’s avatar

    For R12-3 you also need to install unixodbc-dev package before compiling Erlang if you want to have odbc support enabled.

    Reply

  5. Nina’s avatar

    Any ideas what package we need for wx to work? It’s included in R13B01.

    Thanks
    Nina

    Reply

Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">