Preparations:
-------------

1. Install the CMake build system from www.cmake.org

2. Install the MinGW and MSYS packages from www.mingw.org - this a
   collection of gnu tools built for windows. Observe that these tools
   behave like they do on linux, but they are native windows
   applications and the compilers produce native windows binaries, not
   like Cygwin which is based on a portability layer.

   Make sure to install at least the C and Fortran compilers.

3. Install lapack; download and install instructions can be found on
   http://icl.cs.utk.edu/lapack-for-windows/ The text says that you
   will need the Intel Fortran compiler, but the Fortran compiler from
   MinGW works fine. The distribution contains a cmake CMakeLists.txt
   file, and build with Cmake is easy altough time consuming.
   
   To make sure the system can find your libraries you should update
   the windows PATH variable to include the location of your
   libblas.dll and liblapack.dll files; if you fail to do this CMake
   will fail to generate a valid set of makefiles for building libutil
   and libecl.


Building libecl / libutil
-------------------------

1. Go to the root directory of the ert distribution and create a
   directory to hold the files created by the build -
   e.g. 'tmp-build'.

2. Open the cmake gui and give the path to the source (i.e. the root
   of the ert distribution) and the path to the build directory.

3. Press the [Configure] button and select the "MSys Makefiles"
   option. Cmake will inspect your system and set build configuration
   variables accordingly. Cmake will fail with a beep and large red
   warnings. Scroll down to the variables:
  
        USE_LSF
        USE_PTHREAD
        USE_ZLIB

   and uncheck them. In addition you might want to modify some other
   variables? Press the [Configure] button again, and then finally the
   [Generate] button to create makefiles.

4. Start up the MSys shell, go to the build directory,
   e.g. 'tmp-build', and type:

      make ; make install

   :-)


Using from VisualStudio
-----------------------
The ERT code itself can unfortunately not be compiled with the
VisualStudio C++ compiler, however you can link against the ert
libraries. In that case you will need the dummy header file
VisualStudio/stdbool.h



About the portabaility and features
----------------------------------- 

The libecl library is virtually unmodified for compiling on windows,
but the libutil library (in particular the util.c file) has quite many

   #ifdef HAVE_FEATUREXX

   #endif

codeblocks. The symbols HAVE_FEATUREXX are defined during the CMake
configure process. The system inspection is linux centric in the sense
that the features it is checked for are mostly present/defined on
linux. If FEATUREXX is not present it is sometimes completely ignore,
e.g. pthreads, or a windows alternative is compiled in. In the case of
windows alternative it is just assumed that the feature in question is
present on the other (i.e. Windows) platform.







