Created
July 25, 2020 09:40
-
-
Save yoshipon/6597607d71c67fe47e3f65c7d4298499 to your computer and use it in GitHub Desktop.
A singularity recipe for NumPy w/ AOCL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Download `aocl-linux-gcc-2.2.0_1_amd64.deb` into the same directory as this config file. | |
# 2. Build the container with `sudo singularity build numpy-aocl.img numpy-aocl.conf`. | |
# 3. Run ipython with `OMP_NUM_THREADS=64 singularity exec numpy-aocl.img ipython`. | |
Bootstrap: docker | |
From: continuumio/anaconda3 | |
%files | |
aocl-linux-gcc-2.2.0_1_amd64.deb /tmp | |
%environment | |
PATH=/opt/conda/bin:$PATH | |
export PATH | |
%post | |
PATH=/opt/conda/bin:$PATH | |
export PATH | |
apt update --fix-missing | |
apt install -y build-essential | |
# install AOCL | |
apt install -y /tmp/aocl-linux-gcc-2.2.0_1_amd64.deb | |
# install NumPy | |
cd /opt | |
git clone https://github.com/numpy/numpy.git | |
cd ./numpy | |
cat <<EOL >> site.cfg | |
[blis] | |
libraries = blis-mt | |
library_dirs = /opt/AMD/aocl/aocl-linux-gcc-2.2.0/lib | |
include_dirs = /opt/AMD/aocl/aocl-linux-gcc-2.2.0/include | |
runtime_library_dirs = /opt/AMD/aocl/aocl-linux-gcc-2.2.0/lib | |
[flame] | |
libraries = flame | |
library_dirs = /opt/AMD/aocl/aocl-linux-gcc-2.2.0/lib | |
runtime_library_dirs = /opt/AMD/aocl/aocl-linux-gcc-2.2.0/lib | |
EOL | |
NPY_BLAS_ORDER=blis NPY_LAPACK_ORDER=flame pip install . | |
# clean up | |
apt clean | |
%runscript | |
ipython |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment