Subject: | Math-GSL-0.07 won't build on Win32 |
I have Win32 (Vista), perl-5.10.0, using MinGW (port of gcc) compiler
and gsl-1.11.
We come to a stage very early on in the Build process where the
following command gets run:
gcc -o blib\arch\BLAS.so BLAS_wrap.o -shared -I./lib -I../lib -
LC:/_32/msys/local/lib -lgsl -lgslcblas -lm -gsl
First thing to note is that the output file we're attempting to build
there is 'BLAS.so', but for Win32 that file should be named 'BLAS.dll'.
For portability, we need to be building "BLAS.$Config{dlext}".
But that's not what stops the command from succeeding. On Windows
(unlike linux) all symbols need to be resolved at build time - and
there's nothing in that command that's going to resolve the perl
symbols. Consequently I get a string of "undefined reference" errors
beginning with:
BLAS_wrap.o:BLAS_wrap.c:(.text+0xb42): undefined reference to
`Perl_get_context'
BLAS_wrap.o:BLAS_wrap.c:(.text+0xb53): undefined reference to
`Perl_mg_get'
BLAS_wrap.o:BLAS_wrap.c:(.text+0xb58): undefined reference to
`Perl_get_context'
BLAS_wrap.o:BLAS_wrap.c:(.text+0xb67): undefined reference to
`Perl_sv_isobject'
.
.
And the build process terminates. I don't know whether this is a bug in
the Math::GSL Build.PL file, or a bug in Module::Build itself. (I'm not
very familiar with Module::Build.)
Do you happen to have a Makefile.PL that will enable the build to work
using ExtUtils::MakeMaker ? I'm not very strong on MakeMaker either,
but it was a fairly simple task to write a Makefile.PL that enabled
the 'make' process to compile all of the C source files without any
troubles. (I gather from the various "multiple definition" warnings I
ultimately got that one is not supposed to build each and every one of
those C files.) Of course, there's more to building the module than
simply being able to compile the C files. I've had some experience with
creating Makefile.PL's where an XS source file is involved, but no
experience in writing Makefile.PL's that have to deal with multiple C
source files.
Cheers,
Rob