Skip to content

Commit

Permalink
[doc]intro to the compiling variables-EN (vesoft-inc#1466)
Browse files Browse the repository at this point in the history
* intro to variables

* laura

* code verification

Co-authored-by: dutor <440396+dutor@users.noreply.github.com>
  • Loading branch information
amber-moe and dutor committed Dec 23, 2019
1 parent c5621c9 commit d3bf9f5
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ bash> source ~/.bashrc
```bash
bash> mkdir build && cd build
bash> cmake ..
bash> make
bash> sudo make install
bash> make -j$(nproc)
bash> sudo make install -j$(nproc)
```

Or you can build the release version.
Expand All @@ -76,8 +76,58 @@ Or you can build the release version.

```bash
bash> cmake -DCMAKE_BUILD_TYPE=Release ..
bash> make
bash> sudo make install
bash> make -j$(nproc)
bash> sudo make install -j$(nproc)
```

#### Instructions on Variables

- CMAKE\_INSTALL\_PREFIX: specifies the installation directory.

If you specify an installation directory during cmake, the `make install` installs **Nebula Graph** to the specified directory.

For example, the following commands install **Nebula Graph** in the `/home/test` directory.

```bash
bash> cd nebula/build
bash> cmake -DCMAKE_INSTALL_PREFIX=/home/test ..
bash> make -j$(nproc) && make install -j$(nproc)
```

- NEBULA\_BUILD\_VERSION: set the version number for the binary files

For example, the following commands set the version number to `1.0.0`.

```bash
bash> cd nebula/build
bash> cmake -DNEBULA_BUILD_VERSION="1.0.0" ..
bash> make -j$(nproc) && make install -j$(nproc)
```

The following command checks the version number of the compiled binary files in `/usr/local/nebula/bin/` directory.

```bash
bash> /usr/local/nebula/bin/nebula --version
```

- ENABLE\_TESTING: specifies whether to compile the UT code.

The default value is ON. If you don't want to compile, set it to OFF during cmake with the following command.

```bash
bash> cd nebula/build
bash> cmake -DENABLE_TESTING=OFF ..
bash> make -j$(nproc) && make install -j$(nproc)
```

- ENABLE\_ASAN: Add AddressSanitizer when compiling.

The default value is OFF. You can set it to ON during cmake with the following command.

```bash
bash> cd nebula/build
bash> cmake -DENABLE_ASAN=ON ..
bash> make -j$(nproc) && make install -j$(nproc)
```

#### **Building Completed**
Expand Down
32 changes: 14 additions & 18 deletions docs/manual-EN/4.contributions/how-to-contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,32 +97,28 @@ git push --force origin master

#### Edit the Code

You can now edit the code on the `myfeature` branch. We are following [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html).
You can now edit the code on `myfeature` branch. Please be noted that we are following [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html).

#### Run Stand-Alone Mode
### Verifying Your Code

If you want to reproduce and investigate an issue, you may need
to run Nebula Graph in stand-alone mode.
#### Compiling the Source Code

```bash
# Build the binary.
> make server
Please refer to the [build source code](../3.build-develop-and-administration/1.build/1.build-source-code.md) documentation to compile.

# Run in stand-alone mode.
> nebula-graphd
```
#### Code Verification

Then you can connect the **Nebula Graph** console to your local server
- Replace the binary files

```bash
> nebula
```
The compiled binary files of the three services are in `nebula/build/src/daemon/_build/` directory. The compiled console is in `nebula/build/src/console/_build` directory. You can replace the binary files in the bin directory, restart the services and verify.
- Add unit tests

#### Run Test
There is a `test` directory in the modified code module. You can add unit tests in it, then compile and run the unit tests. Please make sure your submitted codes pass all the unit tests.
- Run all the unit tests

```bash
# Run unit test to make sure all tests passed.
```
```bash
cd nebula/build
ctest -j$(nproc)
```

### Step 5: Keep Your Branch in Sync

Expand Down

0 comments on commit d3bf9f5

Please sign in to comment.