Building Ifeffit with MinGW32

Until now, the Windows version of Ifeffit have been built with Microsoft Visual Studio and Fortran compilers from Intel (previous Compaq and before that Digital Visual Fortran). This has been a fairly large amount of work compared to building on linux or even Mac OS X. The main goal of this exercise is just to create a DLL that can be used by Athena, Artemis, etc, and be able to make a halfway decent xy plot using GrWin.

The MinGW tools can now be used to build Ifeffit, at least for me(Matt). A DLL built with these tools is here ifeffit_12.dll

To build the Ifeffit DLL with MinGW:

  1. Install MinGW. There is a binary installer that is easy to use. I also installed MSYS.
  2. pull the svn repository of ifeffit
    •  svn checkout http://cars.uchicago.edu/svn/ifeffit/trunk ifeffit
    • All the files needed to build the Ifeffit dll are in the src/win32 directory in this tree. The files in this directory will build the ifeffit dll for Windows using MinGW that can be easily called from C.
  3. open a regular Windows command shell. Move to the ifeffit/src/win32 directory
  4. set up to use MinGW. With MinGW installed in C:\MinGW, execute
    •  use_mingw.bat
      • This simply puts C:\MinGW at the front of your path. You may want to look at / edit the very simple use_mingw.bat file:
      @echo off
      SET PGPLOT_DEV=/GW
      SET PATH=C:\MinGW\bin;C:\MSYS\1.0\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Perl\site\bin;C:\Perl\bin;C:\epics\bin;C:\Python26;
  5. build the main libifeffit.a in the ..\lib folder with MinGW:
    •  cp sys.h ..\lib\sys.h
       cp lib_Makefile ..\lib\Makefile
       cd ..\lib
       make

      A more "normal" ./configure ; make from the top level will fail, mostly because of readline -- it will compile most of the code!

  6. Move back to this directory and run make:
    •  cd ..\win32
       make

Voila, an ifeffit_12.dll that works!! If you have python installed, try python Iff_Python.py (and note that the ctypes module means no more SWIGing!) for a test of loading and using this dll! If not, run iff_shell.exe or ifftest.exe.


Note: This is currently using PGPLOT as supplied by GrWin. There is no png or gif driver supported here. I worked on this a little bit, but have not gotten this to work yet: None of the GIF drivers compile for me with g77 on mingw, and the png driver is missing header files.

MingwBuild (last edited 2009-11-02 18:27:55 by MattNewville)