-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could someone kindly explain to me how to use the examples in the “tests”? Thank you. #173
Comments
The files in Standalone examples that can be built independently from osqp-eigen can be found in https://github.com/robotology/osqp-eigen/tree/master/example . |
I appreciate your prompt response. |
In general, you can compile the project and the tests with this commands on Linux and macOS:
However, you need to make sure that you have all the required depencies (like osqp, eigen and catch2). So to provide an helpful answer, we need to know:
|
Your assistance has been so prompt that I can hardly express my gratitude. I'm very sorry that I may not be able to respond as quickly as you reply to me. We might be in different time zones,.It’s already quite late here, and I don't want to disturb my roommate as our dorm room is quite small. So I apologize that I might not be able to respond to your help until tomorrow. What follows might raise your blood pressure, as I am truly a beginner without much understanding. However, by chance, I now find myself needing to work with OSQP-related content. I'm working in a Windows environment and trying to run this project. My package manager is vcpkg, but it seems that the vcpkg library only contains Catch2 and Eigen3, without support for osqp and osqp-eigen. As a result, I downloaded osqp and osqp-eigen directly using git clone. To run the MPCExample in osqp-eigen, I configured it in Visual Studio 2022 by going to Project > Properties > VC++ Directories > Library Directories and Include Directories, where I included the paths for the osqp and osqp-eigen repositories I cloned. I then added the .lib files to Linker > Input > Additional Dependencies. Now, I want to run the tests in the tests folder, but I'm running into issues where vcpkg can't find the manually downloaded osqp and osqp-eigen libraries, even after adding set and find_package statements to the CMakeLists.txt in osqp-eigen. Since I'm quite new to this, I might be getting things tangled up due to my lack of experience. I want to thank you once again for your selfless assistance. |
No need to worry, really. If you are working with vcpkg, the following commands should be sufficient to run the tests with vcpkg provided dependencies. First of all, open your "x64 Native Tools command prompt for VS2022" (or VS2019 if using an earlier version). First of all, create a clean directory called osqpeigenws in your home:
In there, clone vcpkg and install there catch2 and eigen:
If the installation was successful, go back in
At this point, you can run the tests with the
If everything works correctly, you should see the tests running with output:
On a related note, apparently somebody is working on packaging osqp and osqp-eigen on vcpkg, see: microsoft/vcpkg#39629 and microsoft/vcpkg#41676. However, this is not ready at the moment. |
I’m incredibly grateful for your help! Thanks to your guidance, I was finally able to run the tests successfully. For anyone else who may encounter similar issues, I’ll share some of the challenges I faced and my solutions while following the advice. There may even be better approaches, but here’s what worked for me:
After addressing these issues, everything worked as expected. Once again, thank you for your help! |
@moonBuff I happy you solved your problem. If everything is resolved, feel free to close the issue, thanks! |
Thank you so much for your help! The issue is resolved now, and I really appreciate your assistance. I will go ahead and close the issue. Thanks again |
When I try to use the test cases in the tests folder, I get the error: Unknown CMake command "add_osqpeigen_test". I think I might have done something wrong. Could someone please help me figure it out? Thank you!
The text was updated successfully, but these errors were encountered: