Building io_lib on Windows

Scott Cain
  • Scott Cain

    Scott Cain - 2006-07-26


    I would like to build io_lib for Windows and am looking for advice on how to do it.  I am a unix/perl person and have never compiled C code on Windows before.  Where does one find a (good, free) C compiler for Windows?  Can I use Cygwin to make a general purpose dll?

    The reason I want it is that the most recent release of the Generic Genome Browser incorporated a trace viewer glyph which requires io_lib, and up until now, GBrowse has been perfectly cross platform.  I would like to keep it that way by 'proving' that io_lib can be built for Windows.

    Thanks much for any help,

    • Scott Cain

      Scott Cain - 2006-07-26

      Just to follow up a little bit: I installed cygwin and tried ./configure; make and got this output:

      make  all-recursive
      make[1]: Entering directory `/home/scott/io_lib-1.9.2'
      Making all in read
      make[2]: Entering directory `/home/scott/io_lib-1.9.2/read'
      if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../include -I../read -I../alf -I../abi -I../ctf -I../ztr -I../plain -I../scf -I../sff -I../exp_file -I../utils  -I/usr/local/include  -g -O2 -MT Read.o -MD -MP -MF ".deps/Read.Tpo" -c -o Read.o Read.c; \     then mv -f ".deps/Read.Tpo" ".deps/Read.Po"; else rm -f ".deps/Read.Tpo"; exit 1; fi
      In file included from Read.h:43,
                       from Read.c:40:
      ../utils/os.h:346:2: #error Must define SP_BIG_ENDIAN or SP_LITTLE_ENDIAN in Makefile
      make[2]: *** [Read.o] Error 1
      make[2]: Leaving directory `/home/scott/io_lib-1.9.2/read'
      make[1]: *** [all-recursive] Error 1
      make[1]: Leaving directory `/home/scott/io_lib-1.9.2'
      make: *** [all] Error 2

      So I probably can give a flag to ./configure to get the endian-ness right in the Makefile.  Any suggestions?

      Thanks much,

      • James Bonfield

        James Bonfield - 2006-07-30

        Try using mingw and msys instead for your compiler and build environment. Typically they behave much better than cygwin and indeed it's what I use for the windows builds.

        Eg cygwin changes pathnames like c:/fu/bar to /cygdrive/c/fu/bar, which tends to confuse a lot of programs and users alike.


    • markjord

      markjord - 2006-07-28

      Hi Scott,
      Did you define the appropriate endianness constant in the makefile as the message says?

      Windows is little endian.

      Personally I'd just create a visual C++ project by adding all the C files for the appropriate formats you want and doing a build that way.

      You can download a free compiler from microsoft, it's called visual C++ express edition.

      I might have a go myself over the next few days and see what happens :)


    • markjord

      markjord - 2006-08-14

      I managed to build I/O lib on windows, however it wasn't the trivial exercise I had hoped for.

      The correct endianness is defined automatically when it detects that a microsoft compatible compiler is used (I think _MSCVER or similar is defined).

      There are files missing, namely unistd.h and stdint.h, however I managed to find one of them in the staden package source, the other I just invented when the compiler complained about missing types.

      Anyway, I used Visual C++ Express 2005, which is free from microsoft, created a new project and added all the c files. All the h files I put into a directory called include.

      I also needed to download the latest version of ZLIB and link in that as well.

      So with the appropriate fiddling, it's possible. Since I've done all the hard work let me know if you want some binaries.

      Best Regards,

    • tolid

      tolid - 2006-11-02

      > "Since I've done all the hard work let me know if you want some binaries"

      Yes, I'd like to ask you about binaries.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks