- Notifications
You must be signed in to change notification settings - Fork0
An elegant implementation for Stanford CS144 TCP Lab
li-plus/cs144
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
For solution, seeCS144 Notes.
For build prereqs, seethe CS144 VM setup instructions.
To set up your build directory:
$ mkdir -p <path/to/sponge>/build$ cd <path/to/sponge>/build$ cmake ..
Note: all further commands listed below should be run from thebuild
dir.
To build:
$ make
You can use the-j
switch to build in parallel, e.g.,
$ make -j$(nproc)
To test (after building; make sure you've got thebuild prereqs installed!)
$ make check_labN *(replacing N with a checkpoint number)*
The first time you runmake check_lab...
, it will runsudo
to configure twoTUN devices for use duringtesting.
You can specify a different compiler when you run cmake:
$ CC=clang CXX=clang++ cmake ..
You can also specifyCLANG_TIDY=
orCLANG_FORMAT=
(see "other useful targets", below).
Sponge's build system supports several different build targets. By default, cmake chooses theRelease
target, which enables the usual optimizations. TheDebug
target enables debugging and reduces thelevel of optimization. To choose theDebug
target:
$ cmake .. -DCMAKE_BUILD_TYPE=Debug
The following targets are supported:
Release
- optimizationsDebug
- debug symbols and-Og
RelASan
- release build withASan andUBSanRelTSan
- release build withThreadSanDebugASan
- debug build with ASan and UBSanDebugTSan
- debug build with ThreadSan
Of course, you can combine all of the above, e.g.,
$ CLANG_TIDY=clang-tidy-6.0 CXX=clang++-6.0 .. -DCMAKE_BUILD_TYPE=Debug
Note: if you want to changeCC
,CXX
,CLANG_TIDY
, orCLANG_FORMAT
, you need to removebuild/CMakeCache.txt
and re-run cmake. (This isn't necessary forCMAKE_BUILD_TYPE
.)
To generate documentation (you'll needdoxygen
; output will be inbuild/doc/
):
$ make doc
To format (you'll needclang-format
):
$ make format
To see all available targets,
$ make help
About
An elegant implementation for Stanford CS144 TCP Lab