Skip to content
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

Problems writing MPC programs using eigen,osqp,osqp-eigen in VS2015 #169

Open
DRETQ opened this issue Jul 17, 2024 · 32 comments
Open

Problems writing MPC programs using eigen,osqp,osqp-eigen in VS2015 #169

DRETQ opened this issue Jul 17, 2024 · 32 comments

Comments

@DRETQ
Copy link

DRETQ commented Jul 17, 2024

Can anyone tell me what the problem is?
捕获

@S-Dafarra
Copy link
Collaborator

Hi @DRETQ, can you describe:

  • The version of osqp-eigen and osqp you used
  • The command and the compiler you used for compiling the project?
    Thanks!

@DRETQ
Copy link
Author

DRETQ commented Jul 17, 2024

@S-Dafarra The version of osqp-eigen is 0.8.1, the version of osqp is 0.6.3,I used the debug x86 local windows debugger command and the compiler is cmake.

@S-Dafarra
Copy link
Collaborator

Given the error message, the problem seems similar to #162 (comment)

Are you 100% sure you did not accidentally used osqp master branch? Because this error is exactly what you get if you are compiling against osqp master on Windows, see #146 and osqp/osqp#576 for the actual issue tracking the problem.

Also, can you report the CMakeCache.txt of both osqp and osqp-eigen to understand if something is going wrong?

One possible attempt is to try using the master version of osqp-eigen given that #163 should have fixed the issue.

One final remark, please avoid pasting screenshots of errors, but rather copy and paste them. This would allow others to find the same solution by searching for the same error online, and would allow me to translate errors more easily.

@DRETQ
Copy link
Author

DRETQ commented Jul 17, 2024

CMakeCache(osqp).txt
CMakeCache(osqp-eigen).txt
Thanks for your reply, what is the master version of osqp-eigen? I apologize for any inconvenience caused by the use of screenshots.

@S-Dafarra
Copy link
Collaborator

S-Dafarra commented Jul 17, 2024

Could you do

cd E:/LibraryVS15/osqp-master/osqp
git log -1

and post the output?

Thanks for your reply, what is the master version of osqp-eigen?

You can do

cd E:/LibraryVS15/osqp-eigen-master
git checkout master
git pull

and then compile again

@DRETQ
Copy link
Author

DRETQ commented Jul 18, 2024

@S-Dafarra
22
23

@S-Dafarra
Copy link
Collaborator

How did you clone (download) the repo?

@DRETQ
Copy link
Author

DRETQ commented Jul 18, 2024

@S-Dafarra Do you mean how do I download osqp,osqp-eigen, I run the command from cmd to download online

@S-Dafarra
Copy link
Collaborator

I run the command from cmd to download online

Just to understand, which command?

From #169 (comment) it seems that you don't have git installed

@DRETQ
Copy link
Author

DRETQ commented Jul 18, 2024

@S-Dafarra Commands used when installing osqp is :git clone --recursive -b release-0.6.3 https://github.com/oxfordcontrol/osqp.git. Configuring eigen,osqp,osqp-eigen on vs2015 should be successful because the official example file MPCExample given is able to run successfully.

@S-Dafarra
Copy link
Collaborator

S-Dafarra commented Jul 18, 2024

Ok, then it seems you have git installed somewhere. Using the same application you used to do git clone, do also the commands I mentioned in #169 (comment)

@DRETQ
Copy link
Author

DRETQ commented Jul 18, 2024

@S-Dafarra You mean you want me to use git clone instead of git. Here are the results.
24
25

@DRETQ
Copy link
Author

DRETQ commented Jul 18, 2024

@S-Dafarra I found inconsistencies in reporting errors on vs2015 and vs2022,the osqp,eigen,osqp-eigen configured in it are the same.

@S-Dafarra
Copy link
Collaborator

@S-Dafarra You mean you want me to use git clone instead of git.

No, I meant to run the commands I posted above in a terminal where git can be used

@DRETQ
Copy link
Author

DRETQ commented Jul 18, 2024

@S-Dafarra Where can I run git if cmd doesn't work?

@S-Dafarra
Copy link
Collaborator

Apologies, I misunderstood the error message of #169 (comment)

The problem was not that git was not working. The problem was that the system did not go to the directory where you have osqp-eigen. Can you navigate to the folder where you have cloned osqp-eigen and do

git checkout master
git pull

?

@DRETQ
Copy link
Author

DRETQ commented Jul 18, 2024

Where i have cloned osqp-eigen is E:\LibraryVS15\osqp-eigen-master,isn't it? I don't know what you mean.

@S-Dafarra
Copy link
Collaborator

Where i have cloned osqp-eigen is E:\LibraryVS15\osqp-eigen-master,isn't it? I don't know what you mean.

Yes, please navigate to that folder and from within that folder execute the commands

git checkout master
git pull

@DRETQ
Copy link
Author

DRETQ commented Jul 18, 2024

@S-Dafarra Isn't that what I did before, with the same output as above?

@S-Dafarra
Copy link
Collaborator

S-Dafarra commented Jul 18, 2024

@S-Dafarra Isn't that what I did before, with the same output as above?

No, if you look at #169 (comment) you can see that it remained in the folder C:\Windows\system32. I cannot copy the message since you attached (once more) an image

@traversaro
Copy link
Member

traversaro commented Jul 18, 2024

In command prompt cd only works inside the active drive. So if the current working directory is C:\Windows\system32 if you do:

cd E:\LibraryVS15\osqp-eigen-master

the current working directory will remain in C:\Windows\system32, as the active drive remains C:.

To go to E:\LibraryVS15\osqp-eigen-master, you need to first make E: the active drive by typing E:, and then call cd E:\LibraryVS15\osqp-eigen-master, i.e. :

C:\Windows\system32>E:
E:>cd E:\LibraryVS15\osqp-eigen-master
E:\LibraryVS15\osqp-eigen-master>

See https://stackoverflow.com/questions/17753986/how-to-change-directory-using-windows-command-line or https://stackoverflow.com/questions/11065421/command-prompt-wont-change-directory-to-another-drive for more info.

@DRETQ
Copy link
Author

DRETQ commented Jul 18, 2024

@S-Dafarra What you mean is that I need to do git log -1, git checkout master, and git pull in osqp and osqp-eigen folders respectively, not in windows system32.
26
27

@DRETQ
Copy link
Author

DRETQ commented Jul 18, 2024

@traversaro Thanks for the reply, I've remembered

@S-Dafarra
Copy link
Collaborator

Where is the source code of osqp-eigen? Maybe E:/LibraryVS15/osqp-eigen-master/osqp-eigen-0.8.1?

@DRETQ
Copy link
Author

DRETQ commented Jul 19, 2024

@S-Dafarra
28

@S-Dafarra
Copy link
Collaborator

Neither E:/LibraryVS15/osqp-eigen-master/osqp-eigen-0.8.1 is a git repository. Where did you clone the repo?

@DRETQ
Copy link
Author

DRETQ commented Jul 19, 2024

@S-Dafarra When installing osqp-eigen, I didn't choose to use the git hub command directly with the osqp install, but instead downloaded the optional installer from the web.

@S-Dafarra
Copy link
Collaborator

@S-Dafarra When installing osqp-eigen, I didn't choose to use the git hub command directly with the osqp install, but instead downloaded the optional installer from the web.

Ok then use git clone to download the repo and try switching to the master branch.

@DRETQ
Copy link
Author

DRETQ commented Jul 19, 2024

@S-Dafarra This is a problem with debug x86 when debugging, it doesn't seem to be a problem if you use debug x64

@S-Dafarra
Copy link
Collaborator

@S-Dafarra This is a problem with debug x86 when debugging, it doesn't seem to be a problem if you use debug x64

Ah good catch. To be honest I don't think we test in CI x86 builds, let alone VS2015

@DRETQ
Copy link
Author

DRETQ commented Jul 20, 2024

@S-Dafarra Yes, I've asked before and no one has used it on VS2015. And have a new question, I have defined the sparse hessian matrix as a square matrix in my program, why does the output say this:
osqpeigen::data::sethessianmatrix the hessian matrix has to be a n*n size
image

@traversaro
Copy link
Member

Hello @DRETQ, please:

  • Use separate issues for each question (otherwise it is quite difficult for anyone to read issue if we mix different problems)
  • If you have a problem on a code, please report the code you are compiling and running, and the complete error, ideally in text form instead of copy&pasting images.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants