[erlang-questions] Determining HiPE availability
Mikael Pettersson
mikpe@REDACTED
Sat Aug 23 00:47:02 CEST 2008
Tony Arcieri writes:
> I'm compiling modules at runtime using smerl, and would like to
> automatically use HiPE if it's available. I needed a way to
> programmatically determine if HiPE is available. Someone pointed me at
> erlang:system_info(hipe_architecture) which returns 'undefined' if HiPE is
> unavailable. However, this doesn't seem to be documented anywhere. Should
> it be?
I don't think so. This is in effect a private interface between the
runtime system and the HiPE compiler. It was never meant to be used
by anyone else. In particular, I fear that documenting its current
behaviour would prevent us from changing the CPU arch names.
What does the native flag to the compiler do if HiPE isn't available?
(I admit I don't know as I always invoke the HiPE compiler directly).
Does the compiler fail or does it silently fall back to generating
BEAM code? If it fails you could wrap a call to the compiler with
an exception handler which re-tries the call w/o native. If it falls
back to BEAM then you shouldn't have to do anything.
More information about the erlang-questions
mailing list