Skip to content

Instantly share code, notes, and snippets.

@SimeonEhrig
Created August 28, 2019 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SimeonEhrig/c322d50a206fca6d8f7c21c162339583 to your computer and use it in GitHub Desktop.
Save SimeonEhrig/c322d50a206fca6d8f7c21c162339583 to your computer and use it in GitHub Desktop.
Cheat Sheet for Singularity (and Docker) recipe

cheat sheet for different container snippets

cuda docker sources

Sometimes the PATH and LD_LIBRARY_PATH are not set correctly for the CUDA installation

	export PATH=$PATH:/usr/local/cuda/bin/
	export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib6

Ubuntu tags

  • Ubuntu 16.04
    • ubuntu:xenial
  • Ubuntu 18.04
    • ubuntu:bionic

install clang via apt

	wget http://llvm.org/apt/llvm-snapshot.gpg.key
	apt-key add llvm-snapshot.gpg.key
	rm llvm-snapshot.gpg.key

	echo "" >> /etc/apt/sources.list
	echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main" >> /etc/apt/sources.list
	echo "deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic main" >> /etc/apt/sources.list

	apt update
	apt install -y clang-5.0 llvm-5.0 clang-6.0 llvm-6.0 clang-7 llvm-7 clang-8 llvm-8 clang-9 llvm-9

install boost via apt

	add-apt-repository ppa:mhier/libboost-latest -y
	apt-get update
	apt-get install -y boost1.67

using spack

	%environment
		export PATH=/opt/spack/bin:$PATH

	%post
        cd /opt
        git clone https://github.com/spack/spack.git
        export PATH=/opt/spack/bin:$PATH

        spack compiler find
        spack bootstrap
        spack install

using pip and numba

	%environment
        export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-9.0/lib64
        export NUMBAPRO_NVVM=/usr/local/cuda-9.0/nvvm/lib64/libnvvm.so
        export NUMBAPRO_LIBDEVICE=/usr/local/cuda-9.0/nvvm/libdevice
        export NUMBAPRO_CUDA_DRIVER=/.singularity.d/libs/libcuda.so

	%post
        echo 'install additional software'
        apt update
        apt install -y nano python3 python3-pip
        python3 -m pip install virtualenv numba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment