Skip to content

Commit d8a0946

Browse files
authored
Merge pull request #2616 from NightBaRron1412/master
Clarify HiPO option feedback when the solver is unavailable
2 parents 6dee00e + 8d49f4e commit d8a0946

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

app/HighsRuntimeOptions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ void setupCommandLineOptions(CLI::App& app,
103103
"Set solver option to:\n"
104104
"\"choose\" * default\n"
105105
"\"simplex\"\n"
106+
#ifdef HIPO
106107
"\"hipo\"\n"
108+
#endif
107109
"\"ipm\"");
108110

109111
app.add_option("--" + kParallelString, cmd_options.cmd_parallel,

highs/lp_data/HighsOptions.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,17 @@ bool optionOffOnOk(const HighsLogOptions& report_log_options,
8282

8383
bool optionSolverOk(const HighsLogOptions& report_log_options,
8484
const string& value) {
85+
#ifndef HIPO
86+
if (value == kHipoString) {
87+
highsLogUser(
88+
report_log_options, HighsLogType::kError,
89+
"The HiPO solver was requested via the \"%s\" option, but this build "
90+
"was compiled without HiPO support. Reconfigure with FAST_BUILD=ON "
91+
"and -DHIPO=ON to enable HiPO.\n",
92+
kSolverString.c_str());
93+
return false;
94+
}
95+
#endif
8596
if (value == kHighsChooseString || value == kSimplexString ||
8697
value == kIpmString ||
8798
#ifdef HIPO
@@ -106,6 +117,17 @@ bool optionSolverOk(const HighsLogOptions& report_log_options,
106117

107118
bool optionMipLpSolverOk(const HighsLogOptions& report_log_options,
108119
const string& value) {
120+
#ifndef HIPO
121+
if (value == kHipoString) {
122+
highsLogUser(
123+
report_log_options, HighsLogType::kError,
124+
"The HiPO solver was requested via the \"%s\" option, but this build "
125+
"was compiled without HiPO support. Reconfigure with FAST_BUILD=ON "
126+
"and -DHIPO=ON to enable HiPO.\n",
127+
kMipLpSolverString.c_str());
128+
return false;
129+
}
130+
#endif
109131
if (value == kHighsChooseString || value == kSimplexString ||
110132
value == kIpmString ||
111133
#ifdef HIPO
@@ -131,6 +153,17 @@ bool optionMipLpSolverOk(const HighsLogOptions& report_log_options,
131153

132154
bool optionMipIpmSolverOk(const HighsLogOptions& report_log_options,
133155
const string& value) {
156+
#ifndef HIPO
157+
if (value == kHipoString) {
158+
highsLogUser(
159+
report_log_options, HighsLogType::kError,
160+
"The HiPO solver was requested via the \"%s\" option, but this build "
161+
"was compiled without HiPO support. Reconfigure with FAST_BUILD=ON "
162+
"and -DHIPO=ON to enable HiPO.\n",
163+
kMipIpmSolverString.c_str());
164+
return false;
165+
}
166+
#endif
134167
if (value == kHighsChooseString || value == kIpmString ||
135168
#ifdef HIPO
136169
value == kHipoString ||

0 commit comments

Comments
 (0)