Stxxlzip file from SourceForge
make.settings.localin the base directory according to your system configuration:
BOOST_ROOTvariable according to the Boost root path, e. g. BOOST_ROOT = "C:\Program Files (x86)\boost\boost_1_40_0"#
/O2or any other VC++ optimization level you like, add -D_SECURE_SCL=0 to switch off iterator checking, which improves performance
DEBUG_COMPILER=/MDd/Zi and DEBUG_LINKER=/DEBUG enable debugging
stxxl.vcprojfile (VS Solution Object) in Visual Studio. The file is located in the
STXXL_ROOTdirectory Press F7 to build the library. The library file (libstxxl.lib) should appear in
STXXL_ROOT\libdirectory Or build the library and the STXXL test programs by pressing Ctrl-Alt-F7 (or choosing from 'Build' drop-down menu Rebuild Solution)
library_msvcand the tests by executing
tests_msvc, with all the appropriate environment set (e. g. by using the VS Command Shell)
Programs using Stxxl can be compiled using options from
compiler.options file (in the
STXXL_ROOT directory). The linking options for the VC++ linker you can find in
linker.options file. In order to accomplish this do the following:
compiler.optionsfile. Make sure that the Runtime libraries/debug options (/MDd or /MD or /MT or /MTd) of the
Stxxllibrary (see above) do not conflict with the options of your project. Use the same options in the
Stxxland your project.
If you use make files you can include the
make.settings file in your make files and use
STXXL_LINKER_OPTIONS variables, defined therein.
cl -c my_example.cpp $(STXXL_COMPILER_OPTIONS)
link my_example.obj /out:my_example.exe $(STXXL_LINKER_OPTIONS)
STXXL_ROOT\test\WinGUI directory contains an example MFC GUI project that uses
Stxxl. In order to compile it open the WinGUI.vcproj file in Visual Studio .NET. Change if needed the Compiler and Linker Options of the project (see above).
Before you try to run one of the
STXXL examples (or your own
STXXL program) you must configure the disk space that will be used as external memory for the library. For instructions how to do that, see the next section.
To get best performance with
STXXL you should assign separate disks to it. These disks should be used by the library only. Since
STXXL is developed to exploit disk parallelism, the performance of your external memory application will increase if you use more than one disk. But from how many disks your application can benefit depends on how "I/O bound" it is. With modern disk bandwidths of about 50-75 MiB/s most of applications are I/O bound for one disk. This means that if you add another disk the running time will be halved. Adding more disks might also increase performance significantly.
You must define the disk configuration for an
STXXL program in a file named
'.stxxl' that must reside in the same directory where you execute the program. You can change the default file name for the configuration file by setting the environment variable
Each line of the configuration file describes a disk. A disk description uses the following format:
Description of the parameters:
full_disk_filename: full disk filename. In order to access disks STXXL uses file access methods. Each disk is represented as a file. If you have a disk called
e:then the correct value for the
capacity: maximum capacity of the disk in megabytes
STXXLhas a number of different file access implementations for WINDOWS, choose one of them:
writePOSIX system calls (slow)
wincall:performs disks transfers using
WriteFileWinAPI calls This method supports direct I/O that avoids superfluous copying of data pages in the Windows kernel. This is the best (and default) method in Stxxl for Windows.
boostfd: access the file using a Boost file descriptor
fileperblock_boostfd: same as above, but take a single file per block, using full_disk_filename as file name prefix. Usually provide worse performance than the standard variants, but release freed blocks to the file system immediately.
memory: keeps all data in RAM, for quicker testing
wbtl: library-based write-combining (good for writing small blocks onto SSDs), based on
See also the example configuration file
'config_example_win' included in the archive.
In order to get the maximum performance one should precreate disk files described in the configuration file, before running
The precreation utility is included in the set of
STXXL utilities (
utils\createdisks.exe ). Run this utility for each disk you have defined in the disk configuration file:
utils\createdisks.exe capacity full_disk_filename...