Last change
on this file was
4236,
checked in by dubos, 5 years ago
|
simple_physics : some Python bindings
|
-
Property svn:executable set to
*
|
File size:
943 bytes
|
Rev | Line | |
---|
[4236] | 1 | #!/bin/bash |
---|
| 2 | |
---|
| 3 | function extract_header() |
---|
| 4 | { |
---|
| 5 | grep header tmp/cython | sed -E 's/.*cython.*header//g' | awk '{print " " $0}' |
---|
| 6 | } |
---|
| 7 | |
---|
| 8 | function extract_wrapper() |
---|
| 9 | { |
---|
| 10 | grep wrapper tmp/cython | sed -n -e 's/^.* wrapper //p' |
---|
| 11 | } |
---|
| 12 | |
---|
| 13 | |
---|
| 14 | # grep -v extern python/phyparam.hpxd > python/phyparam.h |
---|
| 15 | # cat python/phyparam.hpxd | tr ';' ' ' > python/phyparam.pxd |
---|
| 16 | # cd python ; rm -rf build *.c ; python setup.py build_ext --inplace |
---|
| 17 | |
---|
| 18 | #cat tmp/all_code | extract_header |
---|
| 19 | |
---|
| 20 | grep '!$cython' tmp/all_code > tmp/cython |
---|
| 21 | |
---|
| 22 | extract_header > python/phyparam.h |
---|
| 23 | |
---|
| 24 | cat <<EOF > python/phyparam.pxd |
---|
| 25 | cdef extern from "phyparam.h" : |
---|
| 26 | $(cat python/phyparam.h | tr -d ';') |
---|
| 27 | EOF |
---|
| 28 | |
---|
| 29 | cat <<EOF > python/phyparam.pyx |
---|
| 30 | # cython: language_level=3 |
---|
| 31 | |
---|
| 32 | cimport phyparam as phy |
---|
| 33 | |
---|
| 34 | #------------------------ wrappers extracted from Fortran --------------------------# |
---|
| 35 | |
---|
| 36 | $(extract_wrapper) |
---|
| 37 | |
---|
| 38 | #-------------------------- plugins from python/plugins.pyx -------------------------# |
---|
| 39 | |
---|
| 40 | $(cat python/plugins.pyx) |
---|
| 41 | EOF |
---|
Note: See
TracBrowser
for help on using the repository browser.