Partially Attended

an irregularly updated blog by Ian Mulvany

Code Higlighting in Blogger

Wed Jan 21, 2009

138 Words



pbl-ian:python-c root# clear

pbl-ian:python-c root# swig -o erf_wrap.c -python erf.i
pbl-ian:python-c root# gcc -o erf_wrap.os -c -fPIC -I/usr/include/python2.5 erf_wrap.c
pbl-ian:python-c root# ls
erf.i erf.py erf_wrap.c erf_wrap.os
pbl-ian:python-c root# gcc -c erf_wrap.c -I/usr/include/python2.5 -I/usr/lib/python2.5
pbl-ian:python-c root# ls
erf.i erf.py erf_wrap.c erf_wrap.o erf_wrap.os
pbl-ian:python-c root# python
Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from erf import erf
Traceback (most recent call last):
File "", line 1, in
File "erf.py", line 7, in
import _erf
ImportError: No module named _erf
>>>
[3]+ Stopped(SIGTSTP) python
pbl-ian:python-c root# ld -bundle -flat_namespace -undefined suppress -o _erf.so erf_wrap.o
pbl-ian:python-c root# python
Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from erf import erf
>>>

This work is licensed under a Creative Commons Attribution 4.0 International License