Building instructions
May 9, 2018 ยท View on GitHub
Linux
Dependencies:
cmake>= 3.1.0zlibqt>= 5.5 ( >= 5.6 is required if you want to rearrange tabs using drag&drop)Python3.5+python3-msgpackpython3-opensslorpython3-pyopenssl(depending on your distro)OpenSSL>= 1.0.0, < 1.1.0
Optional dependencies: (recommended for development)
clang-tidyclang-formatlibclang-common-devgtest
If your distribution has -dev or -devel packages, you'll also need ones corresponding to the dependencies above.
On Ubuntu it can be done like this:
apt-get install cmake zlib1g-dev qtbase5-dev g++ python3 python3-venv \
python3-dev python3-msgpack python3-openssl libffi-dev libssl-dev \
clang-tidy-6.0 clang-format-6.0 libclang-common-6.0-dev
To build:
$ mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo ..
$ make
To install [which is optional], use:
$ make install
To run Veles from build directory we recommend creating virtualenv for Veles:
$ python3 -m venv ~/venv/veles
$ . ~/venv/veles/bin/activate
(veles) $ pip install -r ../python/requirements.txt
Then to run Veles you will need to activate the venv before running Veles:
$ . ~/venv/veles/bin/activate
(veles) $ ./veles
If you want to install to a non-default directory, you'll also need to pass it as an option to cmake before building, eg.:
$ cmake -D CMAKE_INSTALL_PREFIX:PATH=/usr/local ..
Python tests dependencies:
gitPython2.7- Python packages:
piptox>=2.4.0
On Ubuntu it can be done like this:
apt-get install git python2.7 python2.7-dev python3-pip
pip3 install tox>=2.4.0
Windows
You will need to install the following:
Qtformsvc2017_64Visual Studio 2017(Community edition is enough; you will need MSVC even when using only Qt Creator)cmake+git(both can be installed with Visual Studio)perl(only for building OpenSSL; e.g. Strawberry Perl)Python3.5+(you will also need to install dependencies frompython/requirements.txt)
and add a folder containing cmake to PATH.
Qt Creator
Click Open Project, open CMakeLists.txt and configure the project for
MSVC2017 64bit. Build the project.
In case of problems with perl, set PERL_EXECUTABLE in CMake configuration to
the absolute path of perl.exe.
For speeding up further builds see the notes under Visual Studio 2017 section.
Visual Studio 2017
Open the source folder using File -> Open -> Folder... and then open CMake
settings: CMake -> Change CMake Settings -> CMakeLists.txt.
Example minimal config:
{
"configurations": [
{
"name": "x64-Debug",
"generator": "Visual Studio 15 2017 Win64",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64" ],
"buildRoot": "DRIVE:\\some_path\\veles-build-${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-m -v:minimal",
"ctestCommandArgs": "",
"variables": [
{
"name": "CMAKE_PREFIX_PATH",
"value": "C:\\Qt\\5.9.1\\msvc2017_64"
},
{
"name": "PERL_EXECUTABLE",
"value": "C:\\StrawberryPerl\\perl\\bin\\perl.exe"
}
]
},
{
"name": "x64-RelWithDebInfo",
"generator": "Visual Studio 15 2017 Win64",
"configurationType": "RelWithDebInfo",
"inheritEnvironments": [ "msvc_x64" ],
"buildRoot": "DRIVE:\\some_path\\veles-build-${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-m -v:minimal",
"ctestCommandArgs": "",
"variables": [
{
"name": "CMAKE_PREFIX_PATH",
"value": "C:\\Qt\\5.9.1\\msvc2017_64"
},
{
"name": "PERL_EXECUTABLE",
"value": "C:\\StrawberryPerl\\perl\\bin\\perl.exe"
}
]
}
]
}
After the first successful build you can greatly speedup CMake configuration step and the build itself:
- Copy
libeay32.dllandssleay32.dllfromveles-build-${name}\openssl-1.0.2l\out32dllto a separate folder outside the build directory and set CMake varOPENSSL_DLL_DIRto it. Do this step for all used configurations (e.g.DebugandRelWithDebInfo). - Copy
zlibstatic.lib(orzlibstaticd.libfor debug builds) fromveles-build-${name}\zlib\${name}\to a separate folder and pointZLIB_LIBRARYto it. Do the same withzlib.handzconf.hfromveles-build-${name}\prefix\include\, this time usingZLIB_INCLUDE_DIR. Repeat for all used configurations.
Additional Info
If you want to start Veles without doing install step, you will additionally
have to set Server script field in Connection -> Connect... dialog to
point to the srv.py file (which you can find in python folder in the Veles
source tree).
If you want to run tests you will also need Google Test:
git clone https://github.com/google/googletest.git- Set
GOOGLETEST_SRC_PATHto the cloned folder.
Enabling auto code formatting (build target format) and static analysis
(target lint):
- Install LLVM 6.0.0.
- Set
CLANG_TOOLS_PATHto a folder containing clang-format and clang-tidy (e.g.C:\Program Files\LLVM\bin).
Correctly configured build should take about 2 minutes on a CPU with 8 hyper-threads. If you find any problems with the instructions listed above, feel free to create an issue or ping us on IRC (#veles).