[erlang-questions] Building Erlang with the Sun Studio compiler

Kenneth Lundin kenneth.lundin@REDACTED
Thu Aug 23 11:40:45 CEST 2007

> However, I still think removing the GNU specific dependencies is a
> better long term solution. People are going to want to build from source
> with their own compilers on other platforms as well, e.g. MS VC++,
> Borland, the HP-UX compiler, etc.

It should be possible to build Erlang with other compilers than GCC but
we are not testing that actively because we have choosen GCC as our standard

There are many reasons for choosing GCC as the standard compiler:
- It's free
- Available on all relevant platforms
- We use the GCC specific feature called "first class labels" which
means that you can
assign a label to a variable say A and the use the goto A statement to
jump to the label
location. By using this feature we achieve 20% better performance then
by using an ordinary switch construct. In fact it is only one file
(beam_emu.c) that uses this feature and
 that is where the main loop of the virtual machine is implemented.

On Windows for example we build Erlang with MS VC++ except for the
file mentioned above which we build with gcc.
On all other platforms we use GCC.

As said earlier it should be possible to build Erlang with Suns
compilers , there are macros
which replaces the goto Variable constructs with a switch statement
for other compilers than GCC. The configure step should take care of
this if no GCC compiler is found on the system.

For Sun SOlaris Sparc we have earlier tried a combination of GCC for
beam_emu.c and
Sparcworks for all the rest. This showed a performance improvement
with 5-10% compared with using GCC for all files.

/Regards Kenneth (Erlang/OTP team at Ericsson)

> Regards,
> Dan
> This communication is the property of Qwest and may contain confidential or
> privileged information. Unauthorized use of this communication is strictly
> prohibited and may be unlawful.  If you have received this communication
> in error, please immediately notify the sender by reply e-mail and destroy
> all copies of the communication and any attachments.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions

More information about the erlang-questions mailing list