flair logo

Topics

Previous topic

Input parameters in inp

This Page

HOWTO: Running flair under Windows

To run flair under MS Windows, one needs a Fortran compiler and a command-line environment. Since the standard development environment is on unix-like systems, this HOWTO will describe the process of setting up a similar approach that uses one of the free fortran compiler, gfortran (part of gcc) and/or g95. The following process was tested on an Windows XP system. Using a Windows compiler (such as Intel’s ifort) directly should work also, but I have no experience.

Cygwin set-up

Cygwin (http://cygwin.com) provides an unix- like environment for Windows, and is the approach I have tried. MinGW is an alternative that should work and has the advantage is that it generates native Windows programs.

Set-up cygwin as usual using the installer, following the instructions on the web site. In addition to the default packages, some other ones will be needed. (Do NOT install the Cygwin fortran compilers; these are out of date.) The extra packages needed can be found under the categories:

Devel: binutils make mingw-runtime patchutils

Editors: (pick something that you like) vim

Math: gmp lapack mpfr

Net: openssh (suggested for secure communication; can also use putty)

Shell: rxvt (terminal window - see below)

(Some of these will show up in several categories.)

When setting up cygwin, it is much better to use the rxvt terminal then the standard command terminal. To make it easy to use, use the Windows Explorer to go to c:cygwinbin , right click on Send to... and put a shortcut on the Desktop. Then, right click on that, go to Properties and modify the target to (all on one line):

C:\cygwin\bin\rxvt.exe -sl 1500 -fn "Lucida console-11" -bg white -fg black -sr -e bash --login -i

This gives a reasonable command line terminal to use.

Installing Fortran compilers

The two free (GPL) Fortran compilers are:

g95: http://g95.org g95-x86-cygwin.tgz (or similar name)

gfortran: ` http://gcc.gnu.org/wiki/GFortranBinaries <http://gcc.gnu.org/wiki/GFortranBinaries>`__ and choose the Cygwin build

Download the cygwin binaries for these compilers to a directory in your cygwin tree such as your home directory. Then untar them under /. (The file names maybe slightly different.):

tar -zxvf g95-x86-cygwin.tgz -C /
tar -jxvf gfortran-4.4-Cygwin-i686.tar.bz2 -C /

The compilers will be installed in /usr/local. g95 will put a link directly into /usr/local/bin; for gfortran, do:

ln -s /usr/local/gfortran/bin/gfortran.exe /usr/local/bin/gfortran
ln -s /usr/local/gfortran/bin/gfortran.exe /usr/local/bin/gfc

You should now have working fortran compilers in the cygwin environment. You can update the compilers by simply removing the directories under /usr/local and reinstalling.

Compiling and running

Only the serial versions have been tested and no attempt has been made to get MPI working on Windows. To compile, untar the program tarball in some directory:

tar -zxvf flair-0.X.XX.tar.gz

and switch to the src directory. Copy either Make.conf_g95_cygwin or Make.conf_gfortran_cygwin (both of them are in the tar file) to Make.conf (gfortran will generally generate faster executables):

cp Make.conf_gfortran_cygwin Make.conf
make %% makes the complex version

or:

make real %% makes the version for systems with inversion

When compiling files that need the preprocessor (*.F), gfortran may give the warning:

f951: warning: command line option “-idirafter” is valid for C/C++/ObjC/ObjC++ but not for fortran

This warning comes from the way the gfortran compiler is set up under cygwin and can be ignored without ill side-effects (or so it seems).

Although I have not extensively run flair under Windows, this procedure does seem to work reasonably well. Note that the lapack/blas libraries are the ones that come with cygwin; it is possible that compiling your own (or obtaining tuned ones) would be better, but again I have not tried. Comments/additions are welcome.

Good luck!