Skip to content

Instantly share code, notes, and snippets.

@Thibb1
Created December 8, 2022 18:55
Show Gist options
  • Save Thibb1/065786184253d8e553efe7122ee82e82 to your computer and use it in GitHub Desktop.
Save Thibb1/065786184253d8e553efe7122ee82e82 to your computer and use it in GitHub Desktop.
Install criterion v2.4.1 on linux (fedora)
#!/usr/bin/env bash
URL="https://github.com/Snaipe/Criterion/releases/download/v2.4.1/"
TARBALL="criterion-2.4.1-linux-x86_64.tar.xz"
DIR="criterion-2.4.1"
DST="/usr/local"
SUDO="/usr/bin/sudo"
if [ $UID -eq "0" ]; then
SUDO=""
echo "[no sudo for root]"
fi
cd /tmp
rm -f $TARBALL
rm -rf $DIR
wget $URL/$TARBALL
if [ $? != 0 ]; then
echo "failed, exiting"
exit;
fi
echo
echo "untaring $TARBALL"
tar -xf $TARBALL
if [ $? != 0 ]; then
echo "failed, exiting"
exit;
fi
echo "creating custom ld.conf"
$SUDO sh -c "echo "/usr/local/lib" > /etc/ld.so.conf.d/criterion.conf"
echo "cp headers to $DST/include/criterion"
$SUDO cp -r $DIR/include/* $DST/include/
echo "cp lib to $DST/include/criterion"
$SUDO cp -r $DIR/lib/* $DST/lib/
echo "run ldconfig."
$SUDO ldconfig
echo "Criterion installed."
@kurzacz
Copy link

kurzacz commented Oct 14, 2023

Hello, thank you for this script! Due to my linux learning, in the end I have read it and executed those commands manually. I have few suggestions:

  • in line 32 add another quotations so that they don't overlap
  • modern linux can use lib64 instead of lib

Best wishes!

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