in reply to Re^4: Math::GSL installation on Windows XP
in thread Math::GSL installation on Windows XP

Your advice helped me to install the Math::GSL 0.22, but I found that in order to use the math functions that I need for Math::GSL 0.22, I have to use gsl v 1.13, which I haven't installed yet. I tried using cgywin to build the gsl v1.13 sourcecode, but it seems to have trouble with my gcc compiler.

The config.log file says the following:

configure:3388: $? = 0 configure:3377: gcc -v >&5 Reading specs from C:/Perl/site/lib/auto/MinGW/bin/../lib/gcc/mingw32/ +3.4.5/specs Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-g +nu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw - +-enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,j +ava --disable-win32-registry --disable-shared --enable-sjlj-exception +s --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boe +hm --disable-libgcj-debug --enable-interpreter --enable-hash-synchron +ization --enable-libstdcxx-debug Thread model: win32 gcc version 3.4.5 (mingw-vista special r3) configure:3388: $? = 0 configure:3377: gcc -V >&5 gcc.exe: `-V' option must have argument configure:3388: $? = 1 configure:3377: gcc -qversion >&5 gcc.exe: unrecognized option `-qversion' gcc.exe: no input files configure:3388: $? = 1 configure:3410: checking for C compiler default output file name configure:3432: gcc conftest.c >&5 cc1.exe: ROOTDIR/gsl_nan.h: not a directory configure:3436: $? = 1 configure:3473: result: configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "gsl" | #define PACKAGE_TARNAME "gsl" | #define PACKAGE_VERSION "1.13" | #define PACKAGE_STRING "gsl 1.13" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define PACKAGE "gsl" | #define VERSION "1.13" | #define RELEASED /**/ | /* end confdefs.h. */ | #include <stdio.h> | int | main () | { | FILE *f = fopen ("conftest.out", "w"); | return ferror (f) || fclose (f) != 0; | | ; | return 0; | } configure:3479: error: in `/cygdrive/ROOTDIR/gsl-1.13': configure:3483: error: C compiler cannot create executables See `config.log' for more details.

Any suggestions?

Replies are listed 'Best First'.
Re^6: Math::GSL installation on Windows XP
by syphilis (Archbishop) on Dec 20, 2010 at 22:43 UTC
    The current version is 1.14 - best to grab it.

    With Cygwin, I think you'll need to use *their* gcc compiler, and then cross-compile for Windows (otherwise you'll end up with a gsl library that can be used only with Cygwin). I think the error you see is because you're using MinGW's gcc with Cygwin - the config.log would probably contain a diagnostic that pinpoints the specific problem.

    I use the msys shell with MinGW, but if you want to build using Cygwin, try:

    ./configure --disable-static --enable-shared --host=i686-pc-mingw32 --build=i686-pc-cygwin CXX="g++ -mno-cygwin" CC="gcc -mno-cygwin" host_alias=i686-pc-mingw32 --prefix=/cygdrive/c/wherever && make && make install

    and that should build it for native Win32.
    Because it's a cross-compilation, I don't think there's any way of running 'make check'. Also, I think there might be some redundancy in the configure options I've provided - but that incantation has worked fine for me on the occasions that I've tried it. (Haven't tried it with gsl, but.)
    See how that goes. (/msg me when you reply, otherwise I might miss it.)

    Btw, I have now built Math::GSL-0.22 ppm packages - which you can install with:

    (Update: The following command has been corrected ... was originally incorrect.)
    ppm install http://www.sisyphusion.tk/ppm/Math-GSL.ppd

    That should also install the gsl dll that's needed (via a post-install script that should launch automatically as part of the 'ppm install' process).

    Cheers,
    Rob

    Update: I'm a bit out of date with Cygwin. On my Cygwin-1.7.7, I need to install gcc-3.4.4 (via Cygwin's setup.exe) and run:

    ./configure --disable-static --enable-shared --host=i686-pc-mingw32 --build=i686-pc-cygwin CXX="g++-3 -mno-cygwin" CC="gcc-3 -mno-cygwin" host_alias=i686-pc-mingw32 --prefix=/cygdrive/c/wherever && make && make install

    This is actually being run as I write ... (update: and ran fine).
    My Cygwin-1.7.7 uses gcc-4.3.4 by default, which doesn't accommodate cross-compilation.

    With Cygwin-1.5.x (which already uses gcc-3.x.x), the original incantation should work fine.

      I checked for your ppm package, but the link is down on your website. Could you put it back up?

      Thanks, Jeff

        It's working ok for me:
        C:\_32>ppm remove Math::GSL Math-GSL: uninstalled C:\_32>ppm install Math::GSL Downloading ActiveState Package Repository packlist...done Updating ActiveState Package Repository database...done Downloading www.bribes.org packlist...not modified Downloading bribes packlist...redirect Downloading bribes packlist...done Downloading trouchelle packlist...done Updating trouchelle database...done Downloading sisyphusion packlist...not modified Downloading Math-GSL-0.22...done Unpacking Math-GSL-0.22...done Generating HTML for Math-GSL-0.22...done Updating files in site area...done Downloading Math-GSL-0.22 install script...done Running Math-GSL-0.22 install script...Set up gcc environment - 3.4.5 +(mingw spe cial) Proceed with installation? [yes] A copy of the needed library libgsl-0.dll was found in C:\_32\ap1202\bin\libgsl-0.dll. If this is compatible with the version + used to compile the Perl module, all that is needed to complete the installation is to ensure C:\_32\ap1202\bin\libgsl-0.dll is in your PATH environment variable. Fetch libgsl-0.dll? [no] Aborting download of libgsl-0.dll & libgslcblas-0.dll. done 158 files installed C:\_32>perl -MMath::GSL -e "print $Math::GSL::VERSION" 0.22 C:\_32>
        What's the error you're getting ?

        UPDATE: Aaah ... I see the mistake. In my previous post I gave you the *wrong* full link. It should have been:
        ppm install http://www.sisyphusion.tk/ppm/Math-GSL.ppd
        Cheers,
        Rob