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

SNOPT 7.6 Compatibility #31

Closed
aykutonol opened this issue Aug 1, 2018 · 1 comment
Closed

SNOPT 7.6 Compatibility #31

aykutonol opened this issue Aug 1, 2018 · 1 comment

Comments

@aykutonol
Copy link

aykutonol commented Aug 1, 2018

First of all, thanks for this great interface.

In a previous version, I was able to use SNOPT 7.6 through snopt76_adapter. However, in the current version, snopt_adapter_76.h is referenced in snopt_adapter.h but I cannot find it. Still, I can successfully install if I comment out setUserFun(&SnoptAdapter::ObjectiveAndConstraintFct); in snopt_adapter.cc which is somehow not declared. Yet, make test fails.

Also, there is a mismatch for the SNOPT version variable between ifopt/ifopt_snopt/cmake/FindSNOPT.cmake and ifopt/ifopt_snopt/CMakeList.txt, i.e., snopt_v76 vs SNOPT_v76.

Solution The following steps solved the issue for me:

  • Correcting the variable name problem
  • Adding this->initialize("print_file.out",1); (namely, initializing SNOPT) and removing setUserFun(&SnoptAdapter::ObjectiveAndConstraintFct);

I hope that helps and thanks again for sharing your work.

@stevenjj
Copy link

Just want to say thanks @aykutonol. For others who are having issues with the snopt v7.6 interface, this was the specific change:

in ifopt_snopt/src/snopt_adapter.cc change

setUserFun(&SnoptAdapter::ObjectiveAndConstraintFct);

to

  // setUserFun(&SnoptAdapter::ObjectiveAndConstraintFct);
  this->initialize("print_file.out",1);

snopt needs to be initialized in a different way due to the interface change.

I also had to resolve the SNOPT cmake version variable. The quickest fix was to change the following line in ifopt_snopt/cmake/FindSNOPT.cmake from

set(snopt_v76 FALSE) # set true if snopt version >= v7.6

to

set(SNOPT_v76 TRUE) # set true if snopt version >= v7.6

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

2 participants