Installing QuickFIX

Dependencies

Below is a list of tools that QuickFIX is dependent on for various uses. The uses are split into Run, Build, and Test catagories. These respectively refer to what is necessary to run a compiled QuickFIX application, what is required to compile QuickFIX from the source, and the tools needed to use the automated testing framework.

The Run category details what might be the setup of a deployment machine. The Build category might be the setup of a development machine that uses the QuickFIX library. All three should be installed for a developer intent on modifying the QuickFIX library code itself. The testing framework, however, should be useful in any configuration.

Windows Run MSXML3 or libxml2 Build Microsoft Visual C++
MSXML3 or libxml2
Test Ruby
RubyUnit
Linux Run glibc
libxml2
Build gcc
gcc-c++
glibc-devel
libxml2-devel
gnu make
sstream
Test Ruby
RubyUnit
Solaris Run glibc
libxml2
Build gcc or SunPRO
gcc-c++
glibc-devel
libxml2-devel
gnu make
sstream
Test Ruby
RubyUnit
FreeBSD Run libxml2
Build libxml2
Test Ruby
RubyUnit
Mac OS X Run Max OS X 10.3 (Panther)
Build Xcode Tools
Test

Optional Dependencies

In addition to the required dependencies listed above, there are some dependencies if you would like to take advantage of additional features. QuickFIX supports the following: MySQL MSSQL PostgreSQL STLport

Building QuickFIX

Being a C++ engine, QuickFIX's functionality is mostly in inlined source code and partially in a library. To develop a FIX application, you should be comfortable building QuickFIX and modifying the build scripts. The example applications are a good place to start for writing an application.

Windows (C++)

QuickFIX comes with a .dsw and a few .dsp files for building under DevStudio. Simply open the quickfix.dsw file and do a batch build of all the projects. This will create lib\quickfix.lib and lib\debug\quickfix.lib which can be linked into your applications. The header files will also be copied to the include directory. If you have Visual Studio .NET, you should instead use quickfix.sln.

Since windows does not have a standard system for storing header and library files, you should organize them however best suits your build environment. Leaving them in the lib and include directories they are placed into by the build is one option.

Compile time options are controlled from the config_windows.h file in the src directory. The following options are supported:

#define HAVE_STLPORT 1 Compile with stlport instead of standard visual c++ STL implementation.
#define HAVE_MYSQL 1 Compiles MySQL support into QuickFIX. If you enable this option, the mysql include and library directories must be in the Visual Studio search paths.
#define HAVE_MSSQL 1 Compiles MSSQL support into QuickFIX. If you enable this option, the mssql include and library directories must be in the Visual Studio search paths.
#define HAVE_POSTGRESQL 1 Compiles PostgreSQL support into QuickFIX. If you enable this option, the postgres include and library directories must be in the Visual Studio search paths.
#define HAVE_LIBXML 1 Compile and link XML parsing code against the libxml library instead of the default MSXML3.
#define ENABLE_CALLSTACK 1 Tells QuickFIX to keep track of a C++ callstack that will be printed out in the event of a the process crashing. Only use this when trying to track down a repeatable problem.

Windows (.NET)

QuickFIX comes with a .NET wrapper written in managed C++. This enables any CLR based language (i.e., C#, VB.NET) to access QuickFIX.

The instruction for building under .NET are the same as the instructions for windows listed above, however you must use the quickfix.sln file and build under Visual Studio .NET. In addition to the quickfix lib files, DLLs named quickfix_net.dll and quickfix_net_messages.dll will be placed into your lib and lib\debug directories.

Windows (Java)

To build the JNI layer, make sure you have completed the build/installation of the C++ quickfix library. Now open the quickfix_jni.dsw workspace in MSDev Studio. (or quickfix_jni.sln if building under Visual Studio .NET). Before building, make sure to add the JNI include directories to your include search path. Do this by opening up the Tools->Options menu and selecting the Directories tab (Project->VC++ Directories under Visual Studio .NET). Make sure the Show directories for: combo box has Include files selected. Based on your JAVA_HOME environment settings, add the jdk's include and include\win32 directories to your search path. These will probably be something like C:\jdk1.3.1\include and C:\jdk1.3.1\include\win32. Now do a batch build of all project configurations. DLLs named quickfix_jni.dll and quickfix_debug_jni.dll will be placed into your lib and lib\debug directories.

Once you have built the JNI dll, you must now build the QuickFIX java API. Simply run the build.bat file in the src\java directory. A jar file name quickfix.jar will be placed into your lib directory.

Linux / Solaris / FreeBSD / Mac OS X (C++/Java)

QuickFIX uses GNU autotools (autoconf, automake, and libtool) in conjunction with make to build on unix systems. If you also want to reuse our makefiles for developing your own application, you will find it useful. Also note that if your version of gcc does not come with sstream, you will need to download it from the link above and put it in the correct include directory. Also please note for Solaris you must use GNU make, the make that comes with Solaris will not work.

Building under *nix requires two steps. First, in the root quickfix directory, type ./configure This will probe your system to find out what functionality it supports for use in determining how to build QuickFIX. After ./configure completes succesfully, simply type make to build. If you run into problems running configure, you may need to run the ./bootstrap script first.

There are some options you can pass to ./configure to enable compile time features. These are:

--with-java - Build the Java API. JAVA_HOME will be used to find Java.
--with-python=<include directory> - Build the Python API. Use directory which contains python headers.
--with-ruby - Build the Ruby API. Uses ruby interpreter in your path.
--with-mysql=<base directory> - Compile in mysql support
--with-postgresql=<base directory> - Compile in postgresql support
--with-stlport=<base directory> - Compile with stlport instead of standard gcc STL implementation (recommended for multiprocessor machines running gcc 2.95.x)
--enable-callstack - Display C++ call stack after abnormal termination. Only use this when trying to track down a repeatable problem.

If you are using the SUNPro compiler, you will need to set the following environment variables:

CC=<full path to SUNPro CC binary>
CFLAGS=-g -xs
CXX=<full path to SUNPro CC binary>
CXXFLAGS=-g -xs
LD=<full path to SUNPro CC binary>
LDFLAGS=-g -xs -lCstd
AR=<full path to SUNPro CC binary>
AR_FLAGS=-g -xs -xar -o

After succesfully building QuickFIX, you should run make install as root. This will place the library libquickfix.so and libquickfix_jni.so if java is detected, and the quickfix header files into the appropriate directories. If you do not have root access, you can also run configure with the --prefix=<base directory> option, where the base directory is some directory which your account has write access. note: under Mac OS X, the files are called libquickfix.dylib and libquickfix_jni.jnilib, you may need to create a symlink to libquickfix_jni.so.


Generating QuickFIX Databases

Generating MySQL Database

First, make sure you have compiled QuickFIX with MySQL support. If you have not done this, go back to the build instructions for your system and follow the instructions. Also, make sure you have installed MySQL and have the deamon running.

Everything needed to generate your MySQL database is in the src/sql/mysql directory. Here, there are the script and batch files create.sh and create.bat. These scripts will work on a newly installed mysql database with default permisions. The scripts will try to generate the database using the root MySQL account with no password. If you need to use a different account or need a password, you will have to edit the script. To select a different user, simply change 'root' to another user. To add a password, use pass the -p option after the username.

Generating MSSQL Database

First, make sure you have compiled QuickFIX with MSSQL support. If you have not done this, go back to the build instructions for your system and follow the instructions. Also, make sure you have installed MSSQL and have the deamon running.

Everything needed to generate your MSSQL database is in the src/sql/mssql directory. Here, there is the batch file create.bat. This script will work on a newly installed mssql database with default permisions. The scripts will try to generate the database using the sa account with no password. If you need to use a different account or need a password, you will have to edit the script. To select a different user, simply change 'sa' to another user. To add a password, use pass the -P option after the username.

Generating PostgreSQL Database

First, make sure you have compiled QuickFIX with PostgreSQL support. If you have not done this, go back to the build instructions for your system and follow the instructions. Also, make sure you have installed PostgreSQL and have the deamon running.

Everything needed to generate your PostgreSQL database is in the src/sql/postgresql directory. Here, there are the script and batch files create.sh and create.bat. These scripts will work on a newly installed postgresql database with default permisions. The scripts will try to generate the database using the postgres account with no password. If you need to use a different account or need a password, you will have to edit the script. To select a different user, simply change 'postgres' to another user. To add a password, use pass the -W option and you will be prompted for a password.


Testing QuickFIX

The development of QuickFIX has been driven by a suite of functional acceptance tests and unit tests. We have been working incrementally, functional test by functional test, writing the unit tests before the code. If these tests pass, we're pretty confident that the engine works as intended.

The developer unit tests are written in C++ and make direct calls into the code. The functional acceptance tests are scripted FIX messages that are pumped into a running FIX server. Most of these tests are based off of the FIX Session-level Test Cases and Expected Behaviors document

Two executable files are built that allow you to run tests. They are ut(.exe) and at_server(.exe). Running the ut executable will run all the defined unit tests against the quickfix library. The at_server executable is an implementation of a FIX server application that simply echoes NewOrderSingle messages back to the client. It also ensures a ClOrdID is not reused. It has just enough functionality to test the application-level behavior of our implementation.

The output of the unit test runner is represented by a period if the test passes or a letter 'F' if it fails. Failed tests will also display information regarding the failure. This will usually be a test name, file name, and line number.

The output of the acceptance test runner will be an XML output that has a result field with a sucess or failure. A failed test will also display information on why the test has failed. Usually this will be a comparison of the expected result and the actual result of a line. To run acceptance tests, ruby must be installed and in your path.

Windows

Unit Tests

Enter the test directory under quickfix. All tests need to be run from this directory. To run unit tests, either type runut debug [port] or runut release [port], depending on if you want to test the debug or release version. The port is used to test socket functionality.

Acceptance Tests

Go to the test directory under the root quickfix directory. Type either runat debug [port] or runat release [port], depending on if you want to test the debug or release version. The port is used to listen for connections on a socket server. This should be a port that is not already in use on your system. runat_threaded.bat is also provided if you want to test using threaded socket code. The parameters are the same.

Linux / Solaris / FreeBSD / Mac OS X

Unit Tests

Enter the test directory under quickfix. All tests need to be run from this directory. To run unit tests, type ./runut [port] where the port is used to test the socket functionality.

Acceptance Tests

Go to the test directory under the root quickfix directory. Type ./runat [port]. The port is used to listen for connections on a socket server. This should be a port that is not already in use on your system. runat_threaded is also provided if you want to test using threaded socket code. The parameters are the same.

Java

Unit Tests

Enter the test directory under quickfix. All tests need to be run from this directory. To run unit tests, type ./runut_java where the port is used to test the socket functionality.

Acceptance Tests

Go to the test directory under the root quickfix directory. Type ./runat_java [port] on *nix, or runat_java.bat [port] on windows. The port is used to listen for connections on a socket server. This should be a port that is not already in use on your system.