Installing MIDASsort for Windows

C/C++ compiler

MIDASsort for Windows uses the Microsoft C/C++ compiler to build your sort program.
If you do not already have a fully installed version of Microsoft Visual Studio C or Microsoft Visual Studio C++ then you will need to follow these instructions to download and install Microsoft's free distribution.
If you think you already have the C/C++ compiler installed a quick check is to start a Command Prompt window and enter the command cl. If you do not get a response from the C/C++ compiler then either it is not installed or not fully installed. To be fully installed various environment variables must be set - for example PATH, INCLUDE and LIB - to include references to the compiler installation.

Obtaining Microsoft Visual C++ Toolkit 2003

The following link should take you to the download page on the Microsoft Website . As a fall back you may use.
Install in the normal way.
You may also need some additional Include and Lib files taken from the Microsoft SDK. The following link contains the directories for XP+SP2. .
This is a .tar.gz file. Using WinZip and extract to c:\ which will create the directory c:\MicrosoftSDK. You will need to modify your PATH, INCLUDE and LIB environment variables as follows


echo Setting environment for using Microsoft Visual C++ 2003 Toolkit.

Set PATH=C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin;%PATH%
Set INCLUDE=C:\Program Files\Microsoft Visual C++ Toolkit 2003\include;%INCLUDE%
Set LIB=C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib;%LIB%

echo Adding files from the SDK
Set INCLUDE=C:\MicrosoftSDK\include;%INCLUDE%
Set LIB=C:\MicrosoftSDK\lib;%LIB%

Obtaining MIDASsort

A full installation requires:-

Download MIDASsort  700 Kbytes

Download MIDAS Services for Windows  2.5 Mbytes

Note that these are both .tar.gz files. Windows has been known to change the suffix to .tar.tar (!!!)

Installing MIDASsort

First (if not already done) follow these instructions to install the MIDAS base.
Expand the 2 files obtained previously (Winzip does a good job) into the directory containing the MIDAS base installation. Directories MIDASsort and Win32 will be created.

It is assumed that you will install the software using the base directory c:\midas. This is not essential and you can install in any location you choose EXCEPT that the path MUST NOT contain an embedded space. (Ie c:\Program Files\MIDAS is NOT acceptable).
The environment variable MIDASBASE should be set to the installation directory. By default MIDASBASE is set to c:\MIDAS\.
In the following instructions [MIDASBASE] is used to denote the installation directory.

Copy the shortcuts common and SortSas from the directory [MIDASBASE]\Win32\Startup to your desktop.
Copy the file [MIDASBASE]\Win32\bin\#.exe to c:\Windows\System32 (or equivalent). [Just allows used of # as a comment character in the command scripts - or add [MIDASBASE]\Win32\bin to your PATH environment variable]

Start the software services

Note - when using WindowsXP SP2 you may have to permit the following services to run as you start them. Normally this needs only to be done once. This will also be true if using any third party firewall.
At each step allow the services to start before going on to the next step.
The desktop icon is a shortcut to a cmd file which is executed. This will create a Windows Command Prompt Window and launch the service tasks in most cases with High priority.
You may iconise (miminise) the window but do not close it unless you really wish to terminate the services. On the other hand closing the window is the easiest way to terminate the service tasks.

Create the directory [MIDASBASE]\log if it does not already exist.
Edit the file c:\Windows\system32\drivers\etc\hosts (or equivalent) and add the "host" egmsg as an alias for localhost.

(1) Start the MessageLogger and ShObjManager deamons by double click on the MIDAS icon labelled common on the desktop.
The output will be as follows.

C:\MIDAS\Win32\StartUp>echo off
MIDAS Message Logger: Starting the RPC interface
MIDAS Message Logger: Created RPC Program 28000240 Version 1 on UDP port 10240.
MIDAS Message Logger: Message Logger using directory c:\midas\log
MIDAS Message Logger: Entering server loop
ShObjManager installed
startup complete
This starts the service programs MessageLogger.exe and ShObjManager.exe Unix/Linux treats Shared Memory as persistent. So if a program creates a Shared Memory object it will exist until deleted or the system is rebooted. Windows, however, will delete any Shared Memory objects created by a program when that program terminates. The MIDASsort software uses Shared Memory to hold global data and parameters used by the software and these are required to persist for the duration of the session. The ShObjManager is used to actually create any Shared Memory areas needed by the MIDASsort software components and hence these will exist while the ShObjManager is running and after the program "creating" them has terminated.

(2) Start the Sort Spectrum Server by double clicking on the MIDAS icon labelled SortSas on the desktop.
The output will be as follows.

C:\MIDAS\Win32\StartUp>echo off
Message logger contacted.
Spectrum Access Server Installed
startup complete
This starts the service program ShMemSAS.exe which will be the owner of all histograms created (in Shared memory) by the MIDASsort program. If the service task is terminated all histograms will be lost (unless you have prevously saved them to disc).

Run MIDASsort session

Copy the shortcut MIDASsort from the directory [MIDASBASE]\MIDASsort\Win to your desktop.
Double click on the MIDASsort icon to start the session. The shortcut first runs the batch file [MIDASBASE]\MIDASsort\Win\vcvars32.bat in order to establish the environment for the compiler. If you have installed the compiler to a different location to that described here you may need to change the shortcut or batch file.
Once the session has started click on the menu item SortTool to start MIDASsort.

 return to MIDASsort home page