ds4dm / ecole

Extensible Combinatorial Optimization Learning Environments
https://www.ecole.ai
BSD 3-Clause "New" or "Revised" License
313 stars 69 forks source link

installation error #329

Open LeonaireHo opened 2 years ago

LeonaireHo commented 2 years ago

I am trying to install ecole with conda, but it keep trying to build the environment and then fail.

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

someone know why this error and how to to solve. Thanks in advance

LeonaireHo commented 2 years ago

And another problem when i try to install with setup.py

-- Build files have been written to: /home/leonaire/ecole-master/_skbuild/linux-x86_64-3.9/cmake-build
[33/47] Building CXX object libecole/C...e-lib.dir/src/dynamics/branching.cpp.o
FAILED: libecole/CMakeFiles/ecole-lib.dir/src/dynamics/branching.cpp.o 
/usr/bin/c++ -DFMT_LOCALE -DXTENSOR_USE_XSIMD -Decole_lib_EXPORTS -I/home/leonaire/ecole-master/libecole/include -I/home/leonaire/ecole-master/_skbuild/linux-x86_64-3.9/cmake-build/libecole/include -I/home/leonaire/ecole-master/libecole/src -isystem /home/leonaire/scip/include -isystem /home/leonaire/ecole-master/_skbuild/linux-x86_64-3.9/cmake-build/_deps/local/include -O3 -DNDEBUG -flto -fno-fat-lto-objects -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual -Wpedantic -Wconversion -Wsign-conversion -Wnull-dereference -Wdouble-promotion -Wformat=2 -Wunreachable-code -Wuninitialized -MD -MT libecole/CMakeFiles/ecole-lib.dir/src/dynamics/branching.cpp.o -MF libecole/CMakeFiles/ecole-lib.dir/src/dynamics/branching.cpp.o.d -o libecole/CMakeFiles/ecole-lib.dir/src/dynamics/branching.cpp.o -c /home/leonaire/ecole-master/libecole/src/dynamics/branching.cpp
In file included from /home/leonaire/ecole-master/libecole/src/dynamics/branching.cpp:7:
/home/leonaire/ecole-master/libecole/include/ecole/dynamics/branching.hpp:16:32: error: ‘optional’ in namespace ‘std’ does not name a template type
   16 |         using ActionSet = std::optional<xt::xtensor<std::size_t, 1>>;
      |                                ^~~~~~~~
/home/leonaire/ecole-master/libecole/include/ecole/dynamics/branching.hpp:9:1: note: ‘std::optional’ is defined in header ‘<optional>’; did you forget to ‘#include <optional>’?
    8 | #include "ecole/dynamics/parts.hpp"
  +++ |+#include <optional>
    9 | #include "ecole/export.hpp"
/home/leonaire/ecole-master/libecole/include/ecole/dynamics/branching.hpp:22:88: error: ‘ActionSet’ was not declared in this scope; did you mean ‘Action’?
   22 |         ECOLE_EXPORT auto reset_dynamics(scip::Model& model) const -> std::tuple<bool, ActionSet>;
      |                                                                                        ^~~~~~~~~
      |                                                                                        Action
/home/leonaire/ecole-master/libecole/include/ecole/dynamics/branching.hpp:22:97: error: template argument 2 is invalid
   22 |         ECOLE_EXPORT auto reset_dynamics(scip::Model& model) const -> std::tuple<bool, ActionSet>;
      |                                                                                                 ^
/home/leonaire/ecole-master/libecole/include/ecole/dynamics/branching.hpp:24:109: error: ‘ActionSet’ was not declared in this scope; did you mean ‘Action’?
   24 |         ECOLE_EXPORT auto step_dynamics(scip::Model& model, Action maybe_var_idx) const -> std::tuple<bool, ActionSet>;
      |                                                                                                             ^~~~~~~~~
      |                                                                                                             Action
/home/leonaire/ecole-master/libecole/include/ecole/dynamics/branching.hpp:24:118: error: template argument 2 is invalid
   24 |         ECOLE_EXPORT auto step_dynamics(scip::Model& model, Action maybe_var_idx) const -> std::tuple<bool, ActionSet>;
      |                                                                                                                      ^
/home/leonaire/ecole-master/libecole/src/dynamics/branching.cpp:33:48: error: ‘ActionSet’ is not a member of ‘ecole::dynamics::BranchingDynamics’
   33 |         -> std::tuple<bool, BranchingDynamics::ActionSet> {
      |                                                ^~~~~~~~~
/home/leonaire/ecole-master/libecole/src/dynamics/branching.cpp:33:57: error: template argument 2 is invalid
   33 |         -> std::tuple<bool, BranchingDynamics::ActionSet> {
      |                                                         ^
/home/leonaire/ecole-master/libecole/src/dynamics/branching.cpp:51:86: error: ‘ActionSet’ was not declared in this scope; did you mean ‘Action’?
   51 | auto BranchingDynamics::reset_dynamics(scip::Model& model) const -> std::tuple<bool, ActionSet> {
      |                                                                                      ^~~~~~~~~
      |                                                                                      Action
/home/leonaire/ecole-master/libecole/src/dynamics/branching.cpp:51:95: error: template argument 2 is invalid
   51 | auto BranchingDynamics::reset_dynamics(scip::Model& model) const -> std::tuple<bool, ActionSet> {
      |                                                                                               ^
/home/leonaire/ecole-master/libecole/src/dynamics/branching.cpp:57:29: error: ‘ActionSet’ was not declared in this scope; did you mean ‘Action’?
   57 |         -> std::tuple<bool, ActionSet> {
      |                             ^~~~~~~~~
      |                             Action
/home/leonaire/ecole-master/libecole/src/dynamics/branching.cpp:57:38: error: template argument 2 is invalid
   57 |         -> std::tuple<bool, ActionSet> {
      |                                      ^
/home/leonaire/ecole-master/libecole/src/dynamics/branching.cpp:17:6: warning: ‘std::optional<xt::xtensor_container<xt::uvector<long unsigned int, xsimd::aligned_allocator<long unsigned int, 16> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag> > ecole::dynamics::{anonymous}::action_set(const ecole::scip::Model&, bool)’ defined but not used [-Wunused-function]
   17 | auto action_set(scip::Model const& model, bool pseudo) -> std::optional<xt::xtensor<std::size_t, 1>> {
      |      ^~~~~~~~~~
[35/47] Building CXX object python/eco...e-py-ext.dir/src/ecole/core/core.cpp.o
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "/home/leonaire/anaconda3/lib/python3.9/site-packages/skbuild/setuptools_wrap.py", line 645, in setup
    cmkr.make(make_args, install_target=cmake_install_target, env=env)
  File "/home/leonaire/anaconda3/lib/python3.9/site-packages/skbuild/cmaker.py", line 660, in make
    self.make_impl(clargs=clargs, config=config, source_dir=source_dir, install_target=install_target, env=env)
  File "/home/leonaire/anaconda3/lib/python3.9/site-packages/skbuild/cmaker.py", line 684, in make_impl
    raise SKBuildError(
AntoinePrv commented 2 years ago

Hi @LeonaireHo ,

For the conda problem, could you try with:

conda install mamba -n base -c conda-forge
mamba install -c conda-forge ecole

For the second problem, that could point to a leaking include. But I won't know for sure without being able to reproduce on your system. Anyways, I've released a bug fix in #332.

LeonaireHo commented 2 years ago

@AntoinePrv ,thanks you. I have successfully installed with /dev/run.sh. Actually,I want to use Ecole to get the features of lp problem, and use them to predict solution using supervised learning. So I want to extract the features of the original problem, but it looks like scip changes the constraints of the problem during extraction, i try to turn off the presolving of scip, but it didn't work. Do you have any suggestions? Thanks a lot

LeonaireHo commented 2 years ago

I have solved this problem of increasing the number of variables by setting the separating and resolving parameters of scip.