This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a CMake toolchain file to configure CMake to use the ELDK 4.1 | |
# cross-compiler for the Embedded PowerPC MPC85xx family. | |
# | |
# Usage: cmake -DCMAKE_TOOLCHAIN_FILE=Toolchain-ELDK-4.1-ppc_85xx.cmake | |
# | |
# Reference: http://www.cmake.org/Wiki/CmakeEldk | |
# | |
SET(ELDKBASE $ENV{ELDKBASE}) | |
SET(ELDKROOT $ENV{ELDKROOT}) | |
SET(ELDKLOCAL $ENV{ELDKLOCAL}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a CMake toolchain file to configure CMake to use the ELDK 4.2 | |
# cross-compiler for the Embedded PowerPC MPC85xx family. This file | |
# assumes that the ELDK is installed to /opt/eldk-4.2. | |
# | |
# Usage: cmake -DCMAKE_TOOLCHAIN_FILE=Toolchain-ELDK-4.2-ppc_85xx.cmake | |
# | |
# Reference: http://www.cmake.org/Wiki/CmakeEldk | |
# | |
# The name of the target operating system. | |
SET(CMAKE_SYSTEM_NAME Linux) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find_package(PythonLibs) | |
if(PYTHONLIBS_FOUND) | |
include_directories(${PYTHON_INCLUDE_PATH}) | |
find_package(SWIG REQUIRED) | |
if(SWIG_FOUND) | |
include(${SWIG_USE_FILE}) | |
#set(CMAKE_SWIG_FLAGS "") | |
#set_source_files_properties(my_swig_file.i | |
# PROPERTIES SWIG_FLAGS "") | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Generate my_python_library_wrap.c and MyPythonLibrary.py | |
# | |
swig -python my_python_library.i | |
# | |
# Generate _MyPythonLibrary.so | |
# | |
gcc `python-config --cflags --ldflags` -I/path/to/my/c/library/headers -L/path/to/my/c/library -lmy_c_library my_python_library_wrap.c -fPIC -shared -o _MyPythonLibrary.so |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
GITCMD=status | |
if [[ -n $1 ]]; then | |
GITCMD=$1 | |
fi | |
echo | |
for dir in `ls`; do | |
(if [[ -d "$dir" && -d "$dir/.git" ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name .svn -exec rm -rf {} \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Helios-archlinux)[nfarring@thanos thrift]$ PY_PREFIX=$VIRTUAL_ENV PERL_PREFIX=$VIRTUAL_ENV ./configure --prefix=$VIRTUAL_ENV --without-java --without-ruby --without-php --without-php_extension --without-erlangchecking for a BSD-compatible install... /bin/install -c | |
checking whether build environment is sane... yes | |
checking for a thread-safe mkdir -p... /bin/mkdir -p | |
checking for gawk... gawk | |
checking whether make sets $(MAKE)... yes | |
checking for gcc... gcc | |
checking whether the C compiler works... yes | |
checking for C compiler default output file name... a.out | |
checking for suffix of executables... | |
checking whether we are cross compiling... no |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2011, Nathan Farrington | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# | |
# 1. Redistributions of source code must retain the above copyright | |
# notice, this list of conditions and the following disclaimer. | |
# | |
# 2. Redistributions in binary form must reproduce the above copyright |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functools | |
def typecheck(*args1,isclassmethod=False): | |
"""Python is a language with typed objects, but untyped references. This means that there is no compiler to help catch type errors at design time. This typecheck function acts as a function decorator so that you can declare the type of each function or method argument. At runtime, the types of these arguments will be checked against their declared types. | |
Example: | |
@typecheck(types.StringType, Decimal) | |
def my_function(s, d): | |
pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make sure we have the basics. | |
sudo apt-get install build-essential | |
# Install the build dependencies for Python. | |
# Replace with python2.7 if your distro supports it. | |
sudo apt-get build-dep python2.6 python-gdbm python-bsddb3 | |
# Use pythonbrew to actually compile Python. | |
curl -kL http://xrl.us/pythonbrewinstall | bash | |
pythonbrew install 2.7.2 |
OlderNewer