[SCons] Enable clib_experimental flag

Also, add README.md for clib_experimental interface
This commit is contained in:
Ingmar Schoegl 2025-01-01 22:12:45 -07:00 committed by Ray Speth
parent e647b9de63
commit 2a432397f4
5 changed files with 40 additions and 0 deletions

View File

@ -134,6 +134,10 @@ if "clean" in COMMAND_LINE_TARGETS:
remove_file(name)
for name in Path("site_scons").glob("**/*.pyc"):
remove_file(name)
for name in Path("include/cantera/clib_experimental").glob("*.h"):
remove_file(name)
for name in Path("src/clib_experimental").glob("*.cpp"):
remove_file(name)
logger.status("Done removing output files.", print_level=False)
@ -364,6 +368,13 @@ config_options = [
"sphinx_docs",
"Build HTML documentation for Cantera using Sphinx.",
False),
BoolOption(
"clib_experimental",
"""Build experimental CLib. Requires running 'scons doxygen' and CLib code
generation via 'python3 interfaces/sourcegen/run.py --api=clib --output=.'
prior to 'scons build' command.
""",
False),
BoolOption(
"run_examples",
"""Run examples to generate plots and outputs for Sphinx Gallery. Disable to

View File

@ -0,0 +1 @@
*.h

View File

@ -0,0 +1,25 @@
# Cantera Experimental CLib Interface
This directory and the associated `src/clib_experimental` folder contain an
experimental re-implementation of Cantera's traditional CLib interface.
## Code Generation
Run the following command from the Cantera root folder:
```
scons doxygen
python3 interfaces/sourcegen/run.py --api=clib --output=.
scons build clib_experimental=y
```
A rudimentary test suite ensures that code performs as expected:
```
scons test-clib-experimental
```
## Status
The experimental CLib Interface is in preview and still missing many features
needed for parity with the traditional CLib interface.

View File

@ -39,6 +39,8 @@ libs = [('base', ['cpp'], baseSetup),
('zeroD', ['cpp'], defaultSetup),
('clib', ['cpp'], defaultSetup),
]
if env['clib_experimental']:
libs.append(('clib_experimental', ['cpp'], defaultSetup))
localenv = env.Clone()
localenv.Prepend(CPPPATH=[Dir('#include'), Dir('.')])

1
src/clib_experimental/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.cpp