Skip to content

Instantly share code, notes, and snippets.

@itzmeanjan
Last active November 4, 2024 10:35
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-get upgrade -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
@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

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