Skip to content

Running HPX on Rostam's Raspberry PIs

Steven R. Brandt edited this page May 28, 2020 · 2 revisions

First, build boost

export BVER=1.73.0
curl -LO https://dl.bintray.com/boostorg/release/${BVER}/source/boost_${BVER}.tar.bz2
tar xjf boost_${BVER}.tar.bz2
cd boost_${BVER}

# Boost will not figure out to use the gnu compiler on its own, you must help it.
export CC=/usr/bin/gcc
export CXX=/usr/bin/g++

# Pick where you want to install
./bootstrap.sh --prefix=/work/${USER}/pi4/boost cxxflags='-march=native -mcpu=native'
./b2
./b2 install

Next, build HPX. I use the following script. Note that generic coroutines must be used. These will not work without the specified cxxflags (which is the reason I used them in the boost build above).

#!/bin/bash
ROOT=/work/sbrandt
cd $ROOT
if [ -d hpx ]
then
  cd $ROOT/hpx
  git pull
else
  git clone --depth 1 https://github.com/STEllAR-GROUP/hpx.git
fi
rm -fr $ROOT/hpx_build
mkdir -p $ROOT/hpx_build
cd $ROOT/hpx_build
export CXX=/usr/bin/g++
export CC=/usr/bin/gcc
export BUILD_TYPE=Release
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
      -DBOOST_ROOT=/work/sbrandt/pi4/boost \
      -DHPX_WITH_PARCELPORT_MPI=ON \
      -DCMAKE_INSTALL_PREFIX=$ROOT/pi4/hpx \
      -DHPX_WITH_GENERIC_CONTEXT_COROUTINES=ON \
      -DHPX_WITH_MALLOC=system \
      -DHPX_WITH_EXAMPLES=ON \
      -DCMAKE_C_CCOMPIER=/usr/bin/gcc \
      -DCMAKE_CXX_CCOMPIER=/usr/bin/g++ \
      -DCMAKE_CXX_FLAGS="-march=native -mtune=native" \
      $ROOT/hpx
make install
Clone this wiki locally