I’m new to elixir/erlang and try to find the best erlang compile options to compile erlang with asdf and kerl on an ubuntu based distribution.
Are there any recommendations of erlang compile configs i should add to kerl to have erlang compiled with the newest features or best fit for me (a newbie)?
Have a nice day,
Persnally for new developers I would rather recommend installing a precompiled erlang releases, see asdf-erlang-prebuilt-ubuntu repositories.
You can find the dependencies required to build erlang from source here.
I use asdf on all my ubuntu machines and it always compiles without any problems, all you have to do is install the dependencies.
So you are not setting any
KERL_CONFIGURE_OPTIONS at all to tune for your system?
You don’t have to, not sure what kerl accomplishes but I can say for sure that erlang configure can automatically detect the libraries that you are missing and avoid installing them, for example if you are missing java it will not compile
Jinterface library, same with all the others. As for distribution-specific things, as long as you install the latest versions, OTP doesn’t care about the distribution you are running on.
Usually if you need those libraries, you just install the dependencies and recompile the OTP.
Regardless of the installation way it’s also worth to enable the shell history.
I would set
KERL_BUILD_DOCS=yes so that you get EEP-48 style docs for all Erlang/OTP modules. Your IDE can use this to show docs and
h in iex will as well.
If you want to optimize the runtime a bit, you can add
-march=native to the CFLAGS (
CFLAGS="-O2 -g -march=native"). Keep in mind that this will make the Erlang install less portable, but if you are only using it on that specific machine (i.e. it is not a docker image or something like that) then there is no downside.