~peter-gjoel/verifydtapn/PTrieWorkflow

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
--------------------------------------------------------------------------------
1. Setup project in Eclipse
--------------------------------------------------------------------------------
This will detail how to setup a project in Eclipse CDT 
(http://www.eclipse.org/cdt/) or Eclipse IDE for C/C++ developers.

Preliminaries:
a. Install gcc/g++ (we use version 4.4.5)
b. Install boost libraries (we used 1.40 but any version that is backward 
   compatible with 1.40 should work)
	- On ubuntu you can install it through the software center
        - On mac try homebrew: brew install boost (possibly run
          sudo chown -R `whoami` /usr/local to fix the writing rights)
	- Otherwise, there is a guide here: 
	  http://www.boost.org/doc/libs/1_40_0/more/getting_started/unix-variants.html
c. Install google-sparsehash library.
	- On Ubuntu you can install this from the software center, otherwise you have
	  to get it from http://code.google.com/p/google-sparsehash/

1. Create a branch of the code, e.g. "bzr branch lp:verifytapn" (replace with 
   the branch you want to checkout)
2. Open Eclipse and create a new "empty C++ project", choose "linux GCC" as 
   toolchain, uncheck "use default location" and point eclipse to the folder in 
   which you checked out the branch.
3. Press finish
4. Right-click on your new project and choose properties
5. go to "C/C++ Build" -> "Settings"
2. Setup configuration "Debug":
	1. Choose "[All configurations]" in the "Configuration" dropdown list
	2. under "GCC C++ compiler" -> "Directories"
		- If boost is not installed in the default folders (/usr/include
		  or /usr/local/include) you must add a path to the the 
		  folder containing the boost include files (.h files)
		- The same applies to the google-sparsehash header files.
	3. under "GCC C++ linker" -> "Libraries":
		- You may need to add a path to the google-sparsehash code's "lib" folder to the 
		  "Library search path", depending on whether
		  it compiles to a library or its a header-only library.
5. MAC ONLY: In "binary parsers" select Mach-O 64 parser to enable debugging and 
   running the project from eclipse.
6. The project should now be compilable in both debug and release versions.

--------------------------------------------------------------------------------
2. Generating Query parser
--------------------------------------------------------------------------------
If you need to change the Query parser, you'll need to modify the flex.ll and
grammar.yy files. Make sure you have flex and bison installed.

To recompile the query parser follow these steps:
1. go to src/Core/QueryParser/
2. run flex -o Generated/lexer.cpp flex.ll
3. run bison -o Generated/parser.cpp grammar.yy

or using:
makefile -f makefile.XXX generate

--------------------------------------------------------------------------------
3. Compiling on Max OS X
--------------------------------------------------------------------------------
Install xcode through App Store.

Install boost, for example using homebrew as follows:
sudo chown -R `whoami` /usr/local
brew install boost

Install google-sparsehash, e.g. as follows:
brew install google-sparsehash 

Then run (for 32 bit version):
make -f makefile.osx32 clean
make -f makefile.osx32 

or run (for 64 bit version):
make -f makefile.osx64 clean
make -f makefile.osx64