Skip to content

Instantly share code, notes, and snippets.

@spott
spott / infix_operator.cpp
Created June 7, 2012 17:24 — forked from dscharrer/infix_operator.cpp
The proper way to call std::swap
#include <type_traits>
namespace detail {
// No need to give up constexpr for std::forward
template <class T>
constexpr T && forward(typename std::remove_reference<T>::type & t) noexcept {
return static_cast<T &&>(t);
}
@spott
spott / gist:2976226
Created June 23, 2012 02:00 — forked from albeva/gist:2975962
C++11 variadic template based tuple sort
#include <iostream>
#include <utility>
#include <tuple>
using namespace std;
//
// forward declare
//
template<int N1, int N2, int LAST, typename T>
@spott
spott / gist:3101432
Created July 12, 2012 22:11
Errors from julia
==> Installing julia
==> Cloning https://github.com/JuliaLang/julia.git
Updating /Library/Caches/Homebrew/julia--git
Submodule 'deps/libuv' () registered for path 'deps/libuv'
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> make -C contrib -f repackage_system_suitesparse.make PREFIX=/usr/local/Cellar/julia/HEAD USECLANG=1 USE_SYSTEM_READLINE=1 USE_SYSTE
==> make PREFIX=/usr/local/Cellar/julia/HEAD USECLANG=1 USE_SYSTEM_READLINE=1 USE_SYSTEM_GLPK=1 USE_SYSTEM_GMP=1 USE_SYSTEM_LLVM=1 USE_
SuiteSparse_wrapper.c:104:68: error: use of undeclared identifier 'SuiteSparse_long'
@spott
spott / gist:3107461
Created July 13, 2012 21:08
further errors from julia install
==> Installing julia
==> Cloning https://github.com/staticfloat/julia.git
Updating /Library/Caches/Homebrew/julia--git
git config remote.origin.url https://github.com/staticfloat/julia.git
git config remote.origin.fetch +refs/heads/master:refs/remotes/origin/master
git fetch origin
git reset --hard origin/HEAD
HEAD is now at 0a4a10f Upgrade repackage suitesparse for version 4.0.0
git checkout-index -a -f --prefix=/private/tmp/homebrew-julia-HEAD-emUq/
git submodule init
@spott
spott / gist:3107999
Created July 13, 2012 22:35
julia errors 3
[spott@Galactica /Users/spott]$ brew install julia --HEAD -v
==> Installing julia
==> Cloning https://github.com/JuliaLang/julia.git
Updating /Library/Caches/Homebrew/julia--git
git config remote.origin.url https://github.com/JuliaLang/julia.git
git config remote.origin.fetch +refs/heads/master:refs/remotes/origin/master
git fetch origin
git reset --hard origin/HEAD
HEAD is now at 8e7f38f include SuiteSparse lib wrapper dependancies when linking. closes #1051
git checkout-index -a -f --prefix=/private/tmp/homebrew-julia-HEAD-e7kC/
@spott
spott / gist:3123677
Created July 16, 2012 16:40
brew --config
HOMEBREW_VERSION: 0.9.2
HEAD: 03744647cc9271abc8c2cb368702fc328ee9a0ec
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit dunno
OS X: 10.7.4-x86_64
Xcode: 4.3.3
CLT: 4.3.0.0.1.1249367152
GCC-4.0: N/A
GCC-4.2: N/A
@spott
spott / gist:3694095
Created September 10, 2012 21:40
openblas problems
/usr/bin/make -j 8 -C exports dyn
make[1]: warning: -jN forced in submake: disabling jobserver mode.
perl ./gensymbol osx x86_64 _ 1 0 0 0 > osx.def
cc -O2 -DEXPRECISION -m128bit-long-double -Wall -m64 -DF_INTERFACE_GFORT -fPIC -DSMP_SERVER -DMAX_CPU_NUMBER=8 -DASMNAME=_ -DASMFNAME=__ -DNAME=_ -DCNAME= -DCHAR_NAME=\"_\" -DCHAR_CNAME=\"\" -DNO_AFFINITY -I.. -all_load -headerpad_max_install_names -install_name /private/tmp/brew-openblas-0.2.3-LYWH/xianyi-OpenBLAS-e552452/exports/../libopenblas_sandybridgep-r0.2.3.dylib -dynamiclib -o ../libopenblas_sandybridgep-r0.2.3.dylib ../libopenblas_sandybridgep-r0.2.3.a -Wl,-exported_symbols_list,osx.def -L/usr/local/Cellar/gfortran/4.2.4-5666.3/bin/../lib/gcc/i686-apple-darwin11/4.2.1/x86_64 -L/usr/local/Cellar/gfortran/4.2.4-5666.3/bin/../lib/gcc/i686-apple-darwin11/4.2.1 -L/usr/local/Cellar/gfortran/4.2.4-5666.3/bin/../lib/gcc -L/usr/local/Cellar/gfortran/4.2.4-5666.3/bin/../lib/gcc/i686-apple-darwin11/4.2.1/../../.. -lgfortran -lgfortran -lSystem -lSystem
Unde
#####
#
# Dynamic Makefile for C++11 Projects.
# Recursively builds all files in a project and its test suite.
#
# Standard build targets are:
# - (none): all
# - all: testing
# - primary: build primary targets
# - testing: build testing targets
@spott
spott / brew doctor
Created September 24, 2013 23:48
homebrew install didn't work.
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
petsc
python32
slepc
@spott
spott / brew --config
Last active December 23, 2015 20:59
brew errors when brewing boost
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/mxcl/homebrew
HEAD: f2f1cb286ebdee909d4b19d31558d563e848f414
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit ivybridge
OS X: 10.8.5-x86_64
Xcode: 5.0
CLT: 5.0.0.0.1.1377666378
LLVM-GCC: build 2336