Skip to content
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

cabal install toysolver #60

Closed
vlastikw opened this issue May 5, 2021 · 6 comments
Closed

cabal install toysolver #60

vlastikw opened this issue May 5, 2021 · 6 comments

Comments

@vlastikw
Copy link

vlastikw commented May 5, 2021

~/$ cabal install toysolver
~/$ wget https://raw.githubusercontent.com/msakai/toysolver/master/samples/lp/Sudoku.lp

~/.cabal/bin/$ ./toysolver --lp Sudoku.lp
Segmentation fault (core dumped)

basically reading lp file won't work in toysat toysolver or toyconvert

./toysolver --sat aaa.cnf works
./toysat aaa.cnf works

~/.cabal/bin/$ ls -l
lrwxrwxrwx 1 ubuntu ubuntu 114 May 5 19:46 toyconvert -> ../store/ghc-8.8.4/toysolver-0.7.0-a2dd48b3ce6143ea169cfa73d74179abe5e7eeb05444e8361f8dc9863f6bf7c0/bin/toyconvert*
lrwxrwxrwx 1 ubuntu ubuntu 110 May 5 19:46 toyqbf -> ../store/ghc-8.8.4/toysolver-0.7.0-0e1deeee83edf2aa18bd4d7bf0ba4bc82d151ea40cbf44f0f5a25fdf2be1f160/bin/toyqbf*
lrwxrwxrwx 1 ubuntu ubuntu 110 May 5 19:46 toysat -> ../store/ghc-8.8.4/toysolver-0.7.0-82239a3f18744616363cb674ac3ededa4ccfa32e6a5d40a519eaafd95156fd0c/bin/toysat*
lrwxrwxrwx 1 ubuntu ubuntu 110 May 5 19:46 toysmt -> ../store/ghc-8.8.4/toysolver-0.7.0-b4ed3ad055453675c3f24f0a301dc551aa7ff1e1e8bd5e2dc91046bc301d6a84/bin/toysmt*
lrwxrwxrwx 1 ubuntu ubuntu 113 May 5 19:46 toysolver -> ../store/ghc-8.8.4/toysolver-0.7.0-dd1e9520e775b36ced274a980f682220c66a9125c74d89e3e0ef301d9f86a5e4/bin/toysolver*

@msakai
Copy link
Owner

msakai commented May 6, 2021

Thanks for trying the software and reporting the issue.
I succeeded to reproduce the problem, and I guess there are something wrong with bytestring-encoding package.

@msakai
Copy link
Owner

msakai commented May 8, 2021

It was indeed the problem of bytestring-encoding and I uploaded the new version bytestring-encoding-0.1.1.0 to Hackage.
The problem will be fixed if you re-build toysolver using the new bytestring-encoding package.

@msakai msakai closed this as completed May 8, 2021
@vlastikw
Copy link
Author

vlastikw commented May 8, 2021

Hi,
thank you for trying to fix it. Unfortunately new installation failed.

$> cabal install toysolver
....
Completed blaze-markup-0.8.2.8
cabal: Error: some packages failed to install:
MIP-0.1.1.0-FNTpTpcIZ3SMImgMNhHV5 depends on MIP-0.1.1.0 which failed to
install.
conduit-extra-1.3.5-4mxb964k1DDKLFlW1t5aLm depends on conduit-extra-1.3.5
which failed to install.
streaming-commons-0.2.2.1-EprfzAkWKQQJ74vvqAK2aA depends on
streaming-commons-0.2.2.1 which failed to install.
toysolver-0.7.0-G2GVsGEUehyCAVblaaFR1T depends on toysolver-0.7.0 which failed
to install.
xml-conduit-1.9.1.1-EFLqj8nq9SOCy7aZs63N1n depends on xml-conduit-1.9.1.1
which failed to install.
zlib-0.6.2.3-93Wbo8gIIzI9bg4p2MsNUF failed during the configure step. The
exception was:
ExitFailure 1

I forgot to install zlib on ubuntu.

$>sudo apt install zlib1g-dev
$> cabal install toysolver
ok now

I've tested .lp works now but opb not.

./toyconvert Sudoku.lp -o Sudoku.opb
~/.cabal/bin$ ./toysolver --pb Sudoku.opb
toysolver: ParseError "endOfInput"

.toysat the same "endOfInput" error.

@msakai
Copy link
Owner

msakai commented May 8, 2021

This is caused by an empty objective function min: ; which is not allowed in the OPB file grammar.
And I filed an issue msakai/pseudo-boolean#4 .

As a workaround, please remove the min: ; line from the Sudoku.opb file.

@msakai
Copy link
Owner

msakai commented May 12, 2021

I released pseudo-boolean-0.1.10.0 which allow parsing min: ; (and other occurrences of empty <sum >expression) although it does not conform to the OPB file grammar define in http://www.cril.univ-artois.fr/PB11/format.pdf .

@vlastikw
Copy link
Author

vlastikw commented Jun 26, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants