Win7: 
-Be sure to use an account name that does not have spaces in it, as this could be an 
issue with Cygwin. 


Installing Matlab: 

-Make sure that when you install Matlab, you choose C:\MATLAB\R2011b as directory 
for the installation. Failing to do so could preclude the sdk compiler from 
finding the Matlab header files.  Define environment variable:
MATLAB_DIR="C:/MATLAB/R2011b" after you 'source $ISSM_TIER/etc/environment.sh'
as described in the ISSM installation instructions below.

-Also pay attention to what version of Matlab you are using, 32 or 64 bits, 
as this will need to be reflected onto the sdk compiler settings. 



Cygwin: 

-You will need cygwin installed on your Windows platform to manage the compilation.  Cygwin emulates
unix behaviour on windows machines.  The compilation will still be carried out by the windows sdk compiler, but the
environment driving the compilation will be the unix-like cygwin. When you download
cygwin, make sure that you install it in the C:\Cygwin directory. 

-You will find the cygwin setup executable on the www.cygwin.com webpage. Here is a link
to it: http://cygwin.com/setup.exe. Download this file to C:\Cygwin and be sure to reuse 
it when you want to update your current cygwin installation. Do not download setup.exe 
twice! 

- You will need the following packages downloaded to carry out the compilation of ISSM
 successfully, so be sure to include them in your cygwin install: 

subversion
autotools
automake
vim (or any other editor)
patchutils
make: The GNU version of the 'make' utility
automake 1.11 and automake:Wrapper scripts
autoconf
python: Python language interpreter
unzip
cygrunsrv



Compiler: 

You need Visual Studio Express 2010 for C++, which you can find here: 
http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express

you will also need the Windows SDK 7.1 compiler, which you can find at the following link
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=8279
This compiler is compatible with Matlab, as detailed in the following webpage: 
http://www.mathworks.com/support/compilers/R2011b/win64.html#n2

Be careful not to download the sdk before Visual Studio Express, as this could lead to 
environment setup issues. 


Before you do anything related to ISSM! You have to capture the settings of your compiler.
This is by far the most tricky part. 

Follow Sdk1.png and Sdk2.png for more details. You have to launch sdk 7.1 command prompt, go to the 
cygwin directory and fire up Cygwin by executing Cygwin.bat. Once this is done,dump the 
results of the export command onto a file, called  sdk7.1.win7.64.sh 
you will need this file later in the ISSM install. 



Downloading issm: 

Download issm into the C:\ directory. Do not download it in your Documents or Desktop
folder. 

In cygwin: 
cd /cygdrive/c/
svn co http://issm.ess.uci.edu/svn/issm/issm

Once you download it, in your home directory, edit .bashrc: 
and add the following lines:
export ISSM_DIR=/cygdrive/c/issm
export ISSM_TIER=$ISSM_DIR/trunk-jpl
export ISSM_ARCH=cygwin-intel

#source
source $ISSM_TIER/etc/environment.sh


Getting the cl.exe compiler to work: 
before trying to compile the externalpackages, you need to be sure that your compiler cl.exe 
(the sdk compiler)works. To make sure, create a simple hello world file: 

hello.cpp

#include <stdio.h>
int main(){
printf("%s\n","hello");
return 1;
}

and try to compile it by doing: 
cl hello.cpp

If this does not work, do not go any further! The settings of your cl compiler are found
in externalpackages/windows/configs/. If there is a significant different between your
sdk7.1.win7.64.sh file (see above section Compiler) and the file that is being sourced in the windows/configs directory, place your new file in
the configs directory. Relaunch bash, and try to run cl hello.cpp once more. Beware, you will likely
have to erase some lines in your file, as cygwin might not like some of the stuff that your
Windows platform is trying to define. To make sure that the correct bit compiler is
being sourced in windows/configs (e.g. sdk7.1.win7-64.sh or sdk7.1.win7-32.sh) see
section "One note about 32 vs 64 bit compile" below.

Once the cl.exe compiler works, you can start installing the following packages: 
petsc   metis triangle and cccl

For petsc, use install-3.1-win7.sh 
For metis, use install-4.0-win7.sh
For cccl, use install-win7.sh
For triangle, use install-win7.sh

Once this is complete run the install.sh scripts in the autoconf and automake
externalpackages directory

Once these externalpackages have been compiled, you can compile issm: 

./scripts/autoremakererun.sh
./configs/config-win7-64.sh
make install

This should compile both parallel and serial versions of ISSM. Beware though, the parallel
version cannot be run on multi-core platforms yet! We are actively working on it. 



One note about 32 vs 64 bit compile: 
Depending on your Matlab version, you will need to do a 32 or 64 bit compile. The only
difference between both compiles is the setup of the cl.exe compiler. For ease of use,
you will find in externalpackages/windows/windows_environment.sh a switch to go from 32
to 64 bit compile. When you type cl.exe \help at the command prompt, cl.exe should report
what system it is compiling for. Beware, switching 32 to 64 or vice-versa implies recompiling everything from scratch.



How to setup a Cron job? 
First, make sure you downloaded cygrunsrv, otherwise the cron setup will only work on a per-session 
basis! Also, make sure that you have an email correctly setup.  In particular, cron relies on the
/usr/sbin/sendmail script. If it does not exist, cron will not send emails. Most email management 
systems will create this script, but you need to check on it. 
Run cron-config  and fill up the questions. For daemon name, type ntsec. 
Be careful, make sure that you are running your terminal as Administrator, 
otherwise your settings will be only user-based. 
How to setup email? 

Preferred way is through ssmtp. Download it on cygwin, and type ssmtp-config.  If the ssmtp 
daemon does not create /usr/sbin/sendmail, be sure to create a symlink from the email client 
to the latter file. Be careful, make sure that you are running your terminal as Administrator, 
otherwise your settings will be only user-based. 
