diff --git a/SConstruct b/SConstruct index 7d910dd10..c8c8ede28 100644 --- a/SConstruct +++ b/SConstruct @@ -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 diff --git a/include/cantera/clib_experimental/.gitignore b/include/cantera/clib_experimental/.gitignore new file mode 100644 index 000000000..424c745c1 --- /dev/null +++ b/include/cantera/clib_experimental/.gitignore @@ -0,0 +1 @@ +*.h diff --git a/include/cantera/clib_experimental/README.md b/include/cantera/clib_experimental/README.md new file mode 100644 index 000000000..17b4e3014 --- /dev/null +++ b/include/cantera/clib_experimental/README.md @@ -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. diff --git a/src/SConscript b/src/SConscript index 004180aac..d958e0a51 100644 --- a/src/SConscript +++ b/src/SConscript @@ -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('.')]) diff --git a/src/clib_experimental/.gitignore b/src/clib_experimental/.gitignore new file mode 100644 index 000000000..ce1da4c53 --- /dev/null +++ b/src/clib_experimental/.gitignore @@ -0,0 +1 @@ +*.cpp