Statistiques
| Révision :

root / Pi / C / SWIG / Build.sh @ 65

Historique | Voir | Annoter | Télécharger (523 octet)

1 7 equemene
#!/bin/bash
2 7 equemene
# Delete files created by Swig compilation process
3 7 equemene
rm _MonteCarlo.so MonteCarlo_wrap.o MonteCarlo_wrap.c MonteCarlo.py MonteCarlo.pyc MCmodule.o
4 7 equemene
# MonteCarlo.i holds prototype (like .h) of InsideCircle function
5 7 equemene
# Swig creates MonteCarlo_wrap.c and MonteCarlo.py
6 7 equemene
swig -python MonteCarlo.i
7 7 equemene
# Compilation of MCmodule.c as wrapper
8 7 equemene
gcc -O3 -fpic -c MonteCarlo_wrap.c MCmodule.c -I/usr/include/python2.7/
9 7 equemene
# Link to create library
10 7 equemene
gcc -O3 -shared MCmodule.o MonteCarlo_wrap.o -o _MonteCarlo.so
11 7 equemene
# Execution
12 7 equemene
python MC.py