Skip to content

Instantly share code, notes, and snippets.

{ nixpkgs ? import (import /home/doc/git/allvm-tools/nix/fetch-nixpkgs.nix) { }
}:
let
overlay = self: super: {
stdenv = super.overrideCC (nixpkgs.stdenv) (with nixpkgs;
wrapCCWith {
cc = wllvm;
extraBuildCommands = ''
echo CC=wllvm >> $out/nix-support/setup-hook
diff --git a/src/Makevars b/src/Makevars
index 076a2eb..897c911 100644
--- a/src/Makevars
+++ b/src/Makevars
@@ -2,7 +2,7 @@ CXX_STD = CXX11
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
strip: $(SHLIB)
- if test -e "/usr/bin/strip" & test -e "/bin/uname" & [[ `uname` == "Linux" ]] ; then /usr/bin/strip --strip-debug *.o *.so; fi
- if test -e "/usr/bin/strip" & test -e "/usr/bin/uname" & [[ `uname` == "Darwin" ]] ; then /usr/bin/strip -S *.o *.so; fi
@jbedo
jbedo / default.nix
Created August 5, 2018 22:51
Test singularity image
{pkgs ? import <nixpkgs> {} }:
with pkgs;
singularity-tools.buildImage {
name = "test";
contents = [ hello ];
runScript = "${hello}/bin/hello";
}

Keybase proof

I hereby claim:

  • I am jbedo on github.
  • I am bedo (https://keybase.io/bedo) on keybase.
  • I have a public key ASC10zE0v4pqpi-2wOEUxoUD0JE8ZUZVfGd_ReS7-iWBjQo

To claim this, I am signing this object:

@jbedo
jbedo / twister.nix
Created January 15, 2014 06:44
Nix expression for twister (including twister-html). To run twister, install the expression, execute "twisterd -daemon", then go to http://127.0.0.1:28332/index.html.
{ stdenv, fetchgit, boost, openssl, db48, miniupnpc, autoconf, automake, libtool, pkgconfig, zlib, makeWrapper }:
stdenv.mkDerivation rec {
name = "twister-git";
src = fetchgit {
url = "https://github.com/miguelfreitas/twister-core";
};
html = fetchgit {
module Main where
import Data.Array.Accelerate as A
import Data.Array.Accelerate.Interpreter as I
import Data.Array.Accelerate.CUDA as C
import Prelude as P
type EFloat = (Float, Float) -- Represents a real number with a value and error
fromFloat :: Float -> EFloat
@jbedo
jbedo / categories
Last active December 17, 2015 08:39
List of PLOS One categories
100.10.100.10.10: Biological fluid mechanics
100.10.100.10.20: Bone and joint mechanics
100.10.100.10.30: Cell mechanics
100.10.100.10: Biomechanics
100.10.100.20: Bone
100.10.100.30: Cartilage
100.10.100.40: Exertion
100.10.100.50: Hand strength
100.10.100.60.10: Muscle biochemistry
100.10.100.60.20: Muscle components
@jbedo
jbedo / fmt.awk
Created May 13, 2013 06:53
LaTeX code beautifier. Wraps text chunks at 70c, indents between begin/end, and puts a hard line break after every sentence. Does not wrap math.
#!/usr/bin/awk -f
BEGIN{
linelen=70
indent=0
braces=0
FS="\\.[\t ]+"
}
/\\end\{/{indent--}
@jbedo
jbedo / sha256sum
Created May 8, 2013 23:24
Simple wrapper for FreeBSD around sha256 to provide more standard output formatting.
#!/bin/sh
sha256 $* | awk '{match($0, /\(.*\)/);
path = substr($0, RSTART+1, RLENGTH-2)
print $NF, path}'
@jbedo
jbedo / gist:4107982
Created November 18, 2012 22:59
Like fmt(1) but intended for TeX. Terminates sentences with newline.
#!/usr/bin/env rc
. 9.rc
f=/tmp/fmt.$pid
fmt -l9999 | sed -e 's/([;\.])[ ]+/\1\n/g' > $f
cat $f | while(line=`{read}){
if(! ~ $line "" )