Page 1 of 2

CMake error when running example_kinetics

Posted: Tue Jan 02, 2024 11:39 am
by camillefray
Good afternoon,

I am trying to run the example_kinetics file on Windows, but I have the following CMake error that I don't understand how to solve. I followed the instructions of the README file on github. Could you help me resolve the problem please?

Thank you for your help!

Best,

Camille

Re: CMake error when running example_kinetics

Posted: Tue Jan 02, 2024 10:24 pm
by antoinefalisse
Hi,

Did you install Visal Studio? Looks like your default generator is different from what the code expects.

Best,
Antoine

Re: CMake error when running example_kinetics

Posted: Wed Jan 03, 2024 6:19 am
by camillefray
No, I'm not running the code through visual studio. I installed Anaconda, and I'm running the code through the Anaconda command prompt.

Re: CMake error when running example_kinetics

Posted: Wed Jan 03, 2024 9:24 am
by camillefray
Actually I just downloaded visual studio 2022 community version.
But, I still have the same error.
After downloading VS, should I run the code through the anaconda prompt or through VS?

Re: CMake error when running example_kinetics

Posted: Wed Jan 03, 2024 9:46 am
by antoinefalisse
Hi, Through the anaconda prompt. Did you install the C++ extension when installing visual studio 2022 community?

Re: CMake error when running example_kinetics

Posted: Wed Jan 03, 2024 9:51 am
by camillefray
Okay. So even after installing Anaconda with the C++ extension, I still ran through the same exact error than above!

Re: CMake error when running example_kinetics

Posted: Wed Jan 03, 2024 12:14 pm
by suhlrich
Anaconda or Visual Studio with C++?

Re: CMake error when running example_kinetics

Posted: Wed Jan 03, 2024 1:48 pm
by camillefray
Sorry. Even after having installed VS with the C++ extension, and running the example_kinetics.py through the Anaconda prompt, I still have the same error.

Re: CMake error when running example_kinetics

Posted: Fri Jan 05, 2024 1:51 pm
by camillefray
Do I have to make any change to this CMakeLists.txt file?

Re: CMake error when running example_kinetics

Posted: Fri Jan 05, 2024 2:05 pm
by antoinefalisse
I think what is going on is that the wrong generator is being used.

ChatGPT:
NMake Makefiles is one of the generators that can be used with CMake. When you run CMake, you can specify a generator, which is essentially a set of instructions used by CMake to create files for a specific build system. The generator determines how the build process is managed. If you're working on Windows and specifically with Visual Studio, you would typically use a Visual Studio generator rather than NMake, because Visual Studio has its own build system integrated into the IDE.

What we can do is specify the generator directly in the cmake command:
You can add -G "Visual Studio 17 2022" in the commands here https://github.com/stanfordnmbl/opencap ... D.py#L1706 and here https://github.com/stanfordnmbl/opencap ... D.py#L1799 This should force using Visual Studio

Keep us posted,
Antoine