Skip to content

Instantly share code, notes, and snippets.


Simeon Ehrig SimeonEhrig

  • Dresden
View GitHub Profile
SimeonEhrig /
Last active Jun 24, 2020
Integrate Spack modules in conda environment.


Automatic loading of Spack modules when the Conda environment is loaded.

Helper function

Spack and Conda can influence each other with side effects. Therefore I do not activate them by default. The following functions allow you to activate Conda and Spack by bash command.

# for example, add to .bashrc
SimeonEhrig /
Created Dec 18, 2019
Note, which nvidia docker image use which gcc version
image name GCC version
nvidia/cuda:8.0-devel-ubuntu16.04 5.4.0 20160609
nvidia/cuda:9.0-devel-ubuntu16.04 5.4.0 20160609
nvidia/cuda:9.1-devel-ubuntu16.04 5.4.0 20160609
nvidia/cuda:9.2-devel-ubuntu16.04 5.4.0 20160609
nvidia/cuda:10.0-devel-ubuntu18.04 7.4.0
nvidia/cuda:10.1-devel-ubuntu18.04 7.4.0
nvidia/cuda:10.2-devel-ubuntu18.04 7.4.0
SimeonEhrig /
Created Aug 28, 2019
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
SimeonEhrig /
Last active Aug 28, 2019
wrapper script for cd (change directory) to simplify the cd ../../../.. statement
# wrapper for the cd command
# it expands sequence .... to ../../../../ (each dot becomes a ../ )
# example: ' cd .... ' -> ' cd ../../../../ '
# if the command does not match ' cd ..[.]+ ' , it is passed directly to the cd command
# alias cd=". /path/to/"
if [[ $# != 1 ]]; then
SimeonEhrig / cling_get_module.cpp
Last active Oct 7, 2019
C++ code to view LLVM IR code of a statement in cling
View cling_get_module.cpp
#include "cling/Interpreter/Interpreter.h"
#include "cling/Interpreter/Transaction.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/raw_ostream.h"
auto T1 = gCling->getLatestTransaction();
// command
T1->getNext()->getModule()->print(llvm::outs(), nullptr);
SimeonEhrig /
Last active Aug 28, 2019
Use stdin as input for the clang.
echo "int foo() { return 3;}" | clang++ -cc1 -
SimeonEhrig /
Last active Nov 13, 2019
Get arguments of a cling interpreter instance with reflection

To get the arguments of cling, which are passed on start, you can use the reflection feature of cling.

#include "cling/Interpreter/Interpreter.h"
#include "cling/Interpreter/InvocationOptions.h"

// gCling is an object of type cling::Interpreter
std::vector<const char*> remaining = gCling->getOptions().CompilerOpts.Remaining;