Build instructions for QSAS 2.3 on MS Windows XP/Vista (as of 03/08/2009)


1. Install the MinGW environment.

1.1. Get MinGW

In order to build QSAS and the related libraries, you need to install MinGW ("Minimalist GNU for Windows").
Go to the official sourceforge repository for MinGW (http://sourceforge.net/projects/mingw/files/)
and download the installer package (in "Automated MinGW installer", tested with MinGW-5.1.4.exe)

1.2. Install the environment

Install MinGW by double-clicking the installer. We have successfully tested the "Current" version of the package, checking:
- Base tools
- g++ compiler
- g77 compiler
Do NOT check MinGW Make

2. Install MSYS

2.1. What is MSYS?

MSYS is a "Minimal SYStem", providing a Unix-like shell and environment (e.g. standard Unix directories tree).

2.2. Get MSYS

You can get it from the Sourceforge MinGW page: http://sourceforge.net/projects/mingw/files/, in "MSYS Base System". We used MSYS-1.0.11.exe to build QSAS.
Run this executable to install MSYS. It will ask you to enter the path to MinGW.

3. Install the extra libraries

3.1. CDF

You can get the CDF libraries from ftp://cdaweb.gsfc.nasa.gov/pub/cdf/dist/latest-release/unix/cdf32_4-dist-all.tar.gz.
Copy this file to your MSYS home (C:/msys/1.0/home/*user_name* by default). Start MSYS, and type in the following command line to untar the file:
$ tar -xzf cdf32_4-dist-all.tar.gz
Go to the cdf directory and install:
$ cd cdf32_4-dist
$ make OS=mingw ENV=gnu all
The next step of the installation process requires the "ed" editor, not available on MinGW. To cope with this, just comment out the content of modify_definition_files.sh with any text editor (e.g. Microsoft Wordpad): add hashes (#) in front of each line.
Then run:
$ make INSTALLDIR=/local/cdf/   install

CDF is now installed.

3.2. Regex (libgnurx)

Get the Regex lib binary and development packages (mingw-libgnurx-...-bin.tar.gz, mingw-libgnurx-...-dev.tar.gz) from the official MinGW distribution: http://sourceforge.net/projects/mingw/files/ ("User contributed_regex" folder),
Extract the content of these archives (using gunzip and tar, or 7zip for example). Then copy the content of the extracted archives in the matching folders in your MinGW folder: e.g. "bin/libgnurx-0.dll" goes to "c:\MinGW\bin\" if you let the default installation folder for MinGW.

3.3. Qt

Get the latest version of Qt from the Qt web site.
http://www.qtsoftware.com/downloads > Choose LGPL/Free > Download Qt SDK for Windows
Execute the launcher and answer the paths and options questions (defaults are OK). Make sure MinGW is unchecked.

4. Building QSAS

4.1. Environment variables

Set up your environment variables, adapting the following command to your actual paths. In the MSYS command line, you can type:

$ export PATH=/mingw/bin:/usr/bin:/c/Qt/2009.03/qt/bin

You can make a script out of this (e.g. copy this line to a ".profile" file you put in your MSYS home folder (...)/msys/1.0/home/*user_name*), or set up this environment variable in Windows itself.

4.2. Getting QSAS and setting up the build

Get the latest QSAS binary build, and unzip it in your MSYS home directory. Go to the "bin" subdirectory and edit "build_win".
Adapt the QS_HOME, QT_* and MOC variables. Be aware that although most paths are written with Unix conventions, the QT_* variables are written with Windows conventions. If you have followed strictly this guide, you shouldn't have to edit CDF_INC, CDF_LIB and REGEX_LIB. Else, adapt them too.

4.3. Build QSAS

In the MSYS environment, go to your QSAS bin directory and run:
$ sh build_win qsas
It will rely on the various Makefile.win files to build QSAS.

4.4. Run QSAS

You can either:
- Adapt the QSAS_win script and start it from MSYS (sh QSAS_win)
- Adapt the QSAS.bat batch file and double-click it. It requires to copy the following libraries to your QSAS "bin" folder:
 From mingw/bin: libgnurx-0.dll and mingwm10.dll
 From your Qt installation folder (qt/bin subfolder):  Qt3Support4.dll, QtCore4.dll, QtGui4.dll, QtNetwork4.dll, QtSql4.dll, QtSvg4.dll, QtXml4.dll

