<html>Hi Alvaro,<br /><br />>Hi all,<br />><br />>would it not be better practice to handle this on load, i.e: using this: http://man7.org/linux/man-pages/man3/endian.3.html<br />><br />>Just a remark.<br />><br />>-Alvaro<br /><br />I have tried that approach, it is OK for fileHeader, but there is data in *fvi, *fvd files that is float and can be double.<br />For that we need a byte-swap for float and double.<br />I had some results with this, but I did not find every one place in source where byte-swap is needed.<br />I was not sure that is enough to just byte-swap data on read, blockWriteOrRead could be also used for writing.<br />During the read process data is read with file.read like char* and then cast to other values.<br /><br />Regard,<br />Jurica<br /><br />-------- Original Message --------<br />Subject: Re: [GenABEL-dev] probabel big endian support<br />Date: Sunday, April 27, 2014 05:29 CEST<br />From: "Frank, Alvaro Jesus" <alvaro.frank@rwth-aachen.de><br />To: "L.C. Karssen" <lennart@karssen.org>,"genabel-devel@lists.r-forge.r-project.org"<genabel-devel@lists.r-forge.r-project.org><br />References: <896-53591700-f-3be4eec0@227853676>, <535C1462.9090502@karssen.org><br /><br /><br /> <blockquote type="cite" cite="244CF001646FF74FB34F372310A332C57AFBF2@MBX2.rwth-ad.de">Hi all,<br /><br />would it not be better practice to handle this on load, i.e: using this: http://man7.org/linux/man-pages/man3/endian.3.html<br /><br />Just a remark.<br /><br />-Alvaro<br />________________________________________<br />From: genabel-devel-bounces@lists.r-forge.r-project.org [genabel-devel-bounces@lists.r-forge.r-project.org] on behalf of L.C. Karssen [lennart@karssen.org]<br />Sent: Saturday, April 26, 2014 10:17 PM<br />To: genabel-devel@lists.r-forge.r-project.org<br />Subject: Re: [GenABEL-dev] probabel big endian support<br /><br />Dear Jurica,<br /><br />On 24-04-14 15:52, Jurica Stanojkovic wrote:<br />> Dear list,<br />><br />> I have tried building package probabel on mips big endian.<br /><br />That is great to hear! As far as I know, none of the current developers<br />have access to such a machine.<br /><br />> It looks like that inputfiles/*.fvd and inputfiles/*.fvi are created on<br />> little endian machine and are not working on big endian ones.<br /><br />That is correct, we found out<br /><br />><br />> I have tried to create them on big endian mips, and replace ones that<br />> came with source package with the ones that I have created.<br />> The package was built with new files without an error.<br /><br />That is good news. So GenABEL and DatABEL work on big-endian machines.<br /><br />><br />> I used following command to create files:<br />> library(GenABEL)<br />> library(DatABEL)<br />> fvdose <- mach2databel(imputedg="./checks/inputfiles/test.mldose",<br />> mlinfo="./checks/inputfiles/test.mlinfo",<br />> outfile="./checks/inputfiles/test.dose")<br />> fvprob <- mach2databel(imputedg="./checks/inputfiles/test.mlprob",<br />> mlinfo="./checks/inputfiles/test.mlinfo",<br />> outfile="./checks/inputfiles/test.prob", isprob=TRUE)<br />> mmdose <-<br />> mach2databel(imputedg="./checks/inputfiles/mmscore_gen.mldose",<br />> mlinfo="./checks/inputfiles/mmscore_gen.mlinfo",<br />> outfile="./checks/inputfiles/mmscore_gen.dose")<br />> mmprob <-<br />> mach2databel(imputedg="./checks/inputfiles/mmscore_gen.mlprob",<br />> mlinfo="./checks/inputfiles/mmscore_gen.mlinfo",<br />> outfile="./checks/inputfiles/mmscore_gen.prob", isprob=TRUE)<br />><br />> I am new to ProbABEL, GenABEL, DatABEL so could someone please help me<br />> with following questions:<br />><br />> What is the best course of action for supporting probabel on big endian?<br />> Should *.fvi, *.fvd files allways be in little endian format (than<br />> DatABEL needs to be changed to always create little endian files)?<br />> Or can *.fvd, *.fvi files be replaced with big endian files for big<br />> endian build?<br /><br />I would say that ideally the files need only to be created once and then<br />usable on all systems. Especially since these files are usually large<br />and converting from text format to .fvi/.fvd takes quite a while.<br /><br />This, however, would require diving into the filevector and the DatABEL<br />code (filevector or libfilevector is the name of the 'backend' code in<br />which the .fvd/.fvi files are 'defined'; both DatABEL and ProbABEL use<br />that code when dealing with .fvi/.fvd files). I don't have very much<br />experience with either code base, but could probably have a look and<br />give you some pointers.<br /><br />><br />> Is it necessary to be able to use *.fvd *.fvi files created on a<br />> different endian system?<br /><br />On the other hand, how often will people transfer these files to<br />machines of different architectures?<br /><br />Jurica, can you tell us a bit more about why you are using a MIPS<br />machine for your work with ProbABEL? And do you think it would be a<br />common task to move these files between machines with different<br />architectures at your site?<br /><br />Maybe a converter from big to little and vice versa would be the easiest<br />solution? I guess such a conversion can be done rather quick. The<br />downside would be that it (at least temporarily) requires double the<br />disk space.<br />Such a converter could be part of the fvutils and/or of DatABEL, for<br />example.<br /><br />><br />> I am willing to work on adding big endian support and I will appreciate<br />> any help in determining the right course of action in resolving this<br />> problem.<br /><br />Thank you for your time and willingness to help! It is very much<br />appreciated. We're a small group of developers, but we'll try to help as<br />much as we can.<br /><br /><br />Best,<br /><br />Lennart.<br /><br />><br />> Regards,<br />> Jurica<br />><br />><br />> _______________________________________________<br />> genabel-devel mailing list<br />> genabel-devel@lists.r-forge.r-project.org<br />> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel<br />><br /><br />--<br />*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*<br />L.C. Karssen<br />Utrecht<br />The Netherlands<br /><br />lennart@karssen.org<br />http://blog.karssen.org<br />GPG key ID: A88F554A<br />-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-<br /><br />_______________________________________________<br />genabel-devel mailing list<br />genabel-devel@lists.r-forge.r-project.org<br />https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel</blockquote><br /> </html>