-
Notifications
You must be signed in to change notification settings - Fork 10
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
Feature/detect_xpress_at_runtime #707
Conversation
a-zakir
commented
Oct 18, 2023
•
edited by JasonMarechal25
Loading
edited by JasonMarechal25
- Detect Xpress at Runtime
- Release one asset for each platform
I've tried to use it. When I run a simulation (example/SmallTestFiveCandidates) with solver = xpress but xpress missing from my env I get the following output
With the warning repeated a lot of times
If I run with default solver it works as intended. However I do get:
With the last warning repeated several times I note 3 points:
|
xpress_dynamic_library->GetFunction(&XPRSinit, "XPRSinit"); | ||
xpress_dynamic_library->GetFunction(&XPRScopyprob, "XPRScopyprob"); | ||
xpress_dynamic_library->GetFunction(&XPRSwritebasis, "XPRSwritebasis"); | ||
xpress_dynamic_library->GetFunction(&XPRSreadprob, "XPRSreadprob"); | ||
xpress_dynamic_library->GetFunction(&XPRSreadbasis, "XPRSreadbasis"); | ||
xpress_dynamic_library->GetFunction(&XPRSgetrows, "XPRSgetrows"); | ||
xpress_dynamic_library->GetFunction(&XPRSgetindex, "XPRSgetindex"); | ||
xpress_dynamic_library->GetFunction(&XPRSgetnames, "XPRSgetnames"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can keep here only the XPRS functions that are actually called. See for example grep XPRS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I commented out the unnecessary functions and added others especially for xpansion. I have to do it also with defines.
this needs to be cleaned
@@ -68,5 +73,6 @@ if(COIN_OR) | |||
Coin::CoinUtils | |||
Coin::Osi | |||
Coin::Cbc | |||
${CMAKE_DL_LIBS} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend creating a library to load XPRESS, and to link it against -ldl
Also, -ldl
doesn't exist in Windows
Co-authored-by: Florian Omnès <[email protected]>
Co-authored-by: Florian Omnès <[email protected]>
#ifdef COIN_OR | ||
#include "SolverCbc.h" | ||
#include "SolverClp.h" | ||
#endif | ||
#include "LogUtils.h" | ||
#include "multisolver_interface/SolverFactory.h" | ||
std::vector<std::string> tmp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give a more meaningful name to this variable please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
SonarCloud Quality Gate failed. 2 Bugs 20.6% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |