Dependencies:
cmake
>= 3.1.0zlib
qt
>= 5.5 ( >= 5.6 is required if you want to rearrange tabs using drag&drop)Python3.5+
python3-msgpack
python3-openssl
orpython3-pyopenssl
(depending on your distro)OpenSSL
>= 1.0.0, < 1.1.0
Optional dependencies: (recommended for development)
clang-tidy
clang-format
libclang-common-dev
gtest
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:
git
Python2.7
- Python packages:
pip
tox>=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
You will need to install the following:
Qt
formsvc2017_64
Visual 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
.
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.
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.dll
andssleay32.dll
fromveles-build-${name}\openssl-1.0.2l\out32dll
to a separate folder outside the build directory and set CMake varOPENSSL_DLL_DIR
to it. Do this step for all used configurations (e.g.Debug
andRelWithDebInfo
). - Copy
zlibstatic.lib
(orzlibstaticd.lib
for debug builds) fromveles-build-${name}\zlib\${name}\
to a separate folder and pointZLIB_LIBRARY
to it. Do the same withzlib.h
andzconf.h
fromveles-build-${name}\prefix\include\
, this time usingZLIB_INCLUDE_DIR
. Repeat for all used configurations.
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_PATH
to the cloned folder.
Enabling auto code formatting (build target format
) and static analysis
(target lint
):
- Install LLVM 6.0.0.
- Set
CLANG_TOOLS_PATH
to 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).