CMake error when running example_kinetics

New project for OpenCap, which is a new software package to estimate 3D human movement dynamics from smartphone videos. OpenCap strongly relies on OpenSim.
User avatar
Camille Frayssinhes
Posts: 13
Joined: Thu Nov 16, 2023 9:42 am

CMake error when running example_kinetics

Post by Camille Frayssinhes » Tue Jan 02, 2024 11:39 am

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
Attachments
example_kinetics_error.png
example_kinetics_error.png (247.17 KiB) Viewed 2160 times

User avatar
Antoine Falisse
Posts: 438
Joined: Wed Jan 07, 2015 2:21 am

Re: CMake error when running example_kinetics

Post by Antoine Falisse » Tue Jan 02, 2024 10:24 pm

Hi,

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

Best,
Antoine

User avatar
Camille Frayssinhes
Posts: 13
Joined: Thu Nov 16, 2023 9:42 am

Re: CMake error when running example_kinetics

Post by Camille Frayssinhes » Wed Jan 03, 2024 6:19 am

No, I'm not running the code through visual studio. I installed Anaconda, and I'm running the code through the Anaconda command prompt.

User avatar
Camille Frayssinhes
Posts: 13
Joined: Thu Nov 16, 2023 9:42 am

Re: CMake error when running example_kinetics

Post by Camille Frayssinhes » Wed Jan 03, 2024 9:24 am

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?

User avatar
Antoine Falisse
Posts: 438
Joined: Wed Jan 07, 2015 2:21 am

Re: CMake error when running example_kinetics

Post by Antoine Falisse » Wed Jan 03, 2024 9:46 am

Hi, Through the anaconda prompt. Did you install the C++ extension when installing visual studio 2022 community?

User avatar
Camille Frayssinhes
Posts: 13
Joined: Thu Nov 16, 2023 9:42 am

Re: CMake error when running example_kinetics

Post by Camille Frayssinhes » Wed Jan 03, 2024 9:51 am

Okay. So even after installing Anaconda with the C++ extension, I still ran through the same exact error than above!

User avatar
Scott Uhlrich
Posts: 124
Joined: Tue Jan 20, 2015 4:29 pm

Re: CMake error when running example_kinetics

Post by Scott Uhlrich » Wed Jan 03, 2024 12:14 pm

Anaconda or Visual Studio with C++?

User avatar
Camille Frayssinhes
Posts: 13
Joined: Thu Nov 16, 2023 9:42 am

Re: CMake error when running example_kinetics

Post by Camille Frayssinhes » Wed Jan 03, 2024 1:48 pm

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.

User avatar
Camille Frayssinhes
Posts: 13
Joined: Thu Nov 16, 2023 9:42 am

Re: CMake error when running example_kinetics

Post by Camille Frayssinhes » Fri Jan 05, 2024 1:51 pm

Do I have to make any change to this CMakeLists.txt file?
Attachments
Screenshot 2024-01-05 at 15.51.05.png
Screenshot 2024-01-05 at 15.51.05.png (323.92 KiB) Viewed 2047 times

User avatar
Antoine Falisse
Posts: 438
Joined: Wed Jan 07, 2015 2:21 am

Re: CMake error when running example_kinetics

Post by Antoine Falisse » Fri Jan 05, 2024 2:05 pm

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

POST REPLY