Skip to content

Latest commit

 

History

History
35 lines (19 loc) · 5.08 KB

Building-Windows.md

File metadata and controls

35 lines (19 loc) · 5.08 KB

System Requirements

The build files have been updated to Visual Studio 2019. While the driver build itself can work with lower versions, the installer build and other solution files have been updated to Visual Studio 2019. See the requirements for Visual Studio 2019 on Microsoft's site.

The build process requires a 64-bit Windows 10 installation or higher. While it may work with lower versions like 64-bit Windows 7 as long as it is supported by Visual Studio and other components listed later, the build has not been tested with those for quite a while.

  • Install git to checkout the repositories. As a bonus, the installer also comes with bash shell (mingw) that provide a comfortable working environment for those accustomed to Linux/UNIX command-line. Choose all the recommended options in the installer. All command-line build steps assume that they are launched from CMD or equivalent.

  • Install a JDK from OpenJDK distributions or Oracle having version >= JDK8. The SnappyData product itself requires JDK8 and has not been ported to higher versions, so for consistency it is recommended to choose the latest JDK8 version. Include the "Public JRE" option in installation of the Oracle's version. Though just the JRE should also work, it is better to have the full JDK installed. OpenJDK distributions for Windows are provided by AdoptOpenJDK, RedHat among others. Prefer the 64-bit versions.

  • Install Visual Studio 2019 or higher. In the Visual Studio installer choose "Desktop development with C++" which will select all the required components.

  • The ODBC MSI installer build uses the WiX toolset. Install the latest version of the toolset. You may have to first enable .NET Framework 3.5 in "Windows Features" to proceed with the install. Also install its Visual Studio extension from marketplace (open "Extensions -> Manage Extensions" in Visual Studio).

Like the rest of SnappyData, the main driver build and testing uses gradle that allows for a lot of flexibility in builds and test runs. Of course, the gradle build targets themselves require an installation of Visual Studio. The default build produces 64-bit release and debug binaries. The installer build is done using Visual Studio using the artifacts generated by the gradle build.

The driver build and testing has a few binary dependencies (Boost, OpenSSL, Thrift, MPIR, GoogleTest) which are downloaded automatically by gradle.

Build Steps

  • Install git for Windows. Include the GIT Bash shell during installation. The steps below assume the commands being run inside the GIT Bash shell window. If you rather prefer Windows CMD shell or something else, then use the corresponding commands to those noted below.

  • Checkout snappy-odbc repository in some directory say DIR: git clone https://github.com/tibco/snappy-odbc.git

  • The snappy-odbc build assumes that top-level snappydata is checked out at the same level as snappy-odbc, so that the relative path of snappy-store repository is ../snappydata/store. So you can either checkout the entire snappydata repository at the same level as snappy-odbc. Choose one of the options below (working directory assumed to be same as DIR above):

    • git clone https://github.com/TIBCOSoftware/snappydata.git --recursive
    • OR just checkout snappy-store while creating empty snappydata repository: mkdir snappydata && cd snappydata && git clone --branch snappy/master https://github.com/TIBCOSoftware/snappy-store.git store
    • OR checkout just snappy-store somewhere and set the environment variable SNAPPYSTORE to point to it for all the other build steps below: git clone --branch snappy/master https://github.com/TIBCOSoftware/snappy-store.git
  • To build just 64-bit ODBC driver (release and debug versions), run gradlew product from within snappy-odbc checkout directory. To build both 64-bit and 32-bit drivers (release and debug versions for both), run gradlew product -PbothArch=1. For all other gradlew invocations -PbothArch=1 needs to be passed if both the architectures are built. If you are going to be dealing with only the final builds to be released, it is better to set it permanently in your gradle.properties (i.e. add the line bothArch=1 to it). The global gradle.properties is located in .gradle\gradle.properties in your home (in bash shell it can be accessed as ~/.gradle/gradle.properties).

  • The first driver build using gradle product target, or a clean build may fail with the error that linker is unable to find some dependent libraries even though they are present in the indicated paths. The reason for this issue seems to be due to parallel gradle tasks launched by default to speed up the builds. Run the gradle product target again and the errors will go away.

  • Open the installer solution file src\SnappyDataODBCSetupInstaller\SnappyDataODBCSetupInstaller.sln in the snappy-odbc checkout using Visual Studio. Ensure that the configuration is set to Release for all the projects in the solution and launch the build.