Skip to content

Commit

Permalink
Merge pull request The-OpenROAD-Project#4613 from liav-vorak/master
Browse files Browse the repository at this point in the history
Added aarch64 architecture support for Ubuntu 22.04
  • Loading branch information
vvbandeira committed Aug 15, 2024
2 parents 797d4c1 + 5ff1cbc commit 14b1cbd
Showing 1 changed file with 35 additions and 11 deletions.
46 changes: 35 additions & 11 deletions etc/DependencyInstaller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ _installCommonDev() {
# tools versions
osName="linux"
cmakeChecksum="b8d86f8c5ee990ae03c486c3631cee05"
cmakeChecksumAarch64="6a6af752af4b1eae175e1dd0459ec850"
cmakeVersionBig=3.24
cmakeVersionSmall=${cmakeVersionBig}.2
pcreVersion=10.42
Expand All @@ -84,12 +85,16 @@ _installCommonDev() {
# CMake
cmakePrefix=${PREFIX:-"/usr/local"}
cmakeBin=${cmakePrefix}/bin/cmake
arch=$(uname -m)
if [[ "$arch" == "aarch64" ]]; then
cmakeChecksum="${cmakeChecksumAarch64}"
fi
if [[ ! -f ${cmakeBin} || -z $(${cmakeBin} --version | grep ${cmakeVersionBig}) ]]; then
cd "${baseDir}"
wget https://cmake.org/files/v${cmakeVersionBig}/cmake-${cmakeVersionSmall}-${osName}-x86_64.sh
md5sum -c <(echo "${cmakeChecksum} cmake-${cmakeVersionSmall}-${osName}-x86_64.sh") || exit 1
chmod +x cmake-${cmakeVersionSmall}-${osName}-x86_64.sh
./cmake-${cmakeVersionSmall}-${osName}-x86_64.sh --skip-license --prefix=${cmakePrefix}
wget https://cmake.org/files/v${cmakeVersionBig}/cmake-${cmakeVersionSmall}-${osName}-${arch}.sh
md5sum -c <(echo "${cmakeChecksum} cmake-${cmakeVersionSmall}-${osName}-${arch}.sh") || exit 1
chmod +x cmake-${cmakeVersionSmall}-${osName}-${arch}.sh
./cmake-${cmakeVersionSmall}-${osName}-${arch}.sh --skip-license --prefix=${cmakePrefix}
else
echo "CMake already installed."
fi
Expand Down Expand Up @@ -242,15 +247,34 @@ _installOrTools() {
if [[ ! -z "${PREFIX}" ]]; then mkdir -p "${PREFIX}"; fi
cd "${baseDir}"

orToolsFile=or-tools_${arch}_${os}-${version}_cpp_v${orToolsVersionSmall}.tar.gz
wget https://github.com/google/or-tools/releases/download/v${orToolsVersionBig}/${orToolsFile}
orToolsPath=${PREFIX:-"/opt/or-tools"}
if command -v brew &> /dev/null; then
orToolsPath="$(brew --prefix or-tools)"
if [ "$(uname -m)" == "aarch64" ]; then
# Disable exit on error for 'find' command, as it might return non zero
set +euo pipefail
LIST=($(find / -type f -name "libortools.so*" 2>/dev/null))
# Bring back exit on error
set -euo pipefail
if [ ${#LIST[@]} -eq 0 ]; then
echo "OR-TOOLS NOT FOUND"
echo "Installing OR-Tools for aarch64..."
git clone https://github.com/google/or-tools.git
cd or-tools
${cmakePrefix}/bin/cmake -S. -Bbuild -DBUILD_DEPS:BOOL=ON -DCMAKE_INSTALL_PREFIX=$orToolsPath
sudo ${cmakePrefix}/bin/cmake --build build --config Release --target install -v
else
echo "OR-Tools is already installed"
fi
else
orToolsFile=or-tools_${arch}_${os}-${version}_cpp_v${orToolsVersionSmall}.tar.gz
wget https://github.com/google/or-tools/releases/download/v${orToolsVersionBig}/${orToolsFile}
orToolsPath=${PREFIX:-"/opt/or-tools"}
if command -v brew &> /dev/null; then
orToolsPath="$(brew --prefix or-tools)"
fi
mkdir -p ${orToolsPath}
tar --strip 1 --dir ${orToolsPath} -xf ${orToolsFile}
rm -rf ${baseDir}
fi
mkdir -p ${orToolsPath}
tar --strip 1 --dir ${orToolsPath} -xf ${orToolsFile}
rm -rf ${baseDir}
}

_installUbuntuCleanUp() {
Expand Down

0 comments on commit 14b1cbd

Please sign in to comment.