diff --git a/.github/build.sh b/.github/build.sh old mode 100644 new mode 100755 index 786650b627..8ad367ad00 --- a/.github/build.sh +++ b/.github/build.sh @@ -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 @@ -27,8 +27,7 @@ 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 ../ mkdir build_pocl @@ -57,12 +56,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 @@ -85,14 +84,27 @@ 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 @@ -100,7 +112,7 @@ else 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 @@ -108,7 +120,7 @@ fi 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 @@ -131,8 +143,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 \ @@ -141,10 +153,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 @@ -166,6 +178,8 @@ else fi if [ "${CIRCLE_JOB}" != "COVERAGE" ] && [ "${CIRCLE_JOB}" != "CHECK_CLANG_AND_PEP8_FORMAT" ] && [ "${CIRCLE_JOB}" != "PYTORCH" ]; then + echo ${CMAKE_ARGS[*]} + # sleep 2h cmake -GNinja ${CMAKE_ARGS[*]} ../ ninja fi diff --git a/.github/test.sh b/.github/test.sh old mode 100644 new mode 100755 diff --git a/.github/workflows/glow-build.yml b/.github/workflows/glow-build.yml index f9b07bfe17..f2c889bf20 100644 --- a/.github/workflows/glow-build.yml +++ b/.github/workflows/glow-build.yml @@ -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 @@ -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; + tar zxf openssh-8.1p1.tar.gz; + cd openssh-8.1p1 && + ./configure && + make > /dev/null && + sudo make install; cd $original_pwd git submodule sync @@ -44,7 +45,6 @@ jobs: set -e # Build + chmod +x .github/build.sh .github/test.sh + export CIRCLE_JOB=OPENCL .github/build.sh - - # Test - .github/test.sh diff --git a/lib/LLVMIRCodeGen/CMakeLists.txt b/lib/LLVMIRCodeGen/CMakeLists.txt index c7d5a5a023..1857187256 100644 --- a/lib/LLVMIRCodeGen/CMakeLists.txt +++ b/lib/LLVMIRCodeGen/CMakeLists.txt @@ -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