Install and compile Heimdall

From CyanogenMod
Jump to: navigation, search

Linux

Fedora

$ su -c 'yum groupinstall "Development Tools"'
$ su -c 'yum install libusb1-devel qt-devel libtool'

After this step, skip to the instructions for generic Linux distributions below.

Debian based

These instructions are for Debian based distributions including Ubuntu and Linux Mint.

With apt-get

$ sudo apt-get install heimdall-flash heimdall-flash-frontend

Compiling from source

$ sudo apt-get install build-essential cmake zlib1g-dev qt5-default libusb-1.0-0-dev libgl1-mesa-glx libgl1-mesa-dev

After this step, skip to the instructions for downloading and compiling below.

Arch Linux

Heimdall is available in the AUR (AUR/heimdall-git). If you have yaourt or pacaur you can compile and install simply using

$ yaourt -S heimdall-git

or

$ pacaur -S heimdall-git


Generic Linux Instructions

These are distro-independent instructions.

Installing prerequisites

Use your favourite package manager to install (the development version if your distro has seperate "-dev" packages)of the following pre-requisites:

  1. gcc/g++
  2. make(automake)
  3. libc(glibc)
  4. libusb
  5. qt
  6. CMake
  7. OpenGL
  8. zlib

Downloading and compiling

$ git clone git://github.com/Benjamin-Dobell/Heimdall.git
$ mkdir -p Heimdall/build
$ cd Heimdall/build
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ make
$ sudo cp bin/* /usr/local/bin

Start Heimdall by issuing either heimdall or heimdall-frontend in a terminal.

OSX

Installing prerequisites

  • First make sure you have installed XCode and pkgconfig.
    • There are several different ways you can install pkgconfig, the simplest option is to use Homebrew.
$ brew install pkgconfig
  • Open a terminal and navigate to the directory you downloaded, or extracted, Heimdall to.
  • Install libusb >= 1.0:
$ brew install libusb
  • Enter the following commands to compile libpit.
$ cd libpit
$ ./configure
$ make
$ cd ..
    • NOTE: There is no need to run "sudo make install".

Installing heimdall

  • Enter the following commands to compile and install Heimdall:
$ cd heimdall
$ export CC=/usr/bin/clang CXX=/usr/bin/clang++
$ ./configure
$ make
$ sudo make install
$ cd ..
    • NOTE: The export line is needed to overcome a compile error with 1.4RC and will hopefully be unnecessary soon.
    • NOTE: Do not be alarmed if the sudo make install ends with: make[2]: Nothing to be done for `install-data-hook'
  • If you haven't installed the driver before, enter the following:
$ cd OSX
$ sudo ./install-kext.sh

Installing the Frontend

  • First make sure you have installed XCode from your OS X install DVD.
  • You'll also need Qt 4.7 or later, available from: http://qt.nokia.com/downloads/
  • Open a terminal and navigate to the directory you extracted Heimdall to.
  • Enter the following commands to compile and install Heimdall Frontend:
$ cd heimdall-frontend
$ qmake heimdall-frontend.pro
  • Open Finder and navigate to the heimdall-frontend sub-directory. Open the newly created XCode project.
  • From the menu bar select Build -> Build. This outputs heimdall-frontend to /Applications



Windows

Prebuilt package

Heimdall is available for download at http://glassechidna.com.au/heimdall/. However, to get the latest version, you must follow the instructions below to compile from source.

Compile with CMake

Download and install MSYS2 to set up a MinGW-W64 build environment. After installing, a terminal will launch. Issue the following commands:

$ pacman -Syu
$ pacman -S mingw-w64-x86_64 mingw-w64-x86_64-clang mingw-w64-x86_64-cmake mingw-w64-x86_64-libusb mingw-w64-x86_64-qt5-static make git
$ export PATH="/mingw64/bin:$PATH"
$ git clone git://github.com/Benjamin-Dobell/Heimdall.git
$ mkdir -p Heimdall/build
$ cd Heimdall/build
$ cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DQt5Widgets_DIR=/mingw64/qt5-static/lib/cmake/Qt5Widgets ..
$ make

After compiling, open a command prompt/Explorer window and navigate to %msys64%\home\%username%\Heimdall\build\bin (where "%msys64%" is the directory you installed MSYS2 to, C:\msys64 by default). There should now be two executable files in that folder: heimdall.exe and heimdall-frontend.exe. You can run them from that directory or move them to a more suitable location. Navigate to %msys64%\home\%username%\Heimdall\Win32\Drivers for the Zadig (driver) executable.