Table of Contents
Hi! Welcome to JuCC.
- GitHub We use GitHub for all our development.
- Account Sign up for a GitHub account.
- OS Make sure you are running Ubuntu 20.04. If not, the recommended approach is to dual boot or to use a VM.
- IDE We recommend Visual Studio Code.
- Packages Install using
- Go to the folder:
cd ~/jucc/script/installation
- Install all the necessary packages:
sudo bash ./packages.sh
- Go to the folder:
You should learn a little about the following:
- We try our best to list all available options in CMakeLists.txt. Search for
# HEADER CMake options and global variables.
- You should know these targets.
jucc
: Building will build thejucc
binary and all its dependencies.jucc_benchmark
: Building will build and link thejucc
object file to thebenchmark
library. Running will run the benchmarks.test
: Building will run all unit tests usinggtest
. This will not show specifics of failed test, runbuild/bin/jucc_test
for detailed info.format
: Building will run the formatterclang-format
on the codebase with our rules. Use this every time right before you commit and right before you make a pull request!check-format
: Building will check if the codebase is correctly formatted according toclang-format
with our rules.check-clang-tidy
: Building will check if the codebase passes theclang-tidy
static analyzer tests with our rules.check-lint
: Building will check if the codebase passes thebuild-support/cpplint.py
checks.
If you run into issues, you may need your default python
to point to a python3
install. For example, add this to your ~/.zshrc
: alias python=python3
- Check out the latest version of the JuCC repository.
git checkout main
git pull upstream main
- Create a new branch.
git checkout -b my_new_branch
- Work on your code. Add features, add documentation, add tests, add remove bugs, and so on.
- Push your code.
- Make sure you run tests locally! See below.
git push -u origin my_new_branch
- Go to GitHub and open a new pull request.
- When a pull request is opened, this triggers our Continuous Integration environment on circle-ci.
- CI will clone the repo, apply your changes, and make sure that formatting, linting, tests, etc pass.
- Code has to pass all the checks for it to be merged!
Use make test
or ninja test
to run inside your build folder to run all tests.
For detailed test info:
- Go to the folder:
cd ~/JuCC/build
- Generate optimized config with
cmake -GNinja .. -DCMAKE_BUILD_TYPE=Release
- Build project with
ninja
- Run
./bin/jucc_test
- Go to the folder:
cd ~/JuCC/build
- Generate optimized config with
cmake -GNinja .. -DCMAKE_BUILD_TYPE=Release
- Build project with
ninja
- Run
./bin/jucc_benchmark [...options]