----- Original Message ----- From: "Andres Jordan" <[EMAIL PROTECTED]>
To: <[email protected]> Sent: Thursday, June 21, 2007 10:48 PM Subject: Re: [Perldl] Weighted Chi2-fit .
. .
Alternatively for those who would like to try this without recompiling PDL at this point, I have put a standalone tarball at:http://www.eso.org/~ajordan/PDL-Minuit-1.0.tgz
Runs fine for me on Win32 when building with the MinGW port of gcc and g77 - at least it builds without error, and all tests pass. (Thanks for taking the time to provide the standalone tarball.)
However, when I try to build with VC7.0 and the MinGW port of g77, there are a couple of errors that can be fixed by applying the attached patches.
With FCN.c, MS compilers still insist that all declarations are made *before* any function calls. (Was FCN.c auto-generated ? This problem seems to arise fairly often ... if it *was* auto-generated then perhaps the generator is in need of amendment.)
With the Makefile.PL, all I've done is replace a '.a' with a '$Config::Config{lib_ext}' and also replace " rv " with " -out:" iff $Config::Config{cc} eq 'cl'.
Feel free to rewrite my implementation of those changes.Unfortunately, VC7.0 also takes exception to some things in the generated Minuit.xs - which may well be a bug in PDL::PP and have nothing to do with the PDL-Minuit-1.0 source.
Here's the complaints: -------------------------------Minuit.xs(578) : error C2229: struct 'pdl_mnseti_struct' has an illegal zero-sized array
Minuit.xs(589) : error C2466: cannot allocate an array of constant size 0
Minuit.xs(589) : error C2133: '__creating' : unknown size
Minuit.xs(594) : error C2059: syntax error : '}'
Minuit.xs(595) : error C2059: syntax error : '}'
Minuit.xs(873) : error C2059: syntax error : '}'
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
-------------------------------
And here's the relevant lines from the generated XS file:
-------------------------------
577 typedef struct pdl_mnseti_struct {
578 PDL_TRANS_START(0);
579 pdl_thread __pdlthread;
580 char *str;
581 char __ddone; /* Dims done */
582 } pdl_mnseti_struct;
583
584 void pdl_mnseti_redodims(pdl_trans *__tr ) {
585 int __dim;
586 pdl_mnseti_struct *__privtrans = (pdl_mnseti_struct *) __tr;
587
588 {
589 int __creating[0];
590 {
591 /* no RedoDimsCode */
592 }
593 {
594 static char *__parnames[] = {};
595 static int __realdims[] = {};
596 static char __funcname[] = "PDL::Minuit::mnseti";
597 static pdl_errorinfo __einfo = {
872 static char pdl_mnseti_vtable_flags[] =
873 { };
874 pdl_transvtable pdl_mnseti_vtable = {
-------------------------------
I'm particularly impressed with lines 590-592 inclusive.
At some stage (not right now) I might want to get to the bottom of this.
Modifying the XS file so that it works ok probably won't be that difficult,
but the prospect of having to amend PDL::PP so that it writes the XS file
correctly is a little daunting.
I don't know of anyone else who builds PDL with a Microsoft Compiler and the MinGW port of g77 - and I certainly don't *need* to build it that way, so the whole problem can probably be ignored - for the time being, at least. But if you can implement the supplied patches now, then that reduces the amount of patching that's needed later on when (if) the other issues are addressed :-)
I find it quite amazing that the generated Minuit.xs consists of 8207 lines of code .... gee-whiz, imagine if you had to write that file by hand ...... thank God for PDL::PP !!!
Cheers, Rob
FCN_c.diff
Description: Binary data
Makefile_PL.diff
Description: Binary data
_______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
