marekpiotrow/UWrMaxSat

Latest code does not compile with MSYS2

Closed this issue · 2 comments

Hi,

I tried to compile this under Windows with Msys2:

    export PATH=$PATH:/ucrt64/bin && \
    make config && \
    make r

Results with the following output:

Compiling: build/release/Main.o
Compiling: build/release/Debug.o
Compiling: build/release/Hardware_adders.o
Compiling: build/release/Hardware_clausify.o
Compiling: build/release/Hardware_reuse_sorters.o
Compiling: build/release/Hardware_sorters.o
Compiling: build/release/ipamir.o
Compiling: build/release/Main_utils.o
Compiling: build/release/MsSolver.o
MsSolver.cc: In member function 'void MsSolver::maxsat_solve(PbSolver::solve_Command)':
MsSolver.cc:642:50: warning: left shift count >= width of type [-Wshift-count-overflow]
  642 |     if (opt_use_scip_slvr && UB_goalval < Int(2L << std::numeric_limits<double>::digits) && l_True ==
      |                                               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MsSolver.cc:642:88: error: call of overloaded 'Int(long int)' is ambiguous
  642 |     if (opt_use_scip_slvr && UB_goalval < Int(2L << std::numeric_limits<double>::digits) && l_True ==
      |                                                                                        ^
In file included from ./Main.h:27,
                 from <command-line>:
ADTs/Int.h:169:5: note: candidate: 'Int::Int(Int&&)'
  169 |     Int(Int&& src) {
      |     ^~~
ADTs/Int.h:161:5: note: candidate: 'Int::Int(const Int&)'
  161 |     Int(const Int& src) {
      |     ^~~
ADTs/Int.h:156:14: note: candidate: 'Int::Int(uint64_t)'
  156 |     explicit Int(uint64_t x) {
      |              ^~~
ADTs/Int.h:151:5: note: candidate: 'Int::Int(int64_t)'
  151 |     Int(int64_t x) {
      |     ^~~
ADTs/Int.h:146:14: note: candidate: 'Int::Int(int)'
  146 |     explicit Int(int x) {
      |              ^~~
make: *** [Makefile:141: build/release/MsSolver.o] Error 1
The command 'C:/msys64/usr/bin/bash.exe -l -c 'cd /build/uwrmaxsat &&     export PATH=$PATH:/ucrt64/bin &&     make config &&     make r'' returned a non-zero code: 2

I've succesfully compiled this with Windows and Msys2 last year, so I suspect this change has something to do with the issue I encounter above: 89f2d65#diff-afa1ee0865f6cdb1586d247104736cf0f253f88ce0edcc4bd634e304f251e408R619

Thanks!

Hi,

I have fixed the problem and pushed a commit. You can also look at the file config.msys2ucrt64, which I used as config.mk to build uwrmaxsat in MSYS2/UCRT64 environment. I was not able to compile ScipOptSuite in it, so I downloaded the precompiled package and installed it in d:\ScipOptSuite-9.0.0. This path is included in config.msys2ucrt64.

Marek

Hi,

finally, I have managed to build the working SCIP libraries from MSYS2/UCRT64 shell using the compiler from Visual Studio 2022. To this end I have to modify the procedure described in README.md in the following way:

  • skip the line that modifies the file scip/src/CMakeList.txt with the sed editor (libraries have to be be dynamic);
  • add the option -G"Visual Studio 17 2022" to the line beginning with cmake;
  • replace the line 'make libscip' with 'cmake --build . --config Release'
  • add the path to scipoptsuite-8.1.0/build/bin/Release to the user or system variable PATH;
  • before making uwrmaxsat modify config.mk by adding '/Release' after '-L../scipoptsuite-8.1.8/build/lib'

Marek