From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 16E3BBBC4 for ; Mon, 30 Mar 2009 15:45:44 +0200 (CEST) X-IronPort-AV: E=Sophos;i="4.38,446,1233529200"; d="scan'208";a="23566616" Received: from unknown (HELO mp-57040.rocqadm.inria.fr) ([128.93.57.40]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA; 30 Mar 2009 15:45:43 +0200 Message-Id: From: xclerc To: caml-list@yquem.inria.fr In-Reply-To: <49CD0AB7.8000200@inria.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: [Caml-list] PowerPC 405 Date: Mon, 30 Mar 2009 15:45:43 +0200 References: <49CD0AB7.8000200@inria.fr> X-Mailer: Apple Mail (2.930.3) X-Spam: no; 0.00; powerpc:01 powerpc:01 caml's:01 lib:01 ocaml:01 libc:01 ocaml:01 cross-:01 cross-:01 makefile:01 makefiles:01 config:01 config:01 binaries:01 compile:01 Le 27 mars 09 =E0 18:19, Xavier Leroy a =E9crit : > 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 =20 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/=20 Makefile" by hand. This is easier than it may sound, just start from "config/m-=20 templ.h", "config/s-temp.h", and "config/Makefile-templ" (these are =20 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 =20= the subject. Xavier Clerc=