Installing on Windows

Prerequisites

ScaleOut’s Native Client libraries were built and tested on Windows using the following compiler and libraries:

  • Visual Studio 2013
  • Boost 1.55.0-build2
  • Protobuf 2.5.0

If you need to use a different compiler or version of these libraries on Windows then please contact ScaleOut Support, and the engineering team will evaluate whether it can be supported.

Installing Boost C++ Libraries
  1. Download pre-built Boost binaries for Windows from SourceForge here. Select the installer executable that matches the compiler and platform that you will be targeting. This Boost installer contains the headers and libs needed to develop applications that use Boost C++ libraries.
  2. Run the Boost installer, noting the directory that you install to. It may take over 15 minutes to complete the installation on slower systems.
  3. Recommended: Create an environment variable called BOOST_ROOT and set it to your boost installation directory. Many Boost samples and documents assume the presence of this variable, and ScaleOut’s sample projects use this variable to locate your Boost installation.
Installing Google Protocol Buffers

Option 1: Using ScaleOut’s Pre-built protobuf Libraries. Since the official Protocol Buffers ("protobuf") project does not provide pre-built Windows libraries, ScaleOut Software provides a convenient, pre-built package of protobuf headers and libs for VS2012 and VS2013. Windows developers may choose to use these binaries rather than building this prerequisite on their own.

  1. Download the zip file containing protobuf headers and pre-built libs here.
  2. Extract the contents of the zip to a location on your development system.
  3. Recommended: Create an environment variable called PROTOBUF_ROOT and set it to extracted directory. ScaleOut’s sample projects assume the presence of this variable, and using it in your projects can simplify supporting multiple side-by-side builds of protobuf.

Option 2: Building protobuf from Source. Instructions for building the protobuf libraries from source are included in the protobuf source package and repeating them here is beyond the scope of this document. However, the following supplemental tips may prove helpful if you choose to build your own binaries:

  • Download the protobuf source package from Google Code.
  • Open protobuf-2.5.0\vsprojects\protobuf.sln in the version of Visual Studio that you intend to use to develop and build your Windows app. Visual Studio will prompt you to upgrade to your current version—allow it to complete the migration procedure.
  • If you intend to build an x64 version of your project, you will need to use Visual Studio’s Configuration Manager to add x64 as new platform.
  • Consider using Visual Studio’s Configuration Manager to prevent VS from building the solution’s test projects (gtest, gtest_main, lite-test, test_plugin, tests). These projects are not critical and may cause build errors in recent versions of Visual Studio.
  • Use the "Build Solution" menu item from Visual Studio’s Build menu to initiate the build. Do not select "Rebuild Solution"--this causes VS to remove critical intermediate build output, resulting in failure.

Configuring your Visual Studio Project

The steps below assume that you have set BOOST_ROOT and PROTOBUF_ROOT environment variables, as recommended in the Prerequisites section above. Open your project’s Properties window, set the Configuration and Platform dropdowns to All Configurations and make the changes listed below.

[Tip] Tip

The sample CppNativeClient.sln Visual Studio solution that ships with the product contains a property sheet, soss_cpp_api.props, that contains all of the project configuration items listed in this section. You can re-use this property sheet in your own solutions to save time.

  1. In Configuration Properties > C/C++ > General > Additional Include Directories, enter the paths to the following directories:

    1. Headers for ScaleOut’s C++ Native Client API: typically at C:\Program Files\ScaleOut_Software\StateServer\cpp_api\include
    2. Headers for ScaleOut’s low-level C API, typically at C:\Program Files\ScaleOut_Software\StateServer\c_api
    3. The Boost root directory: $(BOOST_ROOT)
    4. The Protocol Buffers "include" subdirectory: $(PROTOBUF_ROOT)\include
  2. In Configuration Properties > Linker > Input, add the following libraries:

    1. soss_client.lib
    2. soss_svccli.lib
    3. libprotobuf.lib
    4. libprotobuf-lite.lib
  3. In Configuration Properties > Linker > Additional Library Directories, add the following directories:

    1. C:\Program Files\ScaleOut_Software\StateServer\cpp_api\lib\msvc\$(VisualStudioVersion)\$(PlatformName)\$(Configuration)
    2. C:\Program Files\ScaleOut_Software\StateServer\c_api
    3. $(BOOST_ROOT)\lib$(PlatformArchitecture)-msvc-$(VisualStudioVersion)
    4. $(PROTOBUF_ROOT)\lib\msvc\$(VisualStudioVersion)\$(PlatformName)\$(Configuration)
  4. In Configuration Properties > C/C++ > Preprocessor, add the following preprocessor definitions:

    1. HAVE_PROTOBUF
    2. _CRT_SECURE_NO_WARNINGS (suppresses compiler warnings caused by Boost)
    3. _SCL_SECURE_NO_WARNINGS (suppresses compiler warnings caused by Protobuf)
  5. Disable precompiled header usage in Configuration Properties > C/C++ > Precompiled Headers, and remove or comment out any #includes of stdafx.h from your project. Classes generated by Protocol Buffers do not use precompiled headers.
  6. In Configuration Properties > C/C++ > Advanced, disable the following compiler warnings: 4127;4244;4267 (code generated by the protoc compiler will otherwise cause compiler warnings due to some data type conversions).