Skip to content

Instantly share code, notes, and snippets.

@itzmeanjan
Last active February 27, 2025 14:33
Show Gist options
  • Save itzmeanjan/84b7df57604708e33f04fc43e55ecb0c to your computer and use it in GitHub Desktop.
Save itzmeanjan/84b7df57604708e33f04fc43e55ecb0c to your computer and use it in GitHub Desktop.
Quickly setup AWS EC2 linux instance - ready for running tests and benchmarks
#!/bin/bash
# System update
sudo apt-get update
sudo apt full-upgrade -y
sudo apt-get autoremove -y
# Install system development tools
sudo apt-get install build-essential -y
sudo apt-get install cmake -y
# Build and install google-test
pushd ~
git clone https://github.com/google/googletest.git
pushd googletest
mkdir build
pushd build
cmake .. -DBUILD_GMOCK=OFF
make -j
sudo make -j install
popd
popd
popd
# Build and install google-benchmark
pushd ~
git clone https://github.com/google/benchmark.git
pushd benchmark
cmake -E make_directory "build"
cmake -E chdir "build" cmake -DBENCHMARK_ENABLE_GTEST_TESTS=OFF -DCMAKE_BUILD_TYPE=Release ../
sudo cmake --build "build" --config Release --target install -j
popd
popd
# Instal Rust (Interactive)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
@itzmeanjan
Copy link
Author

itzmeanjan commented Nov 4, 2024

I use this BASH script for quickly installing system development utilities, testing framework and benchmarking harness on Linux machines on AWS EC2. In C++ projects, my choice of

  • testing framework: google-test
  • benchmark harness: google-benchmark

It also installs Rust toolchain, following https://rustup.rs/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment