Skip to content

Instantly share code, notes, and snippets.

@amadio
Created March 4, 2015 23:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amadio/25f788949f5202ee2c6c to your computer and use it in GitHub Desktop.
Save amadio/25f788949f5202ee2c6c to your computer and use it in GitHub Desktop.
Simple script to cross-compile stuff for the Xeon Phi in a prefix
#!/bin/bash
MICDIR=${HOME}/mic
# must copy MIC libs to ${MICDIR}/opt/intel/lib
LIBFLAGS="-L${MICDIR}/opt/intel/lib -L${MICDIR}/usr/lib"
FEATURES='-news -binchecks' ROOT=/ EPREFIX=${MICDIR} \
CC=icc CXX=icpc MPI_C=mpiicc MPI_CXX=mpiicpc LD=xild AR=xiar \
CPPFLAGS="-I${MICDIR}/usr/include" \
CFLAGS="-mmic -fPIC -I${MICDIR}/usr/include" \
CXXFLAGS="-mmic -fPIC -I${MICDIR}/usr/include" \
FFLAGS="-mmic -fPIC -I${MICDIR}/usr/include" \
LDFLAGS="${LIBFLAGS} -Wl,--rpath,${MICDIR}/opt/intel/lib -Wl,--rpath,${MICDIR}/usr/lib" \
CBUILD=x86_64-pc-linux-gnu \
CHOST=x86_64-k1om-linux-gnu \
CTARGET=x86_64-k1om-linux-gnu emerge $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment