Thanks a lot for open sourcing this library @cvanaret !
I initially tried to compile it on Ubuntu 22.04, and I failed.
First of all, I installed AMPL/ASL and HSL/MA57 . I tried to install BQPD, but I could not find where to download it (I need to drop a mail as described in https://www.mcs.anl.gov/~leyffer/solvers.html or there is a more direct option?)
Configuration problems
Then, I tried to configure the project, and it was failing with error:
CMake Error at CMakeLists.txt:120 (message):
Required library gomp was not found. Use ccmake to configure its path.
this was fixed by passing the gomp
location to cmake:
cmake -Dgomp=/usr/lib/x86_64-linux-gnu/libgomp.so.1 ..
Also for amplsolver
and ma57
I specified the location manually.
Compilation Problems
After that, the configuration was successful and I could start the compilation.
Infinity.hpp
error
The first compilation that I got is:
[ 21%] Building CXX object CMakeFiles/uno.dir/uno/ingredients/globalization_strategy/Filter.cpp.o
In file included from /home/straversaro/unoaptws/clean/uno/uno/ingredients/globalization_strategy/Filter.hpp:10,
from /home/straversaro/unoaptws/clean/uno/uno/ingredients/globalization_strategy/Filter.cpp:
:
/home/straversaro/unoaptws/clean/uno/uno/tools/Infinity.hpp:7:25: error: ‘numeric_limits’ is not a member of
std’
7 | const double INF = std::numeric_limits<double>::infinity();
| ^~~~~~~~~~~~~~
/home/straversaro/unoaptws/clean/uno/uno/tools/Infinity.hpp:7:40: error: expected primary-expression before ‘double’
7 | const double INF = std::numeric_limits<double>::infinity();
| ^~~~~~
make[2]: *** [CMakeFiles/uno.dir/build.make:188: CMakeFiles/uno.dir/uno/ingredients/globalization_strategy/Filter.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/uno.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
that was fixed by modifying the uno/uno/tools/Infinity.hpp
as in:
diff --git a/uno/tools/Infinity.hpp b/uno/tools/Infinity.hpp
index 1ada183..8ae84da 100644
--- a/uno/tools/Infinity.hpp
+++ b/uno/tools/Infinity.hpp
@@ -4,6 +4,9 @@
#ifndef UNO_INFINITY_H
#define UNO_INFINITY_H
+#include <cmath>
+#include <limits>
+
const double INF = std::numeric_limits<double>::infinity();
inline bool is_finite(double value) {
Direction.hpp
Compilation Error
After that, I had:
[ 31%] Building CXX object CMakeFiles/uno.dir/uno/ingredients/subproblem/Direction.cpp.o
In file included from /home/straversaro/unoaptws/clean/uno/uno/ingredients/subproblem/Direction.cpp:4:
/home/straversaro/unoaptws/clean/uno/uno/ingredients/subproblem/Direction.hpp:57:16: error: ‘ostream’ in namespace ‘std’ does not name a type
57 | friend std::ostream& operator<<(std::ostream& stream, const Direction& step);
| ^~~~~~~
In file included from /home/straversaro/unoaptws/clean/uno/uno/ingredients/subproblem/Direction.cpp:4:
/home/straversaro/unoaptws/clean/uno/uno/ingredients/subproblem/Direction.hpp:11:1: note: ‘std::ostream’ is defined in header ‘<ostream>’; did you forget to ‘#include <ostream>’?
10 | #include "tools/Infinity.hpp"
+++ |+#include <ostream>
11 |
that was fixed by:
diff --git a/uno/ingredients/subproblem/Direction.hpp b/uno/ingredients/subproblem/Direction.hpp
index 337e7ce..5c66cb3 100644
--- a/uno/ingredients/subproblem/Direction.hpp
+++ b/uno/ingredients/subproblem/Direction.hpp
@@ -8,6 +8,7 @@
#include <optional>
#include "optimization/Multipliers.hpp"
#include "tools/Infinity.hpp"
+#include <ostream>
enum class Status {
OPTIMAL = 0,
LPSolverFactory.hpp
Compilation Problem
The final error (that I was not able to solve is on LPSolverFactory.hpp
):
[ 26%] Building CXX object CMakeFiles/uno.dir/uno/ingredients/subproblem/HessianModel.cpp.o
In file included from /home/straversaro/unoaptws/clean/uno/uno/ingredients/subproblem/LPSubproblem.cpp:5:
/home/straversaro/unoaptws/clean/uno/uno/solvers/QP/LPSolverFactory.hpp:16:27: error: ‘BQPDSolver’ was not declared in this scope; did you mean ‘LPSolver’?
16 | static std::unique_ptr<BQPDSolver> create(size_t number_variables, size_t number_constraints, const std::string& LP_solver_name,
| ^~~~~~~~~~
| LPSolver
/home/straversaro/unoaptws/clean/uno/uno/solvers/QP/LPSolverFactory.hpp:16:37: error: template argument 1 is invalid
16 | static std::unique_ptr<BQPDSolver> create(size_t number_variables, size_t number_constraints, const std::string& LP_solver_name,
| ^
/home/straversaro/unoaptws/clean/uno/uno/solvers/QP/LPSolverFactory.hpp:16:37: error: template argument 2 is invalid
In file included from /home/straversaro/unoaptws/clean/uno/uno/ingredients/subproblem/LPSubproblem.cpp:5:
/home/straversaro/unoaptws/clean/uno/uno/solvers/QP/LPSolverFactory.hpp: In static member function ‘static int LPSolverFactory::create(size_t, size_t, const string&, const Options&)’:
/home/straversaro/unoaptws/clean/uno/uno/solvers/QP/LPSolverFactory.hpp:24:4: warning: no return statement in function returning non-void [-Wreturn-type]
At a first glance, it seems like BQPD is not an optional dependency, as suggested by the README?