OpenMC on Android

Running OpenMC on Android. Just for fun.

2 Likes

Installing OpenMC with now python support :smiley:

1 Like

Installing OpenMC on your Android phone takes a series of few easy steps.

Step-1: Set up your phone

  1. Download and Install the latest version of Termux from F-Droid
  2. After opening the application, type the following commands to upgrade existing packages.
pkg update && pkg upgrade -y
  1. Now install proot-distro.
pkg install proot-distro -y
  1. Install Ubuntu and launch the shell:
proot-distro install ubuntu -y
proot-distro login ubuntu

Note: You can use other Linux distributions. Here are the supported distributions:

  • Alpine Linux (edge)
  • Arch Linux / Arch Linux 32 / Arch Linux ARM
  • Debian (stable)
  • Fedora 35
  • Manjaro AArch64
  • OpenSUSE (Tumbleweed)
  • Ubuntu (21.10)
  • Void Linux

Step-2: Install OpenMC

  1. Installing prerequisites
apt-get update && apt-get upgrade -y
apt-get install build-essential cmake g++ git libhdf5-dev libpng-dev make python3-dev python-is-python3 python3-pip wget -y
pip install numpy cython scipy
  1. Install openmc
git clone --recurse-submodules https://github.com/openmc-dev/openmc.git && mkdir openmc_install
mkdir -p openmc/build && cd openmc/build && cmake -DCMAKE_INSTALL_PREFIX=/root/openmc_install ../
make -j${nproc --all} install
echo 'export PATH=/root/openmc_install/bin:$PATH' >> /root/.bashrc && source /root/.bashrc
cd ../ && pip install .
  1. Download data library
wget -q -O - https://anl.box.com/shared/static/teaup95cqv8s9nn56hfn7ku8mmelr95p.xz | tar -C /root -xJ
echo 'export OPENMC_CROSS_SECTIONS=/root/nndc_hdf5/cross_sections.xml' >> /root/.bashrc && source /root/.bashrc

voilà!

This made me grin. If I’m ever on the go and have an emergent bug to fix I’ll try to remember this :smile: