Apache Geode By Example - From Zero To .NET Examples in 15 Steps
Apache Geode Native is an Apache Geode client that has both C++ and .NET interfaces. Geode Native is set to make its first release as part of the Apache Geode 1.8 release later this year. Last week, I did a getting started guide for the C++ interface, now it's time for some .NET.
-
The video starts off by setting up a Windows Developer VM based on the Microsoft provided image.
https://developer.microsoft.com/en-us/windows/downloads/virtual-machines -
Once you have the image up and running, open Powershell as Admin and install Chocolately.
https://chocolatey.org/install -
We are going to need install git and clone the Apache Geode Native repo
choco install git git clone git@github.com:apache/geode-native.git
-
Inside the Geode Native repo, run
install-dependencies.ps1
to install all build dependencies.
https://github.com/apache/geode-native/tree/develop/packer/windows -
Update VS2017 to include 2015 C++ Libaries using Visual Studio's GUI installer. https://developercommunity.visualstudio.com/content/problem/48806/cant-find-v140-in-visual-studio-2017.html
-
Download the latest Apache Geode Server Release
http://geode.apache.org/releases/ -
Set Apache Geode Environment Variable. This let's the system know where to find the Apache Geode Server.
GEODE_HOME=<path-to-directory>
-
Open VS2017 cmd, configure the CMake build environment using the correct generator, and specify a install location
cd <clone> mkdir build cmake .. -G "Visual Studio 14 2015 Win64" -Thost=x64 -DCMAKE_INSTALL_PREFIX=<path>
I like to put everthing in my workspace, so
C:\workspace\geode-native-install
is what I'm going to be using for the rest of the post. -
Compile Geode Native
cmake --build . -- /m
-
Now, run CMake install
cd <clone> cd build cmake --build . --target docs cmake --build . --target install
-
Set GEODE_NATIVE_HOME
GEODE_NATIVE_HOME=C:\workspace\geode-native-install
-
Copy the examples directory to workspace using ths below Powershell command.
Copy-Item C:\workspace\geode-native-install\examples -Destination C:\workspace\examples -Recurse
-
Next, we will use CMake to configure and build the examples.
cd C:\workspace\examples mkdir build cd build cmake .. -G "Visual Studio 14 2015 Win64" -Thost=x64 cmake --build . -- /m
-
In
C:\workspace\examples\build
, open the generated solution file in Visual Studio and build the example you are interested in. -
Back in the examples directory, run the
startserver.ps1
powershell script to start the Apache Geode server. -
Lastly, use Visual Studio to run the built example. Don't forget to run
stopserver.ps1
.
Hit me up on Twitter or in the comments below if you have any questions.