How to compile FreeFem++ on Microsoft Windows
---------------------------------------------

WARNING NOW the window is compile under MINGW  (from version 3.11  14/01/2011 FH)

  So the old dll are incompatible with the new version. 
  -----------------------------------------------------

NEW version with MINGW 32 to have a not to bad FC compiler. 
----------------------------------------------------------

1) Download and install MINGW32 
from: 
http://sunet.dl.sourceforge.net/project/mingw/Automated%20MinGW%20Installer/mingw-get-inst/mingw-get-inst-20101030/mingw-get-inst-20101030.exe
`
2) Download un insatll wget for --enable-download in configure
http://puzzle.dl.sourceforge.net/project/mingw/mingwPORT/Current%20Releases/wget-1.9.1-mingwPORT.tar.bz2

3) the glut of win32 

http://web.cs.wpi.edu/~gogo/courses/mingw/winglut.zip

install in .h file in 

c:\mingw\bin\../lib/gcc/mingw32/4.5.0/../../../../include/GL/glut.h
c:\mingw\bin\../lib/gcc/mingw32/4.5.0/../../../../include/GL/gl.h
c:\mingw\bin\../lib/gcc/mingw32/4.5.0/../../../../include/GL/glu.h

add the glut32.dll in you directory in the 2 directories:

$ find /c/MinGW -name glut
/c/MinGW/bin/glut32.dll
/c/MinGW/lib/glut32.dll
 
3) the good blas 
http://www.tacc.utexas.edu/index.php?eID=tx_nawsecuredl&u=0&file=fileadmin/images/GotoBLAS2-1.13_bsd.tar.gz&t=1294842550&hash=638c44fa086136fc2b661b98b52e0ee4

try to compile 

4) MPI for // version 
use HPC Pack 2008 SDK with Service Pack 2 (SP2) 

5) inno setup to build instraller: 
http://www.xs4all.nl/~mlaan2/ispack/isetup-5.4.0.exe

6) GSL for gsl interface 

the configure argument are:


./configure '--enable-download' 'FC=mingw32-gfortran' 'F77=mingw32-gfortran' 'CC=mingw32-gcc' 'CXX=mingw32-g++' '-with-blas=/home/hecht/blas-x86/libgoto2.dll' 'CXXFLAGS=-I/home/hecht/blas-x86' '--enable-generic' '--with-wget=wget' 'MPIRUN=/c/Program Files/Microsoft HPC Pack 2008 R2/Bin/mpiexec.exe'

$ cat examples++-load/WHERE_LIBRARY
gsl LD -L'"/c/Program Files (x86)/GSL-1.13"'/lib -lgsl
gsl INCLUDE -I'/c/Program Files (x86)/GSL-1.13/include'


OLD Version with cygwin: (obsolete comment) 
--------------------------------------------


1) Download and install Cygwin from http://www.cygwin.com. Make sure
that the development tools Automake, Autoconf and GNU C++ , C , g77,
OPENGL, GLUT  are installed.

2) Download and extract the FreeFem++ source archive from
http://www.freefem.org

3) Open a Cygwin bash shell and follow the instructions from the
FreeFem++ INSTALL and README files.

Precompiled BLAS libraries
--------------------------

Precompiled ATLAS libraries are available at
http://www.netlib.org/atlas/archives/windows/. There are several
processor type dependant libraries to choose from. If FreeFem++ is
configured with the options "--enable-generic" and
"--enable-download", it will download the most generic version. Or you
can download a more optimized version and specify it to "./configure"
with the option "--with-blas=..." (see README).

Creating a Windows package
--------------------------

To create a Microsoft Windows self-installable package containing
FreeFem++ executables, examples and documentation, you need to install
"Inno Setup" (http://www.jrsoftware.org/isinfo.php) on your machine
first. Then run "make WindowsPackage.iss" and load the file
"WindowsPackage.iss" into Inno Setup once you have configured and
compiled FreeFem++ (see INSTALL). Inno Setup places the resulting
archive in subdirectory "Output".

TROUBLE:
--------

Infortunatly, all the .exe version without cygwin under  mingw
do not run under cygwin shell,  they run under under the 
command window NT  shell if the mingwm10.dll is in the right place:
.exe directory or in 'C:\WINDOW\system32. 

In version 2.0
BUG in LAPACK with -O optim flag
the file ARPACK/LAPACK/dlamch.f 
symptome: the code loop.
correct the Makefile.m4 to

inforce the compilation flag

REMARK:
All the exe and .dll are in 
src/bin-win32 

To build the install program you must get inno Setup 5 sofware
http://www.jrsoftware.org/isinfo.php
and the the cygwin package tex, pdflatex, ImageMagick , ghostscript 


make win32
make documentation

to build the setup file, use  inno setup on file WindowsPackage.iss
the setup file is in output directory

The configure  flag use to build the version
-------------------------------------------

for the P4 version, we  compile on pentium-m vaio VGN-S2XP
with cygwin install  http://www.cygwin.com/
with the following package
  gcc,g++,  tetex, wget , f77 , imagemagick 

./configure '--enable-optim' '--enable-download' '--with-suffix=P4'

for the generic i383 we use 
./configure '--enable-download' '--enable-generic' '--enable-optim' '--with-blas=/home/UNIVERSITE/blas/generic-no-cygwin-blas.dll' 'CPPFLAGS=-I/home/UNIVERSITE/blas/'
