11# Build Environment
22We build CodeCompass in a Linux environment. Currently, Ubuntu Long-Term
3- Support releases are the main targets: Ubuntu 18 .04 LTS and Ubuntu 20 .04 LTS.
3+ Support releases are the main targets: Ubuntu 20 .04 LTS and Ubuntu 22 .04 LTS.
44
55We also provide a Docker image that can be used as developer environment to
66CodeCompass. See its usage [ in a seperate document] ( /docker/README.md ) .
@@ -19,6 +19,7 @@ be installed from the official repository of the given Linux distribution.
1919 LLVM/Clang for parsing the source code.
2020- ** ` odb ` ** , ** ` libodb-dev ` ** : For persistence ODB can be used which is an
2121 Object Relation Mapping (ORM) system.
22+ *** See [ Known issues] ( #known-issues ) !***
2223- ** ` libsqlite3-dev ` ** , ** ` libodb-sqlite-dev ` ** : SQLite library and the
2324 corresponding ODB development library, in case SQLite database system is
2425 used.
@@ -27,14 +28,17 @@ be installed from the official repository of the given Linux distribution.
2728 database system is used.
2829- ** ` default-jdk ` ** : For search parsing CodeCompass uses an indexer written in
2930 Java.
30- - ** ` thrift-compiler ` ** , ** ` libthrift-dev ` ** : Thrift is used as the Web RPC API.
31+ - ** ` thrift-compiler ` ** , ** ` libthrift-dev ` ** : Thrift is used as the Web RPC API.
32+ *** See [ Known issues] ( #known-issues ) !***
3133- ** ` libssl-dev ` ** / ** ` libssl1.0-dev ` ** : OpenSSL libs are required by Thrift,
3234 and NodeJS.
3335- ** ` libgraphviz-dev ` ** : GraphViz is used for generating diagram
3436 visualizations.
3537- ** ` libmagic-dev ` ** : For detecting file types.
3638- ** ` libgit2-dev ` ** : For compiling Git plugin in CodeCompass.
37- - ** ` npm ` ** : For handling JavaScript dependencies for CodeCompass web GUI.
39+ - ** ` node ` ** and ** ` npm ` ** : For building and developing the CodeCompass web GUI
40+ and managing dependencies.
41+ *** See [ Known issues] ( #known-issues ) !***
3842- ** ` ctags ` ** : For search parsing.
3943- ** ` doxygen ` ** : For documentation generation.
4044- ** ` libgtest-dev ` ** : For testing CodeCompass.
@@ -46,31 +50,22 @@ be installed from the official repository of the given Linux distribution.
4650The following command installs the packages except for those which have some
4751known issues.
4852
49- #### Ubuntu 18.04 ("Bionic Beaver") LTS
50-
51- ``` bash
52- sudo apt install git cmake make g++ gcc-7-plugin-dev libboost-all-dev \
53- llvm-10-dev clang-10 libclang-10-dev \
54- default-jdk libssl1.0-dev libgraphviz-dev libmagic-dev libgit2-dev ctags doxygen \
55- libldap2-dev libgtest-dev npm
56- ```
57-
5853#### Ubuntu 20.04 ("Focal Fossa") LTS
5954
6055``` bash
6156sudo apt install git cmake make g++ libboost-all-dev \
6257 llvm-11-dev clang-11 libclang-11-dev \
6358 odb libodb-dev thrift-compiler libthrift-dev \
6459 default-jdk libssl-dev libgraphviz-dev libmagic-dev libgit2-dev ctags doxygen \
65- libldap2-dev libgtest-dev npm
60+ libldap2-dev libgtest-dev
6661```
6762
6863#### Ubuntu 22.04 ("Jammy Jellyfish") LTS
6964
7065``` bash
71- sudo apt install git curl wget cmake make libboost-all-dev \
72- g++ gcc-11-plugin-dev \
66+ sudo apt install git cmake make g++ libboost-all-dev \
7367 llvm-11-dev clang-11 libclang-11-dev \
68+ gcc-11-plugin-dev \
7469 default-jdk libssl-dev libgraphviz-dev libmagic-dev libgit2-dev exuberant-ctags doxygen \
7570 libldap2-dev libgtest-dev
7671```
@@ -80,32 +75,22 @@ sudo apt install git curl wget cmake make libboost-all-dev \
8075Depending on the desired database engines to be supported, the following
8176packages should be installed:
8277
83- ##### Ubuntu 18.04 ("Bionic Beaver")
84-
85- The database connector library must be compiled manually for this release,
86- however, the database programs themselves should be installed from the
87- package manager.
88-
89- ``` bash
90- # For SQLite database systems:
91- sudo apt install libsqlite3-dev
92-
93- # For PostgreSQL database systems:
94- sudo apt install postgresql-server-dev-< version>
95- ```
96-
9778##### Ubuntu 20.04 ("Focal Fossa") LTS
9879
9980``` bash
10081# For SQLite database systems:
10182sudo apt install libodb-sqlite-dev libsqlite3-dev
10283
10384# For PostgreSQL database systems:
104- sudo apt install libodb-pgsql-dev postgresql-server-dev-< version >
85+ sudo apt install libodb-pgsql-dev postgresql-server-dev-12
10586```
10687
10788##### Ubuntu 22.04 ("Jammy Jellyfish") LTS
10889
90+ The database connector library must be compiled manually for this release,
91+ however, the database programs themselves should be installed from the
92+ package manager.
93+
10994``` bash
11095# For SQLite database systems:
11196sudo apt install libsqlite3-dev
@@ -125,10 +110,10 @@ by other processes which could, in extreme cases, make the system very hard or
125110impossible to recover. ** Please do NOT add a ` sudo ` in front of any ` make ` or
126111other commands below, unless * explicitly* specified!**
127112
128- ### ODB (for Ubuntu 18.04, Ubuntu 22.04)
113+ ### ODB (for Ubuntu 22.04)
129114ODB is an Object Relational Mapping tool, that is required by CodeCompass.
130- For Ubuntu 18 .04, the official release of ODB conflicts with the official
131- compiler (GNU G++ 7 ) of the distribution. A newer version of ODB must be
115+ For Ubuntu 22 .04, the official release of ODB conflicts with the official
116+ compiler (GNU G++ 11 ) of the distribution. A newer version of ODB must be
132117compiled manually.
133118
134119The ODB installation uses the build2 build system. (Build2 is not needed for
@@ -172,11 +157,12 @@ time (depending on the machine one is using).
172157> ** Note:** now you may delete the * Build2* toolchain installed in the
173158> ` <build2_install_dir> ` folder, if you do not need any longer.
174159
175- ### Thrift (for Ubuntu 18.04, Ubuntu 22.04)
160+ ### Thrift (for Ubuntu 22.04)
176161CodeCompass needs [ Thrift] ( https://thrift.apache.org/ ) which provides Remote
177162Procedure Call (RPC) between the server and the client. A suitable version of
178163Thrift is, unfortunately, not part of the official Ubuntu repositories for
179- these versions, so you should download and build from source.
164+ this version (only a newer version is available), so you should download and
165+ build from source.
180166
181167Thrift can generate stubs for many programming languages. The configure
182168script looks at the development environment and if it finds the environment
@@ -211,6 +197,30 @@ cd thrift-0.13.0
211197make install -j $( nproc)
212198```
213199
200+ ### Node.js and NPM
201+ Make sure you are using at least version 18 of [ Node.js] ( https://nodejs.org/en/ ) .
202+ Unfortunately only older versions are available in the official Ubuntu repositories
203+ for all supported versions, therefore a separate installation might be required from
204+ [ NodeSource] ( https://github.com/nodesource/distributions ) .
205+
206+ ``` bash
207+ # Download and import the Nodesource GPG key
208+ sudo mkdir -p /etc/apt/keyrings
209+ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
210+
211+ # Create deb repository
212+ NODE_MAJOR=18 # or 20
213+ echo " deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR .x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
214+
215+ # Run Update and Install
216+ sudo apt-get update
217+ sudo apt-get install nodejs
218+ ```
219+
220+ You can also download [ nvm] ( https://github.com/nvm-sh/nvm ) , and run ` nvm install `
221+ at the root of the project to use the specified Node version (18.13.0).
222+
223+
214224### GTest/Googletest
215225The ` libgtest-dev ` package contains only the source files of GTest, but the
216226binaries are missing. You have to compile GTest manually.
@@ -232,9 +242,10 @@ The previously self-compiled and installed dependencies are not automatically
232242seen by CMake. Please set this environment before executing the build.
233243
234244``` bash
245+ # For all supported OS versions:
235246export GTEST_ROOT=< gtest_install_dir>
236247
237- # If using Ubuntu 18.04 or Ubuntu 22.04:
248+ # If using Ubuntu 22.04:
238249export CMAKE_PREFIX_PATH=< thrift_install_dir> :$CMAKE_PREFIX_PATH
239250export CMAKE_PREFIX_PATH=< odb_install_directory> :$CMAKE_PREFIX_PATH
240251
0 commit comments