Skip to content

Commit

Permalink
Merge pull request #29 from CarlWachter/build_local
Browse files Browse the repository at this point in the history
Note about LD_LIBRARY_PATH and script for checking requirements
  • Loading branch information
mkroening authored May 29, 2024
2 parents 684077b + c0f8681 commit 5708dc2
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ The build process works currently only on **x86-based Linux** systems. The follo
* Netwide Assembler (NASM)
* GNU Make, GNU Binutils, cmake
* Tools and libraries to build *linux*, *binutils* and *gcc* (e.g. flex, bison, MPFR library, GMP library, MPC library)
* texinfo
* Rust

On Debian-based systems the packets can be installed by executing:
```
sudo apt-get install cmake nasm texinfo libmpfr-dev libmpc-dev libgmp-dev flex bison
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 5708dc2

Please sign in to comment.