caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* PowerPC 405
@ 2009-03-27 15:04 Gregory Bellier
  2009-03-27 15:10 ` [Caml-list] " Basile STARYNKEVITCH
  2009-03-27 17:19 ` Xavier Leroy
  0 siblings, 2 replies; 8+ messages in thread
From: Gregory Bellier @ 2009-03-27 15:04 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

Hi everybody.

Do you know if it is possible to compile caml code on a PowerPC 405 from the
Vertex 4 family ?
We'd like to put this processor in a FPGA.
On the Caml's website, it is written "PowerPC" but is it only for Macintosch
?

Thank you for your time.
Gregory BELLIER.

[-- Attachment #2: Type: text/html, Size: 321 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] PowerPC 405
  2009-03-27 15:04 PowerPC 405 Gregory Bellier
@ 2009-03-27 15:10 ` Basile STARYNKEVITCH
  2009-03-27 15:56   ` Gregory Bellier
  2009-03-27 17:19 ` Xavier Leroy
  1 sibling, 1 reply; 8+ messages in thread
From: Basile STARYNKEVITCH @ 2009-03-27 15:10 UTC (permalink / raw)
  To: Gregory Bellier; +Cc: caml-list

Gregory Bellier wrote:
> Hi everybody.
>
> Do you know if it is possible to compile caml code on a PowerPC 405 
> from the Vertex 4 family ?
> We'd like to put this processor in a FPGA.
> On the Caml's website, it is written "PowerPC" but is it only for 
> Macintosch ?

That is probably not so hard if your processor runs some Linux kernel, 
or if you want to run only ocaml bytecode (not native).

The point is in what kind of runtime environment will your Ocaml run?

Also, what is your development toolchain? Are executables in ELF format? ...

What is your knowledge of Ocaml internals (notably the stdlib, the 
runtime C API)?

Do you have a usual C lib?

Regards.

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] PowerPC 405
  2009-03-27 15:10 ` [Caml-list] " Basile STARYNKEVITCH
@ 2009-03-27 15:56   ` Gregory Bellier
  2009-03-27 16:05     ` Basile STARYNKEVITCH
  0 siblings, 1 reply; 8+ messages in thread
From: Gregory Bellier @ 2009-03-27 15:56 UTC (permalink / raw)
  To: Basile STARYNKEVITCH; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 1447 bytes --]

Hello Basile, thank you for your reply.

Yes, it will run Linux. It will have the uclibC or even the lib C.
The best case is to run native code for better performance. We'd like to
cross-compile for the PowerPC.

I'm not a FPGA expert, I'm asking questions for a colleague who works on it.

>From what you're saying, it should work properly because of the non-exotic
environment thanks to Linux. Am I correct ?

Regards.


2009/3/27 Basile STARYNKEVITCH <basile@starynkevitch.net>

> Gregory Bellier wrote:
>
>> Hi everybody.
>>
>> Do you know if it is possible to compile caml code on a PowerPC 405 from
>> the Vertex 4 family ?
>> We'd like to put this processor in a FPGA.
>> On the Caml's website, it is written "PowerPC" but is it only for
>> Macintosch ?
>>
>
> That is probably not so hard if your processor runs some Linux kernel, or
> if you want to run only ocaml bytecode (not native).
>
> The point is in what kind of runtime environment will your Ocaml run?
>
> Also, what is your development toolchain? Are executables in ELF format?
> ...
>
> What is your knowledge of Ocaml internals (notably the stdlib, the runtime
> C API)?
>
> Do you have a usual C lib?
>
> Regards.
>
> --
> Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
> email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
> 8, rue de la Faiencerie, 92340 Bourg La Reine, France
> *** opinions {are only mines, sont seulement les miennes} ***
>
>

[-- Attachment #2: Type: text/html, Size: 2116 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] PowerPC 405
  2009-03-27 15:56   ` Gregory Bellier
@ 2009-03-27 16:05     ` Basile STARYNKEVITCH
  0 siblings, 0 replies; 8+ messages in thread
From: Basile STARYNKEVITCH @ 2009-03-27 16:05 UTC (permalink / raw)
  To: Gregory Bellier; +Cc: Caml Mailing List

Gregory Bellier wrote:
> Hello Basile, thank you for your reply.
>
> Yes, it will run Linux. It will have the uclibC or even the lib C.
> The best case is to run native code for better performance. We'd like 
> to cross-compile for the PowerPC.
>
> I'm not a FPGA expert, I'm asking questions for a colleague who works 
> on it.
>
> From what you're saying, it should work properly because of the 
> non-exotic environment thanks to Linux. Am I correct ?


Probably yes. A few years ago, I had a Powerbook G4 with a 32 bits 
PowerPC running Linux, and Ocaml did compile and run fine, even in 
native mode. Of course, I understand that your ocaml code runs inside an 
application in linux user mode (not inside the kernel!).

I would expect you might have minor issues in configuration or 
whatsover. I suppose you have enough RAM (and I have no idea what that 
means exactly on your system).

Please publish the patches you'll need to implement your solution.

But I never tried all that, so take all my saying with a big grain of salt.

BTW, I'm curious: what kind of embedded application do you want to code 
in Ocaml for what sort of device or system?


Regards

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] PowerPC 405
  2009-03-27 15:04 PowerPC 405 Gregory Bellier
  2009-03-27 15:10 ` [Caml-list] " Basile STARYNKEVITCH
@ 2009-03-27 17:19 ` Xavier Leroy
  2009-03-30  7:30   ` Gregory Bellier
  2009-03-30 13:45   ` xclerc
  1 sibling, 2 replies; 8+ messages in thread
From: Xavier Leroy @ 2009-03-27 17:19 UTC (permalink / raw)
  To: Gregory Bellier; +Cc: caml-list

Just to complement Basile's excellent answers:

> Do you know if it is possible to compile caml code on a PowerPC 405
> from the Vertex 4 family ?
> We'd like to put this processor in a FPGA.  On the Caml's website,
> it is written "PowerPC" but is it only for Macintosch ?

Not just Macintosh: PowerPC/Linux is also supported and works very
well.

> Yes, it will run Linux. It will have the uclibC or even the lib C.

Then you're in good shape.  I would expect a basic OCaml system to
work with uclibC, although a number of external libraries might not.
With GNU libC, everything will work but watch out for code size:
glibc is big!

> The best case is to run native code for better performance. We'd
> like to cross-compile for the PowerPC.

Setting up OCaml as a cross-compiler is a bit of a challenge at the
moment.  As a prerequisite, you'll need a complete cross-compilation
environment for C: cross-compiler, cross-binutils, libraries and
header files for your target.  It sounds obvious but in my experience
that's quite hard to get right.  Then, there is a bit of configuration
magic to be done on the OCaml side.  Write back for help if you're
going to follow this way.

A perhaps simpler alternative would be to compile on a bigger
PowerPC/Linux platform.  An old Mac would be handy for this, but you
can also use a Sony Playstation 3 (if you happen to have one around
for, ahem, R&D purposes) after installing YellowDog Linux on it.

- Xavier "doing lots of R&D with my PS3" Leroy


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] PowerPC 405
  2009-03-27 17:19 ` Xavier Leroy
@ 2009-03-30  7:30   ` Gregory Bellier
  2009-03-30 13:45   ` xclerc
  1 sibling, 0 replies; 8+ messages in thread
From: Gregory Bellier @ 2009-03-30  7:30 UTC (permalink / raw)
  To: Xavier Leroy; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 1879 bytes --]

Thank you Basile and Xavier, you were very helpful. That's nice of you.
Basile, I'm sorry but I'm not sure I can talk freely about what we're about
to do. Sorry, company policy :(

Anyway, thanks again and I'll write back when I'll have other questions.

Gregory BELLIER.


2009/3/27 Xavier Leroy <Xavier.Leroy@inria.fr>

> Just to complement Basile's excellent answers:
>
> > Do you know if it is possible to compile caml code on a PowerPC 405
> > from the Vertex 4 family ?
> > We'd like to put this processor in a FPGA.  On the Caml's website,
> > it is written "PowerPC" but is it only for Macintosch ?
>
> Not just Macintosh: PowerPC/Linux is also supported and works very
> well.
>
> > Yes, it will run Linux. It will have the uclibC or even the lib C.
>
> Then you're in good shape.  I would expect a basic OCaml system to
> work with uclibC, although a number of external libraries might not.
> With GNU libC, everything will work but watch out for code size:
> glibc is big!
>
> > The best case is to run native code for better performance. We'd
> > like to cross-compile for the PowerPC.
>
> Setting up OCaml as a cross-compiler is a bit of a challenge at the
> moment.  As a prerequisite, you'll need a complete cross-compilation
> environment for C: cross-compiler, cross-binutils, libraries and
> header files for your target.  It sounds obvious but in my experience
> that's quite hard to get right.  Then, there is a bit of configuration
> magic to be done on the OCaml side.  Write back for help if you're
> going to follow this way.
>
> A perhaps simpler alternative would be to compile on a bigger
> PowerPC/Linux platform.  An old Mac would be handy for this, but you
> can also use a Sony Playstation 3 (if you happen to have one around
> for, ahem, R&D purposes) after installing YellowDog Linux on it.
>
> - Xavier "doing lots of R&D with my PS3" Leroy
>
>

[-- Attachment #2: Type: text/html, Size: 2443 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] PowerPC 405
  2009-03-27 17:19 ` Xavier Leroy
  2009-03-30  7:30   ` Gregory Bellier
@ 2009-03-30 13:45   ` xclerc
  2009-04-01 14:12     ` xclerc
  1 sibling, 1 reply; 8+ messages in thread
From: xclerc @ 2009-03-30 13:45 UTC (permalink / raw)
  To: caml-list


Le 27 mars 09 à 18:19, Xavier Leroy a écrit :

> Just to complement Basile's excellent answers:
>
>> Do you know if it is possible to compile caml code on a PowerPC 405
>> from the Vertex 4 family ?
>> We'd like to put this processor in a FPGA.  On the Caml's website,
>> it is written "PowerPC" but is it only for Macintosch ?
>
> Not just Macintosh: PowerPC/Linux is also supported and works very
> well.
>
>> Yes, it will run Linux. It will have the uclibC or even the lib C.
>
> Then you're in good shape.  I would expect a basic OCaml system to
> work with uclibC, although a number of external libraries might not.
> With GNU libC, everything will work but watch out for code size:
> glibc is big!
>
>> The best case is to run native code for better performance. We'd
>> like to cross-compile for the PowerPC.
>
> Setting up OCaml as a cross-compiler is a bit of a challenge at the
> moment.  As a prerequisite, you'll need a complete cross-compilation
> environment for C: cross-compiler, cross-binutils, libraries and
> header files for your target.  It sounds obvious but in my experience
> that's quite hard to get right.  Then, there is a bit of configuration
> magic to be done on the OCaml side.  Write back for help if you're
> going to follow this way.

I have built a MacOS-to-Linux cross-compiler last week.
I do confirm that the hard part is getting a cross-[g]cc up and running.
In fact, this is so tedious that I strongly encourage to resort to  
either
a prepackaged cross-[g]cc (from binaries, from a Linux packaging
system, whatever), or to the excellent "crosstool" available at :
	http://www.kegel.com/crosstool/

On the OCaml side, there are very few things to do and they are
quite straightforward. First, you have to emulate the behaviour of
"./configure" by producing "config/m.h", "config/s.h", and "config/ 
Makefile"
by hand. This is easier than it may sound, just start from "config/m- 
templ.h",
"config/s-temp.h", and "config/Makefile-templ" (these are  
comprehensively
commented).
Then, you will have to slightly patch some Makefiles, and you are done.

I will setup a webpage with all the necessary steps and patches as soon
as I get my notes organized. This will allow us to share knowledge on  
the subject.

Xavier Clerc

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] PowerPC 405
  2009-03-30 13:45   ` xclerc
@ 2009-04-01 14:12     ` xclerc
  0 siblings, 0 replies; 8+ messages in thread
From: xclerc @ 2009-04-01 14:12 UTC (permalink / raw)
  To: caml-list


Le 30 mars 09 à 15:45, xclerc a écrit :

(...)

> I have built a MacOS-to-Linux cross-compiler last week.
> I do confirm that the hard part is getting a cross-[g]cc up and  
> running.
> In fact, this is so tedious that I strongly encourage to resort to  
> either
> a prepackaged cross-[g]cc (from binaries, from a Linux packaging
> system, whatever), or to the excellent "crosstool" available at :
> 	http://www.kegel.com/crosstool/
>
> On the OCaml side, there are very few things to do and they are
> quite straightforward. First, you have to emulate the behaviour of
> "./configure" by producing "config/m.h", "config/s.h", and "config/ 
> Makefile"
> by hand. This is easier than it may sound, just start from "config/m- 
> templ.h",
> "config/s-temp.h", and "config/Makefile-templ" (these are  
> comprehensively
> commented).
> Then, you will have to slightly patch some Makefiles, and you are  
> done.
>
> I will setup a webpage with all the necessary steps and patches as  
> soon
> as I get my notes organized. This will allow us to share knowledge  
> on the subject.

The build process I followed along with its accompagnying patch are
available on the Gallium wiki at the following URL:
	http://brion.inria.fr/gallium/index.php/CrossCompiler

This is clearly a very experimental draft that is still a bit hackish.
All reports, both positive and negative are hence very welcome,
in order to polish it up.


Hope this helps,

Xavier Clerc

	


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-04-01 14:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-27 15:04 PowerPC 405 Gregory Bellier
2009-03-27 15:10 ` [Caml-list] " Basile STARYNKEVITCH
2009-03-27 15:56   ` Gregory Bellier
2009-03-27 16:05     ` Basile STARYNKEVITCH
2009-03-27 17:19 ` Xavier Leroy
2009-03-30  7:30   ` Gregory Bellier
2009-03-30 13:45   ` xclerc
2009-04-01 14:12     ` xclerc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).