Created
December 8, 2022 18:55
-
-
Save Thibb1/065786184253d8e553efe7122ee82e82 to your computer and use it in GitHub Desktop.
Install criterion v2.4.1 on linux (fedora)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
Best wishes!