forked from stp/stp
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathINSTALL
120 lines (83 loc) · 3.38 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
STP is built with [CMake](http://cmake.org/), version 2.8.8 or newer.
CMake is a meta build system that generates build files for other tools such as
make(1), Visual Studio, Xcode, etc. For a list of generators supported on your
platform, consult `cmake --help`.
Useful configuration variables
==============================
Here are a few interesting configuration variables. These apply to all
generators.
BUILD_SHARED_LIBS : Build shared libraries rather than static
CMAKE_BUILD_TYPE : The build type (e.g. Release)
CMAKE_INSTALL_PREFIX : The prefix for install (e.g. /usr/local )
ENABLE_TESTING : Enable running tests
SANITIZE : Use Clang's sanitization checks
TEST_QUERY_FILES: Test STP externally by passing it query files in tests/query-files
TUNE_NATIVE : Tune compilation to native architecture
Makefile
========
Quick start
-----------
To build STP run
mkdir build && cd build
cmake -G 'Unix Makefiles' /path/to/stp/source/root
make
If you'd prefer a more in-depth explanation of how to configure, build
and install STP read on...
Dependencies
------------
STP relies on a few dependencies, namely boost and flex/bison. Installing
the required header files and binaries can be achieved through the following.
(Tested on Ubuntu 13.04.)
sudo apt-get install bison flex libboost-all-dev
Build directory
---------------
CMake supports building in and out of source. It is recommended that
you build out of source. For example in a directory outside of the
STP root source directory run
mkdir build
Configuration
-------------
The simplest thing you can do is use the default configuration by running
cd build/
cmake -G 'Unix Makefiles' /path/to/stp/source/root
You can easily tweak the build configuration in several ways
* Run `cmake-gui /path/to/stp/source/root` instead of `cmake`. This
user interface lets you control the value of various configuration
variables and lets you pick the build system generator.
* Run `ccmake` instead of `cmake`. This provides an ncurses terminal
interface for changing configuration variables.
* Pass "-D<VARIABLE>=<VALUE>" options to `cmake` (not very user friendly).
It is probably best if you **only** configure this way if you are writing
scripts.
You can also tweak configuration later by running
make edit_cache
Then edit any configuration variables, reconfigure and then regenerate the
build system.
Build, test and install
-----------------------
After configuration you can build by running
make
Remember you can use the `-j<n>` flag to significantly to decrease build
time by running `<n>` jobs in parallel (e.g. `make -j4`).
To run tests (optinal) you will need to setup the OutputCheck submodule if you
have not done so.
cd /path/to/stp/source/root
git submodule init
git submodule update
cd build
cmake -G 'Unix Makefiles' ENABLE_TESTING=ON ..
make
You can then run the tests by running
make check
You can find out more about testing in STP at https://github.com/stp/stp/wiki/Testing .
Installation (optional) can be done by running
make install
and files can be uninstalled by running
make uninstall
The root of installation is controlled by the CMAKE_INSTALL_PREFIX variable
at configure time. Remember you can easily change this at anytime by running
make edit_cache
and editing the value of CMAKE_INSTALL_PREFIX.
Visual Studio
=============
TODO