NUITKA(1)

NAME
nuitka - the Python compiler

SYNOPSIS
nuitka [--exe] [--execute] [options] main_module.py

OPTIONS

--version
    show program's version number and exit

-h, --help
    show this help message and exit

--exe
    Create a standalone executable instead of a compiled extension module. Default is off.

--python-version=PYTHON_VERSION
    Major version of Python to be used, one of '2.6', '2.7', or '3.2'.

--python-debug
    Use debug version or not. Default uses what you are using to run Nuitka, most likely a non-debug version.

--windows-target
    Force compilation for windows, useful for crosscompilation. Defaults to off.

--windows-disable-console
    When compiling for windows, disable the console window. Defaults to off.

--lto
    Use link time optimizations if available and usable (g++ 4.6 and higher). Defaults to off.

--clang
    Enforce the use of clang (clang 3.0 or higher). Defaults to off.

-j N, --jobs=N
    Specify the allowed number of parallel C++ compiler jobs. Defaults to the system CPU count.

--improved
    Allow minor devitations from CPython behaviour, e.g. better tracebacks, which are not really incompatible, but different.

--warn-implicit-exceptions
    Given warnings for implicit exceptions detected at compile time.

  Control the recursion into imported modules with '--exe' mode:

--recurse-stdlib
    Also descend into imported modules from standard library.

--recurse-none
    When --recurse-none is used, do not descend into any imported modules at all, overrides all other recursion options. Default False.

--recurse-all, --recurse-on
    When --recurse-all is used, attempt to descend into all imported modules. Default False.

--recurse-to=MODULE/PACKAGE
    Recurse to that module, or if a package, to the whole package. Can be given multiple times. Default empty.

--recurse-not-to=MODULE/PACKAGE
    Do not recurse to that module, or if a package, to the whole package in any case, overrides all other options. Can be given multiple times. Default empty.

--recurse-plugins=MODULE/PACKAGE, --recurse-directory=MODULE/PACKAGE
    Recurse into that directory, no matter if it's used by the given main program in a visible form. Overrides all other options. Can be given multiple times. Default empty.

  Immediate execution after compilation:

--execute
    Execute immediately the created binary (or import the compiled module). Default is off.

--execute-with-pythonpath, --keep-pythonpath
    When immediately executing the created binary (--execute), don't reset PYTHONPATH. When all modules are successfully included, you ought to not need PYTHONPATH anymore.

  Dump options for internal tree:

--dump-xml
    Dump the final result of optimization as XML, then exit.

--dump-tree
    Dump the final result of optimization as text, then exit.

--display-tree
    Display the final result of optimization in a GUI, then exit.

  Code generation choices:

--code-gen-no-statement-lines
    Statements shall have their line numbers set. Disable this for less precise exceptions and slightly faster code. Not recommended. Defaults to off.

--no-optimization
    Disable all unnecessary optimizations on Python level. Defaults to off.

  Output directory choices:

--output-dir=DIRECTORY
    Specify where intermediate and final output files should be put. DIRECTORY will be populated with C++ files, object files, etc. Defaults to current directory.

--remove-output
    Removes the build directory after producing the module or exe file. Default False.

  Debug features:

--debug
    Executing all self checks possible to find errors in Nuitka, do not use for production. Defaults to off.

--unstripped, --no-strip, --unstriped
    Keep debug info in the resulting object file for better gdb interaction. Defaults to off.

--trace-execution
    Traced execution output, output the line of code before executing it. Defaults to off.

--c++-only
    Compile the would-be regenerated source file. Allows compiling edited C++ files with the C++ compiler for quick debugging changes to the generated source. Defaults to off.

--experimental
    Use features declared as 'experimental'. May have no effect if no experimental features are present in the code. Defaults to off.

  Tracing features:

--show-scons
    Operate Scons in non-quiet mode, showing the executed commands. Defaults to off.

--show-progress
    Provide progress information and statistics. Defaults to off.

--verbose
    Output details of actions take, esp. in optimizations. Can become a lot.

EXAMPLES
Compile a python file "some_module.py" to a module "some_module.so":

    $ nuitka some_module.py

Compile a python program "some_program.py" to an executable "some_program.exe":

    $ nuitka --exe some_program.py

Compile a python program "some_program.py" and the package "some_package" it uses to an executable "some_program.exe":

    $ nuitka --exe --recurse-to=some_package some_program.py

Compile a python program "some_program.py" and all the modules it uses to an executable "some_program.exe". Then execute it immediately when ready:

    $ nuitka --exe --execute --recurse-all some_program.py

Compile a python program "some_program.py" and the modules it uses (even standard library) to an executable "some_program.exe":

    $ nuitka --recurse-all --recurse-stdlib some_program.py --exe

Compile a python program "some_program.py" and the modules it uses to an executable "some_program.exe". Keep the debug information, so valrind, gdb, etc. work nice. Note: This will *not* degrade performance:

    $ nuitka --unstriped --recurse-all some_program.py --exe

Compile a python program "some_program.py" and the modules it uses to an executable "some_program.exe". Perform all kinds of checks about correctness of the generated C++ and run-time checks. Note: This will degrade performance and should only be used to debug Nuitka:

    $ nuitka --debug --recurse-all some_program.py --exe

Compile a python program "some_program.py" and the modules it uses to an executable "some_program.exe". Perform all kinds of checks about correctness of the generated C++ and run-time checks. Also use the debug Python library, which does its own checks. Note: This will degrade performance and should only be used to debug Nuitka:

    $ nuitka --debug --python-debug --recurse-all some_program.py --exe

Compile a python program "some_program.py" and the plugins modules it loads at run time to an executable "some_program.exe":

    $ nuitka --recurse-all --recurse-directory=plugins_dir some_program.py --exe