Skip to content

Instantly share code, notes, and snippets.

// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8; -*-
//
// Simple example showing how expose a C++ function
//
// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
#include <RInside.h> // for the embedded R via RInside
// a c++ function we wish to expose to R
const char* hello( std::string who ){
## -*- mode: make; tab-width: 8; -*-
##
## Simple Makefile
##
## From RInside examples
## TODO:
## proper configure for non-Debian file locations, [ Done ]
## allow RHOME to be set for non-default R etc
## comment this out if you need a different version of R,
# unregister broken GHC packages. Run this a few times to resolve
# dependency rot in installed packages. ghc-pkg-clean -f
# cabal/dev/packages*.conf also works.
function ghc-pkg-clean() {
for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'`
do
echo unregistering $p; ghc-pkg $* unregister $p
done
}
#!/bin/bash
# source: http://www.haskell.org/pipermail/haskell-cafe/2011-March/090170.html
sudo rm -rf /Library/Frameworks/GHC.framework
sudo rm -rf /Library/Frameworks/HaskellPlatform.framework
sudo rm -rf /Library/Haskell
rm -rf .cabal
rm -rf .ghc
rm -rf ~/Library/Haskell
@npezolano
npezolano / build_gcc_4.7.2_on_mac.sh
Last active October 13, 2015 16:17 — forked from doubleotoo/build_gcc_4.7_on_mac.sh
Script to download and build gcc 4.7 and its dependencies on mac - it took about 40 minutes on my machine (and the "make check" in the gcc build failed for lack of an "autogen" script"), but the compiler seems to work.
#!/bin/sh
# warning may need updating
# You might want to modify the first line to specify your own install location.
# In theory the rest should not need tweaking...
export GCC_PREFIX="$HOME/gcc4.7"
# Hopefully, you can tweak these as they get out of date, but the download URL's
# may not be stable to text substitution.
GMP_DOWNLOAD_VERSION=gmp-5.0.5
MPFR_DOWNLOAD_VERSION=mpfr-3.1.1