= [wiki:DianaWindowsProgrammersGuide "Programmer's Guide"] = Making Diana installer for Windows includes three steps: * Configuring Linux Environment in Windows. * Compiling sources in MinGW environment for Windows. * Making installer. == Configuring Linux Environment in Windows == Install MinGW. (mingw-runtime, w32api, GCC, binutils). There is an installer executable for easy installation this components.[[BR]] Install msys. All links and guides for listed packages installation can be found at [http://www.mingw.org][[BR]] Update gcc to 4.4.0 or later [http://gcc.gnu.org/] (version 3.x.x that was in standard mingw installation but didn't work properly). == Compiling sources in MinGW environment for Windows == Download all Windows version of packages required for compiling Diana, and compile/install them. (I installed following components: xerces, swig, python, blas, lapack, cppunit, sundials, ufsparse.) I recommend to install all in C:\!WinDiana. Packages installation:[[BR]] * [http://xerces.apache.org/xerces-c/download.cgi "Xerces 2.8 (3 didn't work)"] {{{/c/WinDiana/src/xerces-c-src_2_8_0}}}[[BR]] {{{$ export XERCESCROOT=`pwd`}}}[[BR]] {{{/c/WinDiana/src/xerces-c-src_2_8_0/src/xercesc}}}[[BR]] {{{$ ./runConfigure -pmingw-msys -cgcc -xg++ -minmem -nwinsock -tnative -rpthread -P/WinDiana/xerces}}}[[BR]] {{{/c/WinDiana/src/xerces-c-src_2_8_0/src/xercesc}}}[[BR]] {{{$ make}}}[[BR]] {{{/c/WinDiana/src/xerces-c-src_2_8_0/src/xercesc}}}[[BR]] {{{$ make install}}}[[BR]] * [http://sourceforge.net/projects/swig/files/ "Swig 1.3.40"] Requires additional installation of automake, bison.[[BR]] {{{/c/WinDiana/src/swigwin-1.3.40}}}[[BR]] {{{$ ./autogen.sh}}}[[BR]] {{{/c/WinDiana/src/swigwin-1.3.40}}}[[BR]] {{{$ ./configure --prefix /c/WinDiana/}}}[[BR]] {{{/c/WinDiana/src/swigwin-1.3.40}}}[[BR]] {{{$ make}}}[[BR]] {{{/c/WinDiana/src/swigwin-1.3.40}}}[[BR]] {{{$ make install}}}[[BR]] * [http://www.python.org/ "Python 2.5.4"] At the moment version 2.6.5(release) is avaible but I used 2.5.4 because 2.6.5 don't output error messages in cases of crash.[[BR]] Installation: windows executable installer[[BR]] * [http://www.netlib.org/lapack/ "BLAS/LAPACK 3.1.1"] Make following changes in make.inc:[[BR]] {{{PLAT = }}}[[BR]] [[BR]] {{{FORTRAN = gfortran}}}[[BR]] {{{OPTS = -funroll-all-loops -O3}}}[[BR]] {{{DRVOPTS = $(OPTS)}}}[[BR]] {{{NOOPT =}}}[[BR]] {{{LOADER = gfortran}}}[[BR]] {{{LOADOPTS =}}}[[BR]] [[BR]] {{{TIMER = NONE}}}[[BR]] {{{/c/WinDiana/src/lapack-3.1.1}}}[[BR]] {{{$ make}}}[[BR]] * [http://sourceforge.net/apps/mediawiki/cppunit/index.php?title=Main_Page "CppUnit 1.12.1"] {{{/c/WinDiana/src/cppunit-1.12.1}}}[[BR]] {{{$ ./configure --disable-shared --prefix /c/WinDiana/}}}[[BR]] {{{/c/WinDiana/src/cppunit-1.12.1}}}[[BR]] {{{$ make}}}[[BR]] * [https://computation.llnl.gov/casc/sundials/download/download.html "Sundials 2.3.0"] {{{/WinDiana/src/sundials-2.3.0}}}[[BR]] {{{$ ./configure --prefix=/WinDiana/sundials}}}[[BR]] {{{/WinDiana/src/sundials-2.3.0}}}[[BR]] {{{$ make}}}[[BR]] *[http://www.cise.ufl.edu/research/sparse/umfpack/ "UMFPACK 5.4.0"] In UFconfig/UFconfig.mk change[[BR]] {{{BLAS = -L/c/WinDiana/lib -lblas_LINUX -lgfortran -lgfortranbegin -lg2c}}}[[BR]] {{{LAPACK = -llapack_LINUX}}}[[BR]] {{{UMFPACK_CONFIG =}}}[[BR]] {{{/c/WinDiana/src/UMFPACK/UMFPACK}}}[[BR]] {{{$ make}}}[[BR]] ---- Next step - download from svn Diana sources. Compile Diana sources (configuring, making the same as in Linux). In my case it was: {{{/c/WinDiana/src/diana-0.8.2}}}[[BR]] {{{$ config/bootstrap}}}[[BR]] {{{/c/WinDiana/src/diana-0.8.2}}}[[BR]] {{{$ ./configure --with-xerces=/c/WinDiana/xerces --with-swig=/c/WinDiana/ --with-python=/c/Python25/ --with-blas=/c/WinDiana --with-lapack=/c/WinDiana/ --with-cppunit=/c/WinDiana --with-ufsparse=/c/WinDiana/src/UMFPACK/ --with-sundials=/c/WinDiana/ --prefix=/c/Diana/}}}[[BR]] {{{/c/WinDiana/src/diana-0.8.2}}}[[BR]] {{{$ make}}}[[BR]] {{{/c/WinDiana/src/diana-0.8.2}}}[[BR]] {{{$ make install}}}[[BR]] == Making installer(for Inno Setup) == [http://www.jrsoftware.org/isinfo.php "Inno Setup"] is free program for making installer with open sources. I've written pascal-based script for Inno Setup that completely generates Diana installer and components(MinGW, promot, python). Script provides that should be path {{{C:\WinDiana\MakeSetup}}}, which contains following dirs and files: * promot.exe – executable Promot installer wchich automatically runs after installion. * python-2.5.4.msi – executable Python installer wchich automarically runs after installion. * scipy-0.7.1-win32-superpack-python2.5.exe, numpy-1.3.0-win32-superpack-python2.5.exe – utils for Python. * makefile-common-actions.mk, makefile-common-vars.mk, makefile-model-library.mk – are needed for work dianac, etc. * diana.bat, dianac.bat, !DianaConsole.bat, run.bat, mdl2diana.bat – Windows versions of Diana executable batch files. * include – all Diana includes and its components: xerces, swig, etc. * lib – all Diana libs and its components: xerces, swig, etc. * MinGW,msys – environment for compiling model sources (dianac). * LICENSE, packages – information files, they are shown during installation process. (GNU Public License and list of packages). This structure can be changed in field {{{[Files]}}} in script.[[BR]] All fields in script which contains program information, components list, etc. use special structure and functions of Inno-setup. Code in section {{{[Code]}}} developed on Pascal with using WinAPI to find components that had already installed in system and to add/delete required pathes to system PATH.