BusTub is a relational database management system built at Carnegie Mellon University for the Introduction to Database Systems (15-445/645) course. This system was developed for educational purposes and should not be used in production environments.
WARNING: IF YOU ARE A STUDENT IN THE CLASS, DO NOT DIRECTLY FORK THIS REPO. DO NOT PUSH PROJECT SOLUTIONS PUBLICLY. THIS IS AN ACADEMIC INTEGRITY VIOLATION AND CAN LEAD TO GETTING YOUR DEGREE REVOKED, EVEN AFTER YOU GRADUATE.
The following instructions will create a private BusTub that you can use for your development:
- Go to https://github.com/new to create a new repo under your account. Pick a name (e.g.
private-bustub
) and make sure it is you select it as private. - On your development machine, clone the public BusTub:
$ git clone --depth 1 https://github.com/cmu-db/bustub.git public-bustub
- You next need to mirror the public BusTub repo into your own private BusTub repo. Suppose your GitHub name is
student
and your repo name isprivate-bustub
, you will execute the following commands:This copies everything in the public BusTub repo into your own private repo. You can now delete this bustub directory:$ cd public-bustub $ git push --mirror git@github.com:student/private-bustub.git
$ cd .. $ rm -rv public-bustub
- Clone your own private repo on:
$ git clone git@github.com:student/private-bustub.git
- Add the public BusTub as a remote source. This will allow you to retrieve changes from the CMU-DB repository during the semester:
$ git remote add public https://github.com/cmu-db/bustub.git
- You can now pull in changes from the public BusTub as needed:
$ git pull public master
We suggest working on your projects in separate branches. If you do not understand how Git branches work, learn how. If you fail to do this, you might lose all your work at some point in the semester, and nobody will be able to help you.
To ensure that you have the proper packages on your machine, run the following script to automatically install them:
$ sudo build_support/packages.sh
Then run the following commands to build the system:
$ mkdir build
$ cd build
$ cmake ..
$ make
If you want to compile the system in debug mode, pass in the following flag to cmake: Debug mode:
$ cmake -DCMAKE_BUILD_TYPE=Debug ..
$ make
This enables AddressSanitizer, which can generate false positives for overflow on STL containers. If you encounter this, define the environment variable ASAN_OPTIONS=detect_container_overflow=0
.
If you are using Windows 10, you can use the Windows Subsystem for Linux (WSL) to develop, build, and test Bustub. All you need is to Install WSL. You can just choose "Ubuntu" (no specific version) in Microsoft Store. Then, enter WSL and follow the above instructions.
If you are using CLion, it also works with WSL.
$ cd build
$ make check-tests