Hipe question

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Hipe question

Mickael Remond-2

Hello,

I now managed to compile Hipe on Linux (Debian "Sid") thanks to the
brand new prerelease.

I also manage to compile a module using the hipe:c/1 function.

But, from what I understand, I need to use this function (=> hipe
recompilation) for each new Erlang session, as no new file is created
and the beam file does not seem to be modified.

I did not see any way to make the Hipe compilation permanent.
I try to use the hipe:compile function to get the code back from the
function, but I did not figure out what to do with it (Writing it as a
beam or as an executable file does not work).

I am probably missing something.
Any clue ?

--
Micka?l R?mond
http://www.erlang-fr.org/


Reply | Threaded
Open this post in threaded view
|

Hipe question

Richard Carlsson-4

The module 'hipe' should be used directly only by diehard
experimentalists. For normal use, just write "c(my_module, [native])" in
the shell. This will create a .beam file, which also contains the native
code as a chunk. Whenever such a file is loaded (in a HiPE-enabled
system), the native code will be used if possible (i.e., if it was
created on the same kind of system - sparc/solaris or x86/linux) rather
than the Beam code (which is also included in the file). Of course, if
you use the shell "c(...)" function, the module will be autoloaded.

"Just like that!"

        /Richard

On Wed, 26 Sep 2001, Mickael Remond wrote:

> I now managed to compile Hipe on Linux (Debian "Sid") thanks to the
> brand new prerelease.
>
> I also manage to compile a module using the hipe:c/1 function.
>
> But, from what I understand, I need to use this function (=> hipe
> recompilation) for each new Erlang session, as no new file is created
> and the beam file does not seem to be modified.
>
> I did not see any way to make the Hipe compilation permanent.
> I try to use the hipe:compile function to get the code back from the
> function, but I did not figure out what to do with it (Writing it as a
> beam or as an executable file does not work).
>
> I am probably missing something.
> Any clue ?
>
> --
> Micka?l R?mond
> http://www.erlang-fr.org/
>

Richard Carlsson (richardc)   (This space intentionally left blank.)
E-mail: Richard.Carlsson WWW: http://www.csd.uu.se/~richardc/



Reply | Threaded
Open this post in threaded view
|

Hipe question

Mickael Remond-2
Richard Carlsson (richardc) wrote:

>
> The module 'hipe' should be used directly only by diehard
> experimentalists. For normal use, just write "c(my_module, [native])" in
> the shell. This will create a .beam file, which also contains the native
> code as a chunk. Whenever such a file is loaded (in a HiPE-enabled
> system), the native code will be used if possible (i.e., if it was
> created on the same kind of system - sparc/solaris or x86/linux) rather
> than the Beam code (which is also included in the file). Of course, if
> you use the shell "c(...)" function, the module will be autoloaded.
>
> "Just like that!"

Thank you. That is what I was missing. I am on x86 so I will wait for
the integration of the native code integration into the beam.

This is very clever. I like that.

--
Micka?l R?mond
http://www.erlang-fr.org/



Reply | Threaded
Open this post in threaded view
|

Hipe question

Happi
In reply to this post by Mickael Remond-2
The hipe:c interface is for interactive mode and for debuging and testing.
There is another way to compile to native code:
The ordinary compiler supports a flag: native to produce native-code.
In the Erlang shell you can do:
 c(mod, [native]).
or
 c(mod, [native, {hipe,[o3,verbose]).
>From the unix shell you can do:
 erlc +native mod.erl

In both cases a .beam file containing native code will be produced.
Whenever this module is loaded the native code will be loaded instead of
beam code ( as long as the machine you are running on still has the same
architecture as the one you compiled on.)

Now, there is one slight problem ;)
This is only implemented for the SPARC in the current OTP snapshot.

However there is a new HiPE/OTP snapshot at
http://www.csd.uu.se/projects/hipe/snapshots/
which also supports this on the x86.


----- Original Message -----
From: "Mickael Remond" <mickael.remond>


>
> Hello,
>
> I now managed to compile Hipe on Linux (Debian "Sid") thanks to the
> brand new prerelease.
>
> I also manage to compile a module using the hipe:c/1 function.
>
> But, from what I understand, I need to use this function (=> hipe
> recompilation) for each new Erlang session, as no new file is created
> and the beam file does not seem to be modified.
>
> I did not see any way to make the Hipe compilation permanent.
> I try to use the hipe:compile function to get the code back from the
> function, but I did not figure out what to do with it (Writing it as a
> beam or as an executable file does not work).
>
> I am probably missing something.
> Any clue ?
>
> --
> Micka?l R?mond
> http://www.erlang-fr.org/
>