[Ann] Reading Survex *.3d files with dynamic languages
David A. Riggs
david.a.riggs at gmail.com
Tue Sep 11 05:24:27 BST 2007
On 2007/06/06, Martin at ee.ethz.ch wrote:
>
> This might be of interest to those who want to use survey data
> produced by Survex in other programs. I created, with the help of
> SWIG, a simple wrapper around "img.c" which does all the hard work
> reading the cryptic *.3d files.
>
> <snip>
>
> You will need Python, SWIG and a C-Compiler (GCC). The code is at
> http://people.ee.ethz.ch/~luthi/soft/survex-swig.tar.gz
>
This is excellent, your "survey" API is much friendlier than the
straight SWIG-generated wrapper around img.h. I had to specify the
location of my Python header files to compile (Ubuntu Feisty), and
have attached a Makefile to build the Python module.
- Dave Riggs
---- Makefile ----
# Makefile for survex Python module
# Location of Python header files
PYINCLUDE=/usr/include/python2.5/
.PHONY: all python
all: python
python: _survex.so
survex_wrap.c: survex.i
swig -python survex.i
survex.py: survex_wrap.c
img.o: img.c img.h
gcc -c -fPIC img.c
survex_wrap.o: survex_wrap.c
gcc -c -fPIC survex_wrap.c -I$(PYINCLUDE)
_survex.so: img.o survex_wrap.o
gcc -shared img.o survex_wrap.o -o _survex.so
clean:
rm -f *.o *.so *.pyc survex_wrap.c survex.py
---- end Makefile ----
--
David A. Riggs <david.a.riggs at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 481 bytes
Desc: not available
Url : http://lists.tartarus.org/pipermail/survex/attachments/20070911/c2c9ead1/Makefile.obj
More information about the Survex
mailing list