File: USAGE.txt

package info (click to toggle)
pyrex 0.9.9-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 1,556 kB
  • ctags: 2,601
  • sloc: python: 12,966; ansic: 3,092; makefile: 106; sh: 20; lisp: 12
file content (69 lines) | stat: -rw-r--r-- 2,213 bytes parent folder | download | duplicates (6)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Pyrex - Usage Instructions
==========================

Building Pyrex extensions using distutils
-----------------------------------------

Pyrex comes with an experimental distutils extension for compiling
Pyrex modules, contributed by Graham Fawcett of the University of
Windsor (fawcett@uwindsor.ca).

The Demos directory contains a setup.py file demonstrating its use. To
compile the demos:

(1)  cd Demos

(2)  python setup.py build_ext --inplace

         or

     python setup.py build --build-lib=.

(You may get a screed of warnings from the C compiler, but you can
ignore these -- as long as there are no actual errors, things are
probably okay.)

Try out the extensions with:

     python run_primes.py
     python run_spam.py
     python run_numeric_demo.py


Building Pyrex extensions by hand
---------------------------------

You can also invoke the Pyrex compiler on its own to translate a .pyx
file to a .c file. On Unix,

     pyrexc filename.pyx

On other platforms,

     python pyrexc.py filename.pyx

It's then up to you to compile and link the .c file using whatever
procedure is appropriate for your platform. The file
Makefile.nodistutils in the Demos directory shows how to do this for
one particular Unix system.


Command line options
--------------------

The pyrexc command supports the following options:

  Short Long              Argument    Description
  -----------------------------------------------------------------------------
  -v    --version                     Display version number of pyrex compiler
  -l    --create-listing              Write error messages to a .lis file
  -I    --include-dir     <directory> Search for include files in named 
                                       directory (may be repeated)
  -o    --output-file     <filename>  Specify name of generated C file (only
                                       one source file allowed if this is used)

Anything else is taken as the name of a Pyrex source file and compiled
to a C source file. Multiple Pyrex source files can be specified
(unless -o is used), in which case each source file is treated as the
source of a distinct extension module and compiled separately to
produce its own C file.