forked from vsiivola/variKN
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall
103 lines (78 loc) · 3.34 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
Building the varikn toolkit requires the CMake tool. CMake is a
makefile generator (like Autoconf). The build script is in
CMakeLists.txt.
The convention for CMake is to build "out-of-source", where all the
work is done in a separate directory from your source directory.
First, we configure the build (we only need to do this once):
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
Useful tricks:
* By default, the makefiles generated by cmake are 'quiet'. To make
them verbose (so you can see what's being passed to gcc, etc) use
the VERBOSE variable like this: make VERBOSE=1
* You can make a debug build with
cmake .. -DCMAKE_BUILD_TYPE=Debug
* If you're experimenting with alternate build flags, you can define
them as environment variables before configuring. For example:
cd build
export CXXFLAGS=-fmudflap
cmake ..
make
* If you are reconfiguring cmake with very different settings (for
example, switching from Debug to Release), you should start in a
new build folder or delete everything in your current build folder.
* CMake also supports generating IDE project files (MSVC, XCode,
etc). To get a list of what it supports, do "cmake -h". For
example, to create an MSVC project:
mkdir .build
cd .build
cmake .. -G "Visual Studio 9 2008"
start Project.sln
or to create an XCode project:
mkdir .build
cd .build
cmake .. -G Xcode
open Project.xcodeproj
* Note on Eclipse CDT. Eclipse is finicky about the way its
projects are laid out. Instead of creating a "build" folder as
a child of your source dir you'll need to create it as a *sibling*.
You'll also need to tell cmake to link the build dir to the source
dir in the Eclipse project. (See http://tinyurl.com/28zuhqb for
more information.) For example:
cd trunk
mkdir ../.build-trunk
cd ../.build-trunk
cmake ../trunk/ -G "Eclipse CDT4 - Unix Makefiles" -DECLIPSE_CDT4_GENERATE_SOURCE_PROJECT=TRUE
Then in Eclipse you'll do File->Import the project in .trunk-build.
Inside this project you'll see a link to "[Source Directory]".
* Language wrappers DLLs can be built for Python using Swig.
These are built automatically if the languages are detected by
cmake. You can explicitly enable/disable building for these
wrappers by passing -DPYTHON=1 (-DPYTHON=0). On Mac OS X, you can
force the python version to macports with -DMACPORTS_PYTHON_VERSION=2.6 .
The default target is python3, see python_wrappers/Cmakelists.txt
if you want to compile for python2.
TEST:
Building Unit tests can be enabled with "-DCMAKE_ENABLE_TESTING=1". The tests
do not work on Windows yet. Unit tests can be run with "make test" or
"ctest --verbose". Unit tests require the unit test library from Boost.
RUNNING IN DOCKER:
# Set up docker env (only needed if you use command line docker-machine)
docker-machine start
eval $(docker-machine env default)
# Create container
docker build -t varikn_test_container .
# Log in container
docker container run --interactive --tty varikn_test_container
# Inside container
mkdir build; (cd build; cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_ENABLE_TESTING=1 && make && ctest --verbose)
# clean up
docker image rm varikn_test_container
docker machine stop
NOTES FOR MAC DOCKER SETUP
# Instal needed Homebrew packages
brew install docker docker-machine
brew cask install virtualbox
# Create VM
docker-machine create default