-
Notifications
You must be signed in to change notification settings - Fork 213
Installation
rDSN has been built on the following platforms, and here are the quick summaries.
~$ sudo apt-get install build-essential
~$ sudo apt-get install cmake
~$ sudo apt-get install php5-cli
~$ sudo apt-get install libboost-all-dev
~/projects$ git clone https://github.com/Microsoft/rdsn.git
~/projects/rdsn$ mkdir mybuilddir
~/projects/rdsn$ cd mybuilddir
~/projects/rdsn/mybuilddir$ cmake .. -DCMAKE_INSTALL_PREFIX=/opt/rdsn
~/projects/rdsn/mybuilddir$ make
~/projects/rdsn/mybuilddir$ sudo make install
install Xcode
install HomeBrew, which will be installed to '/usr/local' by default.
~$ brew install --env=std cmake
~$ brew install --env=std php
~$ brew install --env=std boost
~/projects$ git clone https://github.com/Microsoft/rdsn.git
~/projects/rdsn$ mkdir mybuilddir
~/projects/rdsn$ cd mybuilddir
~/projects/rdsn/mybuilddir$ cmake .. -DCMAKE_INSTALL_PREFIX=/opt/rdsn
~/projects/rdsn/mybuilddir$ make
~/projects/rdsn/mybuilddir$ sudo make install
install Visual Studio 2013
install cmake
install php
install boost library
c:\projects> git clone https://github.com/Microsoft/rDSN.git
c:\Projects\rDSN> "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64
c:\Projects\rDSN> mkdir mybuilddir
c:\Projects\rDSN> cd mybuilddir
c:\Projects\rDSN/mybuilddir> cmake .. -DCMAKE_INSTALL_PREFIX=c:\rdsn -DBOOST_INCLUDEDIR="c:\boost_1_57_0" -DBOOST_LIBRARYDIR="c:\boost_1_57_0\lib64-msvc-12.0" -G "NMake Makefiles"
c:\Projects\rDSN\mybuilddir> nmake
c:\Projects\rDSN\mybuilddir> nmake install
Though not tested, we assume rDSN can run on most platforms across Linux, Mac and Windows.
-
Ubuntu
~$ sudo apt-get install build-essential
-
Mac OS X. Please install the latest Xcode from Mac App Store. We also recommend Homebrew for handily handling dependent packages. Homebrew as well as those packages will be installed to '/usr/local' by default.
-
Windows. Both Visual Studio 2012 and 2013 are supported, and a free version of Visual Studio Community 2013 could be found here
CMake is a cross-platform build-generator tool. CMake does not build the project directly, yet it generates the files needed by the build tools such as GNU make, Visual Studio, nmake and etc. for building rDSN. Version 2.8.8 is the minimum required, however we recommend using the latest version.
-
Ubuntu
~$ sudo apt-get install cmake
-
Mac OS X. Download the executable package from here, or use homebrew:
~$ brew install --env=std cmake
-
Windows. Download the executable package from here, and make sure that cmake could be reachable through the PATH environment variable.
PHP is a server-side scripting language designed for web development, and here we use it for code generation purpose.
-
Ubuntu
~$ sudo apt-get install php5-cli
-
Mac OS X
~$ brew install --env=std php
-
Windows. Download the executable package from here, and make sure that php could be reachable through the PATH environment variable.
-
Ubuntu
~$ sudo apt-get install libboost-all-dev
-
Mac OS X. Homebrew is recommended:
~$ brew install --env=std boost
-
Windows. The prebuilt 1.57.0 windows binaries is recommended instead of manual build. E.g. if the user would like to build 64 bit rDSN using Visual Studio 2013, the file boost_1_57_0-msvc-12.0-64.exe in that prebuilt directory is needed. Suppose the boost library is installed in 'c:\boost_1_57_0'.
General installation information can be found here.
Please get the enhanced Apache Thrift and Google Protoc, and put them in the 'bin' subdirectory under the rDSN source tree.
We use here the command-line, non-interactive CMake interface. Suppose later you will install rDSN to '/opt/rdsn' on UNIX, or 'c:\rdsn' on Windows.
-
Open a shell. Your development tools must be reachable from this shell through the PATH environment variable:
a. Windows using Visual Studio 2013. Open a CMD console and execute:
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64
-
Create a directory for containing the build. It is not supported to build rDSN directly in the source directory. Go to this directory:
~/projects/rdsn$ mkdir mybuilddir ~/projects/rdsn$ cd mybuilddir
-
Generate build files by CMake:
a. Ubuntu
~/projects/rdsn/mybuilddir$ cmake .. -DCMAKE_INSTALL_PREFIX=/opt/rdsn
b. Mac OS X
~/projects/rdsn/mybuilddir$ cmake .. -DCMAKE_INSTALL_PREFIX=/opt/rdsn
c. Windows using Visual Studio 2013
~/projects/rdsn/mybuilddir$ cmake .. -DCMAKE_INSTALL_PREFIX=c:\rdsn -DBOOST_INCLUDEDIR="c:\boost_1_57_0" -DBOOST_LIBRARYDIR="c:\boost_1_57_0\lib64-msvc-12.0" -G "Visual Studio 12 2013 Win64"
d. Windows using nmake
~/projects/rdsn/mybuilddir$ cmake .. -DCMAKE_INSTALL_PREFIX=c:\rdsn -DBOOST_INCLUDEDIR="c:\boost_1_57_0" -DBOOST_LIBRARYDIR="c:\boost_1_57_0\lib64-msvc-12.0" -G "NMake Makefiles"
CMake will detect your development environment, perform a series of test and generate the files required for building rDSN. CMake will use default values for all build parameters. See the CMake documentation for fine-tuning your build. E.g. if we need a "Debug" version, just append the parameter "-DCMAKE_BUILD_TYPE=Debug". When under windows, we may encounter the error of "cannot find the following boost libraries", and this is usually caused by one of following reasons: (1) invalid local cache, please clean up the build directory, and retry; or (2). incompatible boost library version versus local compiler settings, e.g., 32 bits vs 64 bits, or VS2013 (12.0) boost libraries while local visual studio is 2012. Please fix and retry.
-
After CMake has finished running, proceed to use IDE project files or start the build from the build directory:
a. UNIX
~/projects/rdsn/mybuilddir$ make
b. Windows using nmake
~/projects/rdsn/mybuilddir$ nmake
-
Install rDSN:
a. UNIX
~/projects/rdsn/mybuilddir$ make install
b. Windows using nmake
~/projects/rdsn/mybuilddir$ nmake install
Take Ubuntu as an example, the rDSN libraries will be installed in /opt/rdsn/lib and all header files in /opt/rdsn/include:
- libdsn.core.a - this is where the Service API and Tool API are defined and connected.
- libdsn.dev.a - higher level programming syntactic sugar
- libdsn.tools.common.a - default local runtime providers, including network, aio, lock, etc., and a set of common tools like tracer/profiler/fault-injector.
- libdsn.tools.simulator.a - the simulation tool
- libdsn.failure_detecotor - the perfect failure detector library
- libdsn.replication.clientlib - replication client library
- libdsn.replication - replication server library
- libdsn.replication.meta_server - replication meta server library
If everything is as expected, congratulations, and you are ready to try our tutorial to develop your first service with rDSN.
Content