Skip to content
Snippets Groups Projects

Remove Inline Output Mode; Automate Inlining in Composer

Merged Frederik Hennig requested to merge fhennig/clean-inlining into master
All threads resolved!
Viewing commit ec46da10
Show latest version
1 file
+ 17
5
Preferences
Compare changes
@@ -42,14 +42,15 @@ The file extensions of the generated files can be modified through
@@ -42,14 +42,15 @@ The file extensions of the generated files can be modified through
{any}`cfg.extensions.header <FileExtensions.header>`
{any}`cfg.extensions.header <FileExtensions.header>`
and {any}`cfg.extensions.impl <FileExtensions.impl>`;
and {any}`cfg.extensions.impl <FileExtensions.impl>`;
and the output directory of the code generator can be set through {any}`cfg.output_directory <SfgConfig.output_directory>`.
and the output directory of the code generator can be set through {any}`cfg.output_directory <SfgConfig.output_directory>`.
Header-only code generation can be enabled using {any}`cfg.header_only <SfgConfig.header_only>`.
The [header-only mode](#header_only_mode) can be enabled using {any}`cfg.header_only <SfgConfig.header_only>`.
:::{danger}
:::{danger}
When running generator scripts through [CMake](#cmake_integration), you should *never* set the file extensions
When running generator scripts through [CMake](#cmake_integration), the file extensions,
and the output directory in the inline configuration.
output directory, and header-only mode settings will be managed fully by the pystencils-sfg
Both are managed by the pystencils-sfg CMake module, and setting them manually inside the script will
CMake module and the (optional) project configuration module.
lead to an error.
They should therefore not be set in the inline configuration,
 
as this will likely lead to errors being raised during code generation.
:::
:::
### Outer Namespace
### Outer Namespace
@@ -89,6 +90,17 @@ with the `--help` flag:
@@ -89,6 +90,17 @@ with the `--help` flag:
$ python kernels.py --help
$ python kernels.py --help
```
```
 
(header_only_mode)=
 
## Header-Only Mode
 
 
When the header-only output mode is enabled,
 
the code generator will emit only a header file and no separate implementation file.
 
In this case, the composer will automatically place all function, method,
 
and kernel definitions in the header file.
 
 
Header-only code generation can be enabled by setting the `--header-only` command-line flag
 
or the {any}`SfgConfig.header_only` configuration option.
 
(custom_cli_args)=
(custom_cli_args)=
## Adding Custom Command-Line Options
## Adding Custom Command-Line Options