Skip to content

Commit

Permalink
apt-get -> yum
Browse files Browse the repository at this point in the history
Differential Revision: D48290307
  • Loading branch information
openrichardfb authored and facebook-github-bot committed Sep 26, 2023
1 parent 0a53b9f commit 63e4c00
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 24 deletions.
55 changes: 35 additions & 20 deletions .github/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
set -ex

# Add support for https apt sources.
wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt-transport-https_1.2.32ubuntu0.2_amd64.deb
echo "93475e4cc5e7a86de63fea0316f3f2cd8b791cf4d6ea50a6d63f5bd8e1da5726 apt-transport-https_1.2.32ubuntu0.2_amd64.deb" | sha256sum -c
sudo dpkg -i apt-transport-https_1.2.32ubuntu0.2_amd64.deb
rm apt-transport-https_1.2.32ubuntu0.2_amd64.deb
# wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt-transport-https_1.2.32ubuntu0.2_amd64.deb
# echo "93475e4cc5e7a86de63fea0316f3f2cd8b791cf4d6ea50a6d63f5bd8e1da5726 apt-transport-https_1.2.32ubuntu0.2_amd64.deb" | sha256sum -c
# sudo dpkg -i apt-transport-https_1.2.32ubuntu0.2_amd64.deb
# rm apt-transport-https_1.2.32ubuntu0.2_amd64.deb

export MAX_JOBS=8
if [ "${CIRCLE_JOB}" != "COVERAGE" ]; then
Expand All @@ -27,7 +27,8 @@ if [ "${CIRCLE_JOB}" != "COVERAGE" ]; then
fi

install_pocl() {
sudo apt-get install -y ocl-icd-opencl-dev clinfo libhwloc-dev opencl-headers
# sudo yum install -y ocl-icd-opencl-dev clinfo libhwloc-dev opencl-headers


git clone https://github.com/pocl/pocl.git
cd pocl && git checkout 4efafa82c087b5e846a9f8083d46b3cdac2f698b && cd ../
Expand Down Expand Up @@ -57,12 +58,12 @@ install_fmt() {

upgrade_python() {
echo "Removing old python...";
sudo apt-get remove --purge -y python3.6 python3-pip libpython3-dev
sudo apt-get autoremove -y
# sudo yum remove --purge -y python3.6 python3-pip libpython3-dev
# sudo yum autoremove -y

echo "Installing dependencies for new python..."
sudo apt-get update
sudo apt-get install -y libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev
# sudo yum update
# sudo yum install -y libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev

echo "Installing new python..."
mkdir python-src
Expand All @@ -85,30 +86,43 @@ upgrade_python() {
sudo pip3.9 install virtualenv
}

GLOW_DEPS="libpng-dev libgoogle-glog-dev libboost-all-dev libdouble-conversion-dev libgflags-dev libjemalloc-dev libpthread-stubs0-dev libevent-dev libssl-dev"
GLOW_DEPS=" \
libpng-devel \
glog-devel \
boost-devel \
double-conversion-devel \
gflags-devel \
jemalloc-devel \
libevent-devel \
clang-devel \
protobuf-compiler \
protobuf-devel \
llvm \
llvm-devel \
openssl-devel"

if [ "${CIRCLE_JOB}" == "CHECK_CLANG_AND_PEP8_FORMAT" ]; then
sudo apt-get update
#sudo yum update
upgrade_python
else
# Install Glow dependencies
sudo apt-get update
#sudo yum update

# Redirect clang
sudo ln -s /usr/bin/clang-8 /usr/bin/clang
sudo ln -s /usr/bin/clang++-8 /usr/bin/clang++
sudo ln -s /usr/bin/llvm-symbolizer-8 /usr/bin/llvm-symbolizer
sudo ln -s /usr/bin/llvm-config-8 /usr/bin/llvm-config-8.0

sudo apt-get install -y ${GLOW_DEPS}
sudo yum install -y ${GLOW_DEPS}
install_fmt
fi

# Since we are using llvm-7 in these two branches, we cannot use pip install cmake
if [ "${CIRCLE_JOB}" != "PYTORCH" ] && [ "${CIRCLE_JOB}" != "CHECK_CLANG_AND_PEP8_FORMAT" ]; then
sudo pip install cmake==3.17.3
else
sudo apt-get install cmake
sudo yum install -y cmake
fi

# Install ninja, (newest version of) autopep8 through pip
Expand All @@ -131,8 +145,8 @@ if [[ "${CIRCLE_JOB}" == "ASAN" ]]; then
CMAKE_ARGS+=("-DGLOW_WITH_OPENCL=OFF")
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Release")
elif [[ "$CIRCLE_JOB" == "COVERAGE" ]]; then
sudo apt-get install wget
sudo apt-get install -y lcov
sudo yum install -y wget
sudo yum install -y lcov
sudo pip install awscli --upgrade
../utils/install_protobuf.sh
CC=gcc-5 CXX=g++-5 cmake -G Ninja \
Expand All @@ -141,10 +155,10 @@ elif [[ "$CIRCLE_JOB" == "COVERAGE" ]]; then
-DGLOW_USE_COVERAGE=ON \
../
elif [[ "$CIRCLE_JOB" == "CHECK_CLANG_AND_PEP8_FORMAT" ]]; then
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-11 main"
sudo apt-get update
sudo apt-get install -y clang-format-11
#sudo rpm --import https://apt.llvm.org/llvm-snapshot.gpg.key
#sudo yum-config-manager --add-repo http://apt.llvm.org/xenial/llvm-toolchain-xenial-11.repo
#sudo yum update
sudo yum install -y clang-devel
cd /tmp
python3.9 -m virtualenv venv
source venv/bin/activate
Expand All @@ -166,6 +180,7 @@ else
fi

if [ "${CIRCLE_JOB}" != "COVERAGE" ] && [ "${CIRCLE_JOB}" != "CHECK_CLANG_AND_PEP8_FORMAT" ] && [ "${CIRCLE_JOB}" != "PYTORCH" ]; then
sleep 2h
cmake -GNinja ${CMAKE_ARGS[*]} ../
ninja
fi
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/glow-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
repository: pytorch/glow
timeout: 120
script: |
# temporarily get the job green before we complete the migration.
exit 0
echo '::group::Setup Environment Variables'
# Mark Build Directory Safe
git config --global --add safe.directory /__w/glow/glow
Expand All @@ -31,12 +29,15 @@ jobs:
fi
original_pwd=$(pwd)
sudo apt-get update;
# sudo yum update
mkdir ~/tempdownload;
cd ~/tempdownload;
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.1p1.tar.gz;
tar zxvf openssh-8.1p1.tar.gz;
cd openssh-8.1p1 && ./configure && make && sudo make install;
cd openssh-8.1p1 &&
./configure &&
make > /dev/null &&
sudo make install;
cd $original_pwd
git submodule sync
Expand Down
5 changes: 5 additions & 0 deletions lib/LLVMIRCodeGen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ add_library(LLVMIRCodeGen
LLVMIRGen.cpp
LLVMBackend.cpp)

find_package(LLVM REQUIRED CONFIG)

include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})

llvm_map_components_to_libnames(LLVM_TARGET_LIBRARIES ${LLVM_TARGETS_TO_BUILD})
target_link_libraries(LLVMIRCodeGen
PUBLIC
Expand Down

0 comments on commit 63e4c00

Please sign in to comment.