Skip to content

Instantly share code, notes, and snippets.

View erikzenker's full-sized avatar
🤖
lost in the tunnel

Erik Zenker erikzenker

🤖
lost in the tunnel
View GitHub Profile
@erikzenker
erikzenker / metis.cc
Created March 10, 2015 14:49
Metis usage example
#include <cstddef> /* NULL */
#include <metis.h>
#include <iostream>
// Install metis from:
// http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz
// Build with
// g++ metis.cc -lmetis
#include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>
template<typename T>
struct Scan {
T value;
@erikzenker
erikzenker / CMakeLists.txt
Last active April 15, 2024 17:17
CMake CUDA + C++ in separate files
# CMAKE FILE to separatly compile cuda and c++ files
# with the c++11 standard
#
#
# Folder structure:
#
# |
# +--main.cpp (with C++11 content)
# +--include/
# | |
#include <iostream> /* std::cout, std::endl */
#include <type_traits> /* std::enable_if */
// SFINAE test
template <typename T>
class has_extendedFoo {
typedef char one;
typedef long two;
./bootstrap --prefix=$HOME
./b2 link=shared runtime-link=shared threading=multi,single variant=release debug-symbols=on toolset=gcc -a -q -j3 --layout=versioned architecture=power host-os=linux stage
./b2 link=shared runtime-link=shared threading=multi,single variant=release debug-symbols=on toolset=gcc -q -j3 --layout=versioned architecture=power host-os=linux install
# --without-iostreams
# for xlc: toolset=vacpp
#!/usr/bin/env sh
git clone https://github.com/psychocoderHPC/picongpu-alpaka.git
cd picongpu-alpaka
git checkout topic-cupla
cd ..
git clone https://github.com/psychocoderHPC/alpaka.git
cd alpaka
git checkout topic-picongpu-alpaka
@erikzenker
erikzenker / Build for xeon phi on taurus
Last active May 20, 2016 13:30
Build for xeon phi on taurus
#! /usr/bin/env sh
# Intel tutorial: https://software.intel.com/en-us/articles/building-a-native-application-for-intel-xeon-phi-coprocessors
# Load modules
module load intel/2016.2.181
module load cmake/3.3.1
module load boost/1.60.0-intel2016.2.181-intelmpi5.1-knc
module load gcc/4.9.3 # gives hints to icc where to find libstdc++
# Load some magic numbers
#!/usr/bin/env sh
# Create paths
cd ~
mkdir projects
cd projects
# Load modules
module purge
module load gcc/4.9.2
#! /usr/bin/env sh
# Init paths
cd ~
mkdir -p projects
cd projects
# Load modules
module load git
module load intel/2016.2.181
@erikzenker
erikzenker / nix-profile.sh
Created April 14, 2017 13:54 — forked from benley/nix-profile.sh
tweaked nix login script
# Heavily cribbed from the equivalent NixOS login script.
# This should work better with multi-user nix setups.
export NIXPKGS_CONFIG="/etc/nix/nixpkgs-config.nix"
export NIX_OTHER_STORES="/run/nix/remote-stores/*/nix"
export NIX_USER_PROFILE_DIR="/nix/var/nix/profiles/per-user/$USER"
export NIX_PROFILES="/nix/var/nix/profiles/default $HOME/.nix-profile"
export NIX_PATH="/nix/var/nix/profiles/per-user/root/channels"
export PATH="$HOME/.nix-profile/bin:$HOME/.nix-profile/sbin:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:$PATH"