Giter Site home page Giter Site logo

zhourubin / autofdo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from google/autofdo

0.0 1.0 0.0 41.25 MB

AutoFDO

Home Page: https://groups.google.com/forum/#!forum/autofdo

License: Apache License 2.0

C++ 95.70% C 1.05% CMake 2.36% Shell 0.89%

autofdo's Introduction

1. Install prerequisite

    $ sudo apt install libunwind-dev libgflags-dev libssl-dev libelf-dev protobuf-compiler

To build autofdo tool for llvm, it needs llvm major version >= 10. You can either install llvm using command like "sudo apt install llvm-10", or you can build the latest llvm from source.

To build autofdo tool for gcc, no llvm installation is needed.

2. Commands

2.1 Build autofdo tool for llvm

2.1.1 If build llvm from source

    $ git clone https://github.com/llvm/llvm-project.git
    $ mkdir build
    $ cd build
    $ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON \
        -DBUILD_SHARED_LIBS=OFF -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_INCLUDE_TESTS=OFF \
        -DLLVM_ENABLE_RTTI=ON -DCMAKE_INSTALL_PREFIX=/path/to/llvm/install \
        -DLLVM_ENABLE_PROJECTS="clang" ../llvm-project
    $ ninja
    $ ninja install

2.1.2 Build autofdo tools

    $ git clone --recursive https://github.com/google/autofdo.git
    $ cd autofdo
    $ mkdir build
    $ cd build
    $ # Note: "-DCMAKE_INSTALL_PREFIX=." must be used, because there is a bug in the basil cmakelist.
    $ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. -DLLVM_PATH=/path/to/llvm/install ../   
    $ ninja
    $ ninja test

2.2 Build autofdo tool for gcc

2.2.1 Build autofdo tools using system gcc

    $ git clone --recursive https://github.com/google/autofdo.git
    $ cd autofdo
    $ mkdir build
    $ cd build
    $ # Note: "-DCMAKE_INSTALL_PREFIX=." must be used, because there is a bug in the basil cmakelist.
    $ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ../   
    $ ninja

2.2.2 Build autofdo tools using customized built gcc

  1. download gcc tarball, for example, gcc-11.2.0.tar.gz (other versions of gcc are similar), and extract
  2. download prerequisites by
    $ cd gcc-release-11.2.0
    $ ./contrib/download_prerequisites
  1. config, build and install gcc
    $ cd gcc-release-11.2.0
    $ mkdir build
    $ cd build
    $ ../gcc-releases-gcc-11.2.0/configure \
          --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu \
          --prefix=${HOME}/installs/gcc-11.2.0 \
          --enable-checking=release \
          --enable-languages=c,c++ \
          --disable-multilib \
          --program-suffix=-11.2
    $ make -j24 install
  1. config autofdo and build:
    $ export PATH=${HOME}/installs/gcc-11.2.0/bin:$PATH
    $ CXX=${HOME}/installs/gcc-11.2.0/bin/x86_64-linux-gnu-g++-11.2
    $ CC=${HOME}/installs/gcc-11.2.0/bin/x86_64-linux-gnu-gcc-11.2

    $  mkdir -p build-with-gcc
    $  cd build-with-gcc
    $  cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. \
        -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" ../autofdo

autofdo's People

Contributors

danielcdh avatar wmi-11 avatar shenhanc78 avatar dnovillo avatar wmi0 avatar kim-phillips-arm avatar zerodefect avatar shenhanc avatar davidcallahan avatar erozenfeld avatar rwalkr avatar taewookoh avatar mtrofin avatar rvanka avatar same-denik avatar vapier avatar ruijiefang avatar lannadorai avatar algrant-arm avatar danielboulby-arm avatar gburgessiv avatar marksantaniello avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.