compile and use Cantera with Visual Studio 2019

278 views
Skip to first unread message

litian SU

unread,
Dec 6, 2021, 10:02:36 PM12/6/21
to Cantera Users' Group
微信截图_20211207093529.png
Hi,

I'm trying to install and compile and use Cantera with Visual Studio 2019.
I've followed the steps of the instructions in:
https://gist.github.com/ischoegl/ab777f871a48d7f40ecc32c1c849faa3
However when I try to use 'scons build', I get the following error:
In file included from ext\googletest\googletest\src\gtest-all.cc:41:0:
ext\googletest\googletest/src/gtest.cc:86:32: fatal error: crtdbg.h: No such file or directory
 # include <crtdbg.h>  // NOLINT
                                ^
compilation terminated.
scons: *** [build\ext\googletest\googletest\src\gtest-all.o] Error 1
scons: building terminated because of errors.

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


Best regards,
lt SU

Ray Speth

unread,
Dec 10, 2021, 5:12:01 PM12/10/21
to Cantera Users' Group
Hi,

It looks like SCons is trying to compile using the MinGW compiler rather than VS2019. To compile using Visual Studio, you generally need to run SCons from a "Visual Studio Command Prompt" (there may be different command prompt options; I'm not sure exactly which one you want), and then activate your Anaconda environment. The other possibility is to specify "msvc_version=14.2" as an additional option when running "scons build....". This may or may not work depending on whether SCons can then find your Visual Studio installation.

Regards,
Ray

litian SU

unread,
Dec 12, 2021, 9:23:40 PM12/12/21
to Cantera Users' Group
Hi ray,

Thank you very much for your reply! I added toolchain = 'msvc' in cantera.config. It can be successfully build and install now. 微信截图_20211213100842.png
微信截图_20211213101316.png
微信截图_20211213102138.png
Reply all
Reply to author
Forward
0 new messages