1

Continuing from here, I am trying to build 64-bit GSL using GCC in Cygwin.

  1. The call to ./configure (CC=x86_64-w64-mingw32-gcc CFLAGS=-m64 ./configure) goes through fine, but the call to make install results, after a whole load of folders are successfully processed, in

    ./.libs/libgslsiman.a: could not read symbols: Archive has no index; run ranlib to add one

    collect2: ld returned 1 exit status

    Makefile:326: recipe for target `siman_tsp.exe' failed

    The full call that caused this was

    Making all in siman make2: Entering directory `/cygdrive/f/programming/c/libraries/gslCompiled/gsl-1.15/siman'

    /bin/sh ../libtool --tag=CC --mode=link x86_64-w64-mingw32-gcc -m64 -o siman_tsp.exe siman_tsp.o libgslsiman.la ../rng/libgslrng.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../sys/libgslsys.la ../utils/libutils.la -lm

    libtool: link: x86_64-w64-mingw32-gcc -m64 -o .libs/siman_tsp.exe siman_tsp.o ./.libs/libgslsiman.a ../rng/.libs/libgslrng.a ../ieee-utils/.libs/libgslieeeutils.a ../err/.libs/libgslerr.a ../sys/.libs/libgslsys.a ../utils/.libs/libutils.a

  2. Following advice here, I decided to run a ranlib in the ./siman/.libs directory on the libgslsiman.a file. Since that didn't work, I also tried to pack it myself using a call to ar -t libgslsiman.a.

However, this results in an identical error.

Community
  • 1
  • 1
tchakravarty
  • 10,736
  • 12
  • 72
  • 116

1 Answers1

1

You manually forced use of the cross compiler. However, the rest of the build toolchain will still default to the 32-bit Cygwin versions instead of the 64-bit MinGW ones.

Instead of setting CC=..., pass --host x86_64-w64-mingw32 to ./configure to specify the host environment (ie where the library is going to be used).

Christoph
  • 164,997
  • 36
  • 182
  • 240
  • Ok, great. So it is happily compiling in the background. It does ask me to reconsider the choice between `--host` and `--build`. Can you comment on the distinction? – tchakravarty Jun 07 '13 at 10:52
  • 1
    Oh, why not. I am going to ask another noob question. Once I have done a `make install` I guess that the lib folder is `.libs`, but where is the `include` folder? Should I just make a folder called include which contains all the header files I can find in the GSL folder? – tchakravarty Jun 07 '13 at 11:02
  • Ok, remade it with a `--prefix`. Thanks for your help. :) – tchakravarty Jun 07 '13 at 12:21
  • @fgnu: setting `--build` to `i686-pc-cygwin` should make the warning go away; see also http://stackoverflow.com/questions/5139403/whats-the-difference-of-configure-option-build-host-and-target for the difference between `host` and `build` – Christoph Jun 07 '13 at 12:47