File: docompile.py

package info (click to toggle)
openms 1.11.1-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 436,688 kB
  • ctags: 150,907
  • sloc: cpp: 387,126; xml: 71,547; python: 7,764; ansic: 2,626; php: 2,499; sql: 737; ruby: 342; sh: 325; makefile: 128
file content (34 lines) | stat: -rw-r--r-- 1,261 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Python script to compile Cython to C++
# 
# this script compiles the *.pyx infile (pyopenms/pyopenms.pyx) to .cpp
# 
# It can be run in the build process of pyopenms when manual changes to the pyx
# files need to be made (not recommended!).
# 
# == taken from autowrap/Main.py run(), lower part

infile  = "pyopenms/pyopenms.pyx"

import cPickle
persisted_data_path = "include_dir.bin"
autowrap_include_dirs = cPickle.load(open(persisted_data_path, "rb"))
# autowrap_include_dirs = ['/usr/local/lib/python2.7/dist-packages/autowrap/data_files/boost', '/usr/local/lib/python2.7/dist-packages/autowrap/data_files', '/path/to/pyOpenMS/pxds', 'from Map cimport Map as _Map']


from Cython.Compiler.Main import compile, CompilationOptions
from Cython.Compiler.Options import directive_defaults
directive_defaults["boundscheck"] = False
directive_defaults["wraparound"] = False

options = dict(include_path=autowrap_include_dirs,
               compiler_directives=directive_defaults,
               #output_dir=".",
               #gdb_debug=True,
               cplus=True)

print "Compiling with Cython the file", infile
print "Using include_path", autowrap_include_dirs
options = CompilationOptions(**options)
compile(infile, options=options)
print "Success!"