Problem with 'scons build' when compiling Cantera

218 views
Skip to first unread message

Saana Hautala

unread,
Aug 27, 2021, 8:06:29 AM8/27/21
to Cantera Users' Group
Hello,

I'm trying to install and compile Cantera (2.4) and I'm planning to use it with Visual Studio 2017.
I've followed the steps of the instructions in:
https://gist.github.com/ischoegl/ab777f871a48d7f40ecc32c1c849faa3
(I've installed python version 3.7.9 and numpy version 1.17.4 to my cantera-dev environment.)

However when I try to use 'scons build', I get the following error:
"ValueError: invalid version number '4.1.0.post1'" which is apparently refering to the scons version? Attached is a screenshot of the full error message.

If you have any advice what I could do to overcome this problem, I would really appreciate it.


Best regards,
Saana Hautala 
scons.JPG

Bryan Weber

unread,
Aug 27, 2021, 8:07:51 AM8/27/21
to Cantera Users' Group
Hi Saana,

Is there a specific reason you want to use Cantera 2.4? This problem has been fixed in the current Cantera release, 2.5.1.

Thanks!
Bryan

Saana Hautala

unread,
Aug 30, 2021, 6:46:40 AM8/30/21
to Cantera Users' Group
Hello Bryan,

I have a model that I need to run, and Cantera 2.4. has been used when building that model. Therefore, I want to use the 2.4 version.
So would there be any other way to solve this issue?

Best regards,
Saana

Bryan Weber

unread,
Aug 30, 2021, 9:49:13 AM8/30/21
to Cantera Users' Group
You can install an older version of SCons. Anything higher than 3.0 should work. However, Cantera 2.4 is no longer supported, and I'd suggest you'd be better off updating your model to Cantera 2.5.1.

Best,
Bryan

Saana Hautala

unread,
Aug 31, 2021, 6:51:37 AM8/31/21
to Cantera Users' Group
Thank you for the advice.
I've tried now both: 1) installing an older version of SCons with Cantera 2.4 and 2) the original version of SCons (4.1.0.post1) with Cantera 2.5.
The error from the scons version did not appear anymore. However, I got a new error when I tried to execute the 'scons build' command:
"ERROR: Boost could not be found. Install Boost headers or set 'boost_inc_dir' to point to the boost headers." Attached is a picture of the full error message.
I think the path for "boost_inc_dir" is correct. At least the 'boost' folder is located there ("boost_inc_dir = 'C:/Users/shautala/Anaconda3/envs/cantera-dev/Library/include'").
I attached the  'config.log' file if it gives some more information about the situation.

Best regards,
Saana
scons_boost.JPG
config.log

Bryan Weber

unread,
Aug 31, 2021, 1:39:31 PM8/31/21
to Cantera Users' Group
Hi,

That is the correct directory, but you need to set that option on the command line:

scons build boost_inc_dir=C:/......

Best,
Bryan

Message has been deleted
Message has been deleted

Saana Hautala

unread,
Sep 1, 2021, 5:55:37 AM9/1/21
to Cantera Users' Group
Hi,

Allright! Apparently, I had not understood the instrustions correctly.
Just to make sure, I need to create a cantera.conf file and save it in the 'cantera' folder?
After that, I put scons build boost_inc_dir=C:/...... in the command line and execute it. (Tried this and "Compilation completed successfully".)

How about 'scons test' and 'scons install', should I include something to those commands also?
And the other lines in the cantera.conf file, should those be also put to command line (prefix, matlab_toolbox, matlab_path)?


Br.,
Saana

Alex Elias

unread,
Sep 1, 2021, 10:49:37 AM9/1/21
to Cantera Users' Group
Hi Saana

SCons saves configuration options (boost, python, sundials, etc.) specified on the command line in the file cantera.conf, so you don't need to create it. The same is true for the other files, they are generated by SCons.

The other options have default configurations. So, you don't need to specify them in the command line. Just run 'scons build' with the options you need and after compilation run 'scons install'.

Best, 
Alex

Saana Hautala

unread,
Sep 2, 2021, 8:59:26 AM9/2/21
to Cantera Users' Group
Hello,

It seems that I have now been able to complete Canter installation successfully.
Thank you for helping me with this problem!

Br., Saana

Saana Hautala

unread,
Sep 20, 2021, 5:06:10 AM9/20/21
to Cantera Users' Group
Hello,

After I've  installed Cantera, I've faced some other problems when building in Visual Studio.
The error code I have got is "LNK2001" and I've already recieved help and suggestion ( https://groups.google.com/g/cantera-users/c/tQOdlhGYu1Q/m/MOWrvuhSBQAJ ) that it might be something to do with different Visual Studio versions being installed (https://github.com/microsoft/vcpkg/issues/15999 ).

However, I'm now a bit stuck since I do not know how I could fix this "mixing" of Visual Studio versions.
I started to think is it possible that the two Visual Studio versions (2017 and 2019) got mixed up during the cantera installation?

If you have any suggestions what I could try to do to fix this, I would really appreciate it.


Best regards,
Saana Hautala
Reply all
Reply to author
Forward
0 new messages