root / Pi / C / SWIG / Build.sh
Historique | Voir | Annoter | Télécharger (523 octet)
| 1 |
#!/bin/bash |
|---|---|
| 2 |
# Delete files created by Swig compilation process |
| 3 |
rm _MonteCarlo.so MonteCarlo_wrap.o MonteCarlo_wrap.c MonteCarlo.py MonteCarlo.pyc MCmodule.o |
| 4 |
# MonteCarlo.i holds prototype (like .h) of InsideCircle function |
| 5 |
# Swig creates MonteCarlo_wrap.c and MonteCarlo.py |
| 6 |
swig -python MonteCarlo.i |
| 7 |
# Compilation of MCmodule.c as wrapper |
| 8 |
gcc -O3 -fpic -c MonteCarlo_wrap.c MCmodule.c -I/usr/include/python2.7/ |
| 9 |
# Link to create library |
| 10 |
gcc -O3 -shared MCmodule.o MonteCarlo_wrap.o -o _MonteCarlo.so |
| 11 |
# Execution |
| 12 |
python MC.py |