Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

An elegant implementation for Stanford CS144 TCP Lab

NotificationsYou must be signed in to change notification settings

li-plus/cs144

Repository files navigation

For solution, seeCS144 Notes.

For build prereqs, seethe CS144 VM setup instructions.

Sponge quickstart

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.

build options

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 theReleasetarget, 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 - optimizations
  • Debug - debug symbols and-Og
  • RelASan - release build withASan andUBSan
  • RelTSan - release build withThreadSan
  • DebugASan - debug build with ASan and UBSan
  • DebugTSan - 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.)

other useful targets

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

[8]ページ先頭

©2009-2025 Movatter.jp