Hi,
my name is David Schmider and I'm a PhD student at University of Applied Sciences in Offenburg. Currently I'm working on an extension of the BinarySolutionTabulatedThermo class to implement stoichiometry dependent partial molar volumes.
Since we coupled Cantera to an in-house code for battery simulation, I started implementing the changes within the latest working setup, which used Cantera 2.4. There everything works fine. Before starting a pull request, I wanted to test the extensions with the most recent version of the main branch of Cantera, but after checking out the main branch I get compilation NameErrors:
NameError: name 'Dict' is not defined:
File "D:\HSO\Codes\DENIS\IDE_MCDENIS_64\workspace\Cantera\SConstruct", line 1721:
SConscript('build/src/fortran/SConscript')
File "d:\hso\codes\denis\ide_mcdenis_64\python395\lib\site-packages\SCons\Script\SConscript.py", line 654:
return method(*args, **kw)
File "d:\hso\codes\denis\ide_mcdenis_64\python395\lib\site-packages\SCons\Script\SConscript.py", line 591:
return _SConscript(self.fs, *files, **subst_kw)
File "d:\hso\codes\denis\ide_mcdenis_64\python395\lib\site-packages\SCons\Script\SConscript.py", line 280:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "D:\HSO\Codes\DENIS\IDE_MCDENIS_64\workspace\Cantera\build\src\fortran\SConscript", line 38:
SPAWN=get_spawn(localenv),
File "D:\HSO\Codes\DENIS\IDE_MCDENIS_64\workspace\Cantera\site_scons\buildutils.py", line 841:
def our_spawn(sh: str, escape: str, cmd: str, args: str, environ: Dict[str, str]):
My first guess was, that is has something to do with the type annotations in the function definition of our_spawn. As it seems to be a forward reference, I put the Dict[str, str] in quotes "Dict[str, str]", resulting in a different NameError during compilation:
scons: *** [interfaces\python_minimal\dummy] NameError : name 'normpath' is not defined
Traceback (most recent call last):
File "d:\hso\codes\denis\ide_mcdenis_64\python395\lib\site-packages\SCons\Action.py", line 1280, in execute
result = self.execfunction(target=target, source=rsources, env=env)
File "D:\HSO\Codes\DENIS\IDE_MCDENIS_64\workspace\Cantera\interfaces\python_minimal\SConscript", line 63, in find_module_dir
global_env['python_module_loc'] = normpath(filename)
NameError: name 'normpath' is not defined
Since forward referencing in type annotations has become possible without using quotes in Python 3.7 I also tried upgrading the Python version used in our Eclipse IDE from 3.6.8 to 3.9.5 but that still could not resolve the NameErrors.
I tried to track down where the compilation problems started and it seems that the changes made in commit edf5e4cc cause the problems. At least I can compile all versions of Cantera before that commit without NameErrors. Compiling edf5e4cc results in:
NameError: name 'quoted' is not defined:
File "D:\HSO\Codes\DENIS\IDE_MCDENIS_64\workspace\Cantera\SConstruct", line 1211:
env['python_cmd_esc'] = quoted(env['python_cmd'])
I'm using scons and Mingw64 for the build process.
Any help on this will be much appreciated.
Best regards,
David