Skip to content

Instantly share code, notes, and snippets.

GCC compiler optimization for ARM-based systems

2017-03-03 fm4dd

The gcc compiler can optimize code by taking advantage of CPU specific features. Especially for ARM CPU's, this can have impact on application performance. ARM CPU's, even under the same architecture, could be implemented with different versions of floating point units (FPU). Utilizing full FPU potential improves performance of heavier operating systems such as full Linux distributions.

-mcpu, -march: Defining the CPU type and architecture

These flags can both be used to set the CPU type. Setting one or the other is sufficient.

@stvhwrd
stvhwrd / setup_tmux_zsh.sh
Last active July 9, 2020 04:20
Install tmux and zsh on a remote server without root
#!/usr/bin/env bash
# Connect to the server..
# ssh username@server_ip
mkdir ~/.local;
# Download source and build libevent
cd /tmp;
wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz;
tar xvfz libevent-2.1.8-stable.tar.gz;

Compiling an optimized ATLAS on Ubuntu 12.04

  1. Download the latest ATLAS source from http://sourceforge.net/projects/math-atlas/files/. I'm using version 3.10.1
  2. Download the latest Netlib LAPACK from http://www.netlib.org/lapack/. I'm using version 3.4.2
  3. Turn off frequency scalings on your chip so that you can get reliable timings. This is essential to get a good ATLAS build
  sudo apt-get install cpufreq-info cpuspeed cpufrequtils sysfsutils
  # set each core to the "performance" governor, so that the clock frequency doesn't go down when idle
  # I have 8 cores, which is why I need to do this 8 times
  sudo cpufreq-selector -c 0 -g performance