#-------------------------------------------------------------------------
# filename:
#    Install_TOOLKIT_MTD_XP_Studio.net.readme
#
# description:
#    Installation instruction for TOOLKIT_MTD on Windows XP using MS Vsual Stodio .net
#       
# author:
#    Abe Taaheri/ Emergent Information Technologies, Inc.
#
# history:
#    02-Oct-2006  Version 5.2.14
#    02-Feb-2014  Version 5.2.19
#-------------------------------------------------------------------------
              
The instructions which follow assume that you will be using one of 
the 'zip' files that we provide, either the source code release with 
fortran (pgstk5.2.19r1full.zip) or the source release with no 
fortran( pgstk5.2.19r1nof.zip)

In building TOOLKIT_MTD from source code you may select between 
two build environment options depending on your application and 
environment needs.  Each option has it's own zip file:

Option I, (select pgstk5.2.19r1nof.zip)
Test and Utility configuration : TOLKIT_MTD library, and utilities, no 
fortran

Option II, (select pgstk5.2.19r1full.zip)
Full configuration : TOOLKIT_MTD library and utilities, with fortran
This version has been built and tested with Fortran 90 Compiler for 80x86 in
VC Studio .net .


Preconditions:
===========================
  To build the TOOLKIT_MTD library, it is assumed that you have done 
  the following:
      
      1. Installed MicroSoft Visual Studio .net 2003 or newer in a directory
	    such as:
	 		F:\Program Files\Microsoft Visual Studio .
         Visual Fortran is needed if you are going to build the
         full TOOLKIT_MTD Library with Fortran support.

      2. Installed jpeg, szip and zlib ( for the old versions such as 
         pgstk5.2.19, HDF4.1.10 and hdf5-1.8.12 and before, no need to do 
         this). Binaries are availble from The HDF Group in 4210-win & 5-1812-win
	   packages.
 

      3. Installed NCSA HDF version4  and HDF5 
         (Binaries are availble from The HDF Group in 4210-win & 5-1812-win
	    packages)

      4. Set up a directory structure to unpack the library. For 
      example: 
           c:\					(any drive)
           PGSTKHOME\     			(any folder name)

      5. Coied the source distribution archive to that directory 
      and unpacked it using the appropriate archiver options to create a 
      directory hierarchy.
         

INSTRUCTIONS FOR LIBRARY AND UTILITY INSTALLATION, NO FORTRAN :
==================================================================
       1. You will use pgstk5.2.19r1nof.zip 
            
            Run WinZip on 
               c:\PGSTKHOME\pgstk5.2.19r1nof.zip
    
            This should create directories called 'dev' and 'TOOLKIT_MTD'.

            'dev' directory contains a Developer Studio workspace 
            TOOLKIT_MTD.dsw and TOOLKIT_MTD.sln. 
           
 
       2. Invoke Microsoft Visual C++ .net by double clicking on TOOLKIT_MTD.dsw or 
            	TOOLKIT_MTD.sln. You may also run Microsoft Visual C++ and then
            	open  <PGSTKHOME>\dev\TOOLKIT_MTD.dsw workspace or TOOLKIT_MTD.sln. 

       3. Under Tools-> Options-> Project", select "VC++ Directories".
            Under "Show directories for", select "Include files".
            Add the following directories:

            F:\Program Files\Microsoft Visual Studio\VC7\include
		F:\Program Files\Microsoft Visual Studio\Vc7\include\sys
		F:\Program Files\Microsoft Visual Studio\Vc7\atlmfc\include
		F:\Program Files\Microsoft Visual Studio\SDK\v1.1\include
            <top-level HDF4 directory>\include
            <top-level HDF5 directory>\include
		<top-level jpeg>\include  or <top-level jpeg> where the *.h files are.
		<top-level zlib>\include
		<top-level szip>\include
		<top-level hdfeos5>\include
		<top-level hdfeos >\include
            <top-level PGSTK directory>\TOOLKIT_MTD\include 
            <top-level PGSTK directory>\TOOLKIT_MTD\include\CUC 
            <top-level PGSTK directory>\dev                     

        4.  Under Tools-> Options-> Project", select "VC++ Directories".
            Under "Show directories for", select  "Library files".
            Add the following directories:

		F:\Program Files\Microsoft Visual Studio\Vc7\PlatformSDK\Lib
            F:\Program Files\Microsoft Visual Studio\VC7\lib
		F:\Program Files\Microsoft Visual Studio\Vc7\include\sys
		F:\Program Files\Microsoft Visual Studio\Vc7\atlmfc\lib
		F:\Program Files\Microsoft Visual Studio\SDK\v1.1\lib
            <top-level HDF4 directory>\release\lib
            <top-level HDF4 directory>\release\dll
            <top-level HDF5 directory>\release\lib
            <top-level HDF5 directory>\release\dll
		<top-level jpeg>\lib  or <top-level jpeg> if *.lib files are there.
		<top-level zlib>\lib
		<top-level szip>\lib
		<top-level szip>\dll
		<top-level hdfeos5>\lib
		<top-level hdfeos >\lib
            <top-level PGSTK directory>\TOOLKIT_MTD\lib
            <top-level PGSTK directory>\dev   
            <top-level PGSTK directory>\dev\PGSTK\Release

            where 
	    <top-level PGSTK directory> may be
	    F:\TOOLKIT_MTD5.2.19\with_Fortran\pgstk5.2.19r1full
	    <top-level HDF4 directory> may be F:\4210-win\4210-win
	    <top-level HDF5 directory> may be F:\5-1812-win\5-1812-win
	    <top-level szip> may be F:\zlib128-windows
	    <top-level hdfeos5> may be F:\hdfeos5_1_15b\hdfeos5
	    <top-level hdfeos > may be F:\hdfeos2_19b\hdfeos
	    <top-level szip> may be F:\szip21-win-xp-enc
	    <top-level jpeg> may be F:\jpeg-6b


	5. Select "Build", then Select "Configuration Manager".
		   Select "Debug" or "Release" for Active Solution Configuration.

      6. Select the "PGSTK" project by clicking on it on the TOOLKIT_MTD Solution tree.
		Then select Project -> Properties. In the popped up window:

		a. in "Librarian -> General -> Output File" enter ".\Release\PGSTK.lib" if 
		   you are creating Release toolkit library or ".\debug\PGSTK.lib" if you
		   are creating debug toolkit library.
		b. Click "apply" the click "OK"

		c. Select on "CBP" project by clicking on it on the TOOLKIT_MTD Solution tree.
		   Then select Project -> Properties. In the poped up window Select 
		   "C/C++" --> "Preprocessor" and add "INTEL86,VISUAL_CPLUSPLUS" to 
	 	   "Preprocessor definitions" if they do not show up in the list.
		d. Repeat step C for other projects CSC, ephtobin, EXTRA, IO, MEM, MET, 
		   PGS_TD_NewLeap and TD.

		f. For projects "PGS_TD_NewLeap" and "ephtobin" you need to do:
		   Select "Project" --> Properties. In the popped up window Select 
		   "Linker -> Input". Add following to the "Additional Dependencies":
		   pgstk.lib hd421.lib hm421.lib hdf5.lib libjpeg.lib 
		   zdll.lib szlib.lib. Then press "apply" then "OK". 
		g. Select File -> Save All

	7. Select "PGSTK" project by clicking on it on the TOOLKIT_MTD Solution tree.
	   build the Release version of the TOOLKIT_MTD library by selecting:
		a. Build -> Build PGSTK
		b. Build -> Project only -> Link
	
        8. build the Release version of the TOOLKIT_MTD utility PGS_TD_NewLeap and ephtobin.
		a. Select PGS_TD_NewLeap on the tree. then select Build -> Build PGS_TD_NewLeap
		b. Select ephtobin on the tree. then select Build -> Build ephtobin

	9. Repeat above steps for the debug version of libraries and utilities, if you desire, after 
	   changining configuration after selecting Build -> Configuration Manager
	   and "Active Solution Configuration" to "Debug". Note that now for input libraries you
	   should select debug ones that usually end with "d" befor ".lib", such as pgstkd.lib.

      10. Run the installation batch file win32ins.bat in directory 
           <top-level PGSTK directory>\dev\.
           Commands in this file will copy pgstk.lib, pgstkd.lib and 
           utilities to <top-level PGSTK directory>\TOOLKIT_MTD\bin\nt_98 and 
           <top-level PGSTK directory>\TOOLKIT_MTD\lib\nt_98, and remove the temporary files.
       
              The <top-level PGSTK directory>\TOOLKIT_MTD\bin\nt_98 directory will contain  
              utilities: 
                 PGS_TD_NewLeap.exe
                 ephtobin.exe
     
              The <top-level PGSTK directory>\TOOLKIT_MTD\lib\nt_98 directory will contain 
              PGSTK libraries:
                 pgstk.lib   (TOOLKIT_MTD Library of release version)
                 pgstkd.lib  (TOOLKIT_MTD library of debug version)

           where 
	   	<top-level PGSTK directory> may be C:\PGSTKHOME 
	    


INSTRUCTIONS FOR FULL TOOLKIT_MTD INSTALLATION WITH FORTRAN:
==============================================================
       1. You will use pgstk5.2.19r1full.zip 
           
            Run WinZip on 
               c:\PGSTKHOME\pgstk5.2.19r1full.zip

            This should create directories called 'dev' and  'TOOLKIT_MTD'.
        
            'dev' directory contains a Developer Studio workspace 
            TOOLKIT_MTD.dsw 
       
       2. Follow instructions for steps 2 to 10 above after adding Fortran compiler
	  related include and Lib directories below to corresponding set in steps 3 and 4.

                F:\Program Files\Microsoft Visual Studio\<Fortran Include Directory>
                F:\Program Files\Microsoft Visual Studio\<Fortran Lib Directory>

Compile Notes
=========================
      If you are building an application that uses the TOOLKIT_MTD library 
      pgstk.lib (release version ) or pgstkd.lib(debug version), the following
      locations will need to be specified for locating header files and 
      linking in the HDF4, HDF5, JPEG, SZIP, ZLIB and TOOLKIT_MTD libraries:
 

		F:\Program Files\Microsoft Visual Studio\Vc7\PlatformSDK\Lib
            F:\Program Files\Microsoft Visual Studio\VC7\lib
		F:\Program Files\Microsoft Visual Studio\Vc7\include\sys
		F:\Program Files\Microsoft Visual Studio\Vc7\atlmfc\lib
		F:\Program Files\Microsoft Visual Studio\SDK\v1.1\lib
            <top-level HDF4 directory>\release\lib
            <top-level HDF4 directory>\release\dll
            <top-level HDF5 directory>\release\lib
            <top-level HDF5 directory>\release\dll
		<top-level jpeg>\lib  or <top-level jpeg> if *.lib files are there.
		<top-level zlib>\lib
		<top-level szip>\lib
		<top-level szip>\dll
		<top-level hdfeos5>\lib
		<top-level hdfeos >\lib
            <top-level PGSTK directory>\TOOLKIT_MTD\lib\nt_98

	       
            F:\Program Files\Microsoft Visual Studio\VC7\include
		F:\Program Files\Microsoft Visual Studio\Vc7\include\sys
		F:\Program Files\Microsoft Visual Studio\Vc7\atlmfc\include
		F:\Program Files\Microsoft Visual Studio\SDK\v1.1\include
            <top-level HDF4 directory>\include
            <top-level HDF5 directory>\include
		<top-level jpeg>\include  or <top-level jpeg> if *.h files are there.
		<top-level zlib>\include
		<top-level szip>\include
		<top-level hdfeos5>\include
		<top-level hdfeos >\include
            <top-level PGSTK directory>\TOOLKIT_MTD\include 
            <top-level PGSTK directory>\TOOLKIT_MTD\include\CUC 
            <top-level PGSTK directory>\dev

            where 
	    <top-level PGSTK directory> may be
	    F:\TOOLKIT_MTD5.2.19\with_Fortran\pgstk5.2.19r1full
	    <top-level HDF4 directory> may be F:\4210-win\4210-win
	    <top-level HDF5 directory> may be F:\5-1812-win\5-1812-win
	    <top-level szip> may be F:\zlib128-windows
	    <top-level hdfeos5> may be F:\hdfeos5_1_15b\hdfeos5
	    <top-level hdfeos > may be F:\hdfeos2_19b\hdfeos
	    <top-level szip> may be F:\szip21-win-xp-enc
	    <top-level jpeg> may be F:\jpeg-6b


            Please refer to the 
            <top-level PGSTK directory>\dev\compile_XP_readme.txt or 
            <top-level PGSTK directory>\dev\Test_Driver_XP.txt 
            file for more information on compiling an application with the 
            TOOLKIT_MTD libraries on Windows XP.


     In order to use PGSTK.lib or PGSTKd.lib, it is needed to set up 
     environment variable "PGSHOME" :

           in "Control Panel" double clich on "System". In the "System Properties" window
		select "Advanced". Click "Environment Variables" and enter the new variable
	 	name as PGSHOME and value as <top-level PGSTK directory> may be F:\PGSTKHOME
   
	You may have done this also by Opening autoexec.bat file (if it exist)
		and adding 1 line at the end of file

	       Set PGSHOME=<top-level PGSTK directory>\TOOLKIT_MTD

	       where <top-level PGSTK directory> may be something like 
		 F:\PGSTKHOME if you have F:\PGSTKHOME as the parent directory
		 for TOOLKIT_MTD directory; For excample:
			F:\TOOLKIT_MTD5.2.19\with_Fortran\pgstk5.2.19r1full

MORE HELPFUL POINTERS
=====================

       Here are some notes that may be of help if you are not familiar
       with using the Visual C++ Development Environment.

       Project name and location issues: 
          The files in pgstk5.2.19r1full.zip ( or pgstk5.2.19r1nof.zip) must 
          end up in the dev\ and TOOLKIT_MTD\ directories installed by 
          pgstk5.2.19full.zip ( or pgstk5.2.19nof.zip).

          If you must install TOOLKIT_MTD.dsw in another directory, relative 
          to dev\ , you will be asked to locate the project files, when you
          open the project TOOLKIT_MTD.dsw.