Skip to content

Commit

Permalink
Requirement check script
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlWachter committed Apr 18, 2024
1 parent 7dc8bdc commit c0f8681
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ On Debian-based systems the packets can be installed by executing:
sudo apt-get install cmake nasm libmpfr-dev libmpc-dev libgmp-dev flex bison
```

Note: If issues arise during the build, try using requirements.sh to check the versions of the necessary packets and the configuration of the LD_LIBRARY_PATH (it should contain the MPFR library, GMP library and MPC library).

## Building the HermitCore's toolchain

To build the toolchain just call the script as follow:
Expand Down
30 changes: 30 additions & 0 deletions requirements.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

if echo "$LD_LIBRARY_PATH" | grep -q libgmp && echo "$LD_LIBRARY_PATH" | grep -q libmpc && echo "$LD_LIBRARY_PATH" | grep -q libmpfr; then
echo "LD_LIBRARY_PATH contains MPFR library, GMP library and MPC library"
elif ! echo "$LD_LIBRARY_PATH" | grep -q libgmp; then
echo "LD_LIBRARY_PATH missing GMP library"
elif ! echo "$LD_LIBRARY_PATH" | grep -q libmpc; then
echo "LD_LIBRARY_PATH missing MPC library"
elif ! echo "$LD_LIBRARY_PATH" | grep -q libmpfr; then
echo "LD_LIBRARY_PATH missing MPFR library"
fi

check_version() {
package=$1
version_command=$2

echo -n "Checking $package... "
if $version_command &> /dev/null; then
version=$($version_command | head -n 1)
echo "Installed ($version)"
else
echo "Not installed"
fi
}

# Check versions of packages
check_version "CMake" "cmake --version"
check_version "NASM" "nasm -v"
check_version "Flex" "flex --version"
check_version "Bison" "bison --version"

0 comments on commit c0f8681

Please sign in to comment.