-1

I installed erlang from erlang.org using

 wget http://erlang.org/download/otp_src_R16B03.tar.gz

I can see that erlang is successfully installed. However, I am unable to use the erlc command for eg,

 ercl file.erl 
 {"init terminating in do_boot",{undef,[{erl_compile,compile_cmdline,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}}

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

Also, I tried to create a symlink for this new install.

 which erl 
 /usr/local/bin/erl

 ls -al /usr/local/bin/erl
 lrwxr-xr-x  1 sad  admin  45 May 25 12:00 /usr/local/bin/erl -> /Users/sad/erlang/otp_src_R16B03/bin/erl

Please help if there is anything Im missing

sad
  • 820
  • 1
  • 9
  • 16
  • 1
    https://www.erlang-solutions.com/resources/download.html – Lol4t0 May 25 '16 at 21:57
  • 1
    Try to start Erlang with `erl` then type in the shell `l(erl_compile).` followed by `erl_compile:module_info().` Please post if you are getting any errors. – Greg May 26 '16 at 22:53

2 Answers2

1

You have downloaded the source package, so you need to build and install first. See https://github.com/erlang/otp/blob/maint/HOWTO/INSTALL.md for details. Better yet, download a package already built for your platform. See for instance http://erlangcentral.org/downloads/

RichardC
  • 10,412
  • 1
  • 23
  • 24
  • 1
    It looks like you are building on OSX. Did you follow any special instructions in INSTALL.md for OSX, and did you notice any particular warning messages during build and install? Also, try building a more up to date release like 18.3, to check if that builds on OSX without problems. – RichardC May 26 '16 at 10:47
0

It looks like you're running out of the R16 build tree, and you maybe put the symlink(s) in /usr/local/bin manually? You can make that work by setting up your environment appropriately, and it's probably not what you want.

Instead, after building (and possibly smoke testing) you should run make install in the build tree to install it properly to /usr/local or whatever directory you specified with the --prefix flag to ./configure or ./otp_build.

I recommend that you keep a fairly current version (current version is 18.3) in /usr/local and, if you need to use older versions like R16, keep them in a separate location.

TedB
  • 346
  • 2
  • 5