Installation
This page provides information on installing the PacketLab software package. Currently, we support installation via two methods: prebuilt package (currently only for Linux/amd64) and build from source. See Install Using Prebuilt Package or Install from Source for more information on either method.
Install Using Prebuilt Package
Prerequisite
- Linux kernel OS
- lmdb ≥ 0.9.21
- Python ≥ 3.7
pip- Utility for zip archive extraction (e.g.
unzip)
Installation via prebuilt package is currently only for Linux on amd64 arch. We plan to support more platforms/archs in the future.
- Note for Potential Requirement of Rust: The Python
pktlabmodule depends on the Python cryptography module, which may require rust installation. See the Python cryptography module installation page for more information.
Installation Steps
- Download the prebuilt package (see Download for download links). The latest release is preferred.
- Extract the prebuilt package content. With
unzipthis can be done withunzip pktlab-[VER]_prebuilt.[raw|noraw].[PLATFORM].[ARCH].zip - Install the required Python modules. This can be done by running
pip install -r [EXTRACT_DIR_PATH]/setup_aux/requirements.txt - Run the init script within
[EXTRACT_DIR_PATH]/binand follow the prompts to set up the user home directory for the package. This can be done by executing thepktlab_initscript with[EXTRACT_DIR_PATH]/bin/pktlab_initNote during this step,
pktlab_initmay complain about not finding thePPKSMancommand even if the previouspipstep is completed successfully (thePPKSMantool is shipped with thepktlabPython module). One possible reason for this is thatpipinstalls thePPKSManscript to~/.local/bin, which is by default not within thePATHvariable. To fix this, one can addexport PATH=~/.local/bin:$PATHto~/.bashrcand runsource ~/.bashrcto reload~/.bashrcto fix the problem.
After completing all previous steps, we will have the ~/.pktlab set up and ready for experiment/endpoint running. Before running pktlab programs, we recommend adding [EXTRACT_DIR_PATH]/bin to PATH to allow running the shipped programs more easily. See Running our First Local Experiment and Running our First External Experiment for more information on experiment/endpoint running.
Note if the extracted package content is shared among different users, only steps 3 and 4 (and
PATHvariable exporting if applicable) need to be performed by new users after the initial installation.
Install from Source
Prerequisite
- A POSIX.1-2004 compliant OS
- OpenSSL ≥ 1.1.1
- lmdb ≥ 0.9.21
- Wasmtime C API ≥ 23.0.1
You will need to install the Wasmtime C API at some local directory.
- Python ≥ 3.7
piptarwith gzip support (e.g. GNU tar)- Build tools (e.g.
build-essentialpackage for Debian/Ubuntu)
- Note for Potential Requirement of Rust: The Python
pktlabmodule depends on the Python cryptography module, which may require rust installation on some platforms. See the Python cryptography module installation page for more information.
- Note for Mac users: On MacOS, OpenSSL can be installed via Homebrew with
brew install openssl. However, it is possible for the installed OpenSSL libraries and headers to be not found by the C compiler. To fix this, one way is to soft link the OpenSSL header directory to under/usr/local/includeand soft link the OpenSSL libraries to under/usr/local/lib. These can be done with:sudo mkdir -p /usr/local/include /usr/local/lib # In case directories do not exist sudo ln -s BREW_OPENSSL_INSTALLATION_LIB_DIR/libssl.a /usr/local/lib sudo ln -s BREW_OPENSSL_INSTALLATION_LIB_DIR/libcrypto.a /usr/local/lib sudo ln -s BREW_OPENSSL_INSTALLATION_INCLUDE_DIR/openssl /usr/local/include
BREW_OPENSSL_INSTALLATION_LIB_DIRandBREW_OPENSSL_INSTALLATION_INCLUDE_DIRcan be found by runningbrew info openssl, which should include the following text:For compilers to find openssl@VER you may need to set: export LDFLAGS="-LBREW_OPENSSL_INSTALLATION_LIB_DIR" export CPPFLAGS="-IBREW_OPENSSL_INSTALLATION_INCLUDE_DIR"When installing lmdb via Homebrew, one may also need to soft link
liblmdb.aandlmdb.hto/usr/local/liband/usr/local/includeas well. This can be done similarly as in the OpenSSL case: the library and header file could be found viabrew info lmdb, and the soft links could then be created using theln -scommand.
- Note for FreeBSD users: On FreeBSD, if
python3is installed viapkg, one may also need to install thedatabases/py-sqlite3package withpkg install databases/py-sqlite3. Also note rust may be required, and could be installed similarly viapkg install rust.
Installation Steps
- Download the source tarball (see Download for download links). The latest release is preferred.
- Extract the source tarball content. With GNU tar this can be done with
tar xvzf pktlab-[VER].tar.gz cdinto the extracted directory (should bepktlab-[VER])- Run
./configure \ --prefix=[ABSOLUTE_INSTALL_DIR_PATH] \ --enable-wasmtime=[ABSOLUTE_WASMTIME_CAPI_INSTALL_DIR_PATH]where
[ABSOLUTE_INSTALL_DIR_PATH]is the absolute path to the target pktlab package install destination (need not exist beforehand), and[ABSOLUTE_WASMTIME_CAPI_INSTALL_DIR_PATH]is the absolute path to the Wasmtime C API install location.Note it is HIGHLY RECOMMENDED to specify the
--prefixoption to avoid installing in the system directories. - Run
make - Run
make install. If all steps have been successful, the software package is now installed at the target location. - Finally, follow steps 3 and 4 in Install Using Prebuilt Package. Please note the paths will be different. The path should be
[ABSOLUTE_INSTALL_DIR_PATH]/share/pktlab/setup_aux/requirements.txtor/usr/local/share/pktlab/setup_aux/requirements.txtfor step 3. For step 4, the path should be[ABSOLUTE_INSTALL_DIR_PATH]/bin/pktlab_init.
After completing all previous steps, we will have the ~/.pktlab set up and ready for experiment/endpoint running. Before running pktlab programs, we recommend adding [ABSOLUTE_INSTALL_DIR_PATH]/bin to PATH to allow running the shipped programs more easily. See Running our First Local Experiment and Running our First External Experiment for more information on experiment/endpoint running.