[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Removal of orpie



Hi,

On Sun, Nov 6, 2011 at 18:25, Stéphane Glondu <glondu@debian.org> wrote:
>> will ocamlgsl on mips and mipsel be fixed sometime, so orpie will
>> be available on those architectures again?
>
> Actually, ocamlgsl compiles with no error when the #error directive is
> commented out. There is a "make test" target, but it uses an unknown
> "fort" command... and even so, the test-suite doesn't look very
> thorough. I have no idea what is wrong on architectures with alignment
> requirements, nor how to make it crash. ocamlgsl is ~9,000 lines of C
> code... I don't know exactly what to fix in there.
>
> I've put the upstream author in CC; maybe he can enlighten us...

Ocamlgsl doesn't "work" on architectures with double-word alignment
for float64 values (the ARCH_ALIGN_DOUBLE of the OCaml headers)
because OCaml values of type "float array" are converted by a simply
cast to (double *) in C before the call to GSL.
This works since float arrays are unboxed in OCaml. But OCaml values
are single-word aligned ... so archs with ARCH_ALIGN_DOUBLE would need
to copy the whole
array to re-align it before calling the C function and Ocamlgsl doesn't do that.

So if you disable the #error directive, ocamlgsl will segfault as soon
as you use a function with a 'float array' argument somewhere.

(fort is an old framework for unit tests in OCaml, I must still be
somewhere on SourceForge ... anyway yes, the "test suite" is pretty
light :)
-- 
  Olivier


Reply to: