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

Build with flag -DMINISAT=on fails on mac #7

Closed
afkcodes opened this issue Mar 6, 2022 · 6 comments
Closed

Build with flag -DMINISAT=on fails on mac #7

afkcodes opened this issue Mar 6, 2022 · 6 comments

Comments

@afkcodes
Copy link

afkcodes commented Mar 6, 2022

Hello Tom, thanks for this amazing project I am making a small side project a sudoku game where I was trying to generate some really difficult puzzles. can you help me with a config for that I tried one you shared in an issue earlier but it requires minisat to be enabled and when I am trying to build with minisat I am greeted with the following error?

I did install minisat using brew but still, the error comes up.

A small config for creating extremely hard puzzles would be a great help.

❯ ./BUILD.sh  -DMINISAT=on
-- The C compiler identification is AppleClang 13.0.0.13000029
-- The CXX compiler identification is AppleClang 13.0.0.13000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ashish/tdoku/build
[  4%] Building CXX object CMakeFiles/tdoku_object.dir/src/solver_dpll_triad_simd.cc.o
[  8%] Building CXX object CMakeFiles/tdoku_object.dir/src/util.cc.o
[  8%] Built target tdoku_object
[ 12%] Linking CXX static library libtdoku_static.a
[ 12%] Built target tdoku_static
[ 16%] Linking CXX shared library libtdoku_shared.dylib
[ 16%] Built target tdoku_shared
[ 20%] Building CXX object CMakeFiles/run_benchmark.dir/src/run_benchmark.cc.o
[ 24%] Building CXX object CMakeFiles/run_benchmark.dir/src/util.cc.o
[ 28%] Building CXX object CMakeFiles/run_benchmark.dir/src/solver_dpll_triad_simd.cc.o
[ 32%] Building CXX object CMakeFiles/run_benchmark.dir/other/other_solvers.cc.o
[ 36%] Building CXX object CMakeFiles/run_benchmark.dir/other/other_minisat.cc.o
/Users/ashish/tdoku/other/other_minisat.cc:1:10: fatal error: 'minisat/core/Solver.h' file not found
#include <minisat/core/Solver.h>
         ^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/run_benchmark.dir/other/other_minisat.cc.o] Error 1
make[1]: *** [CMakeFiles/run_benchmark.dir/all] Error 2
make: *** [all] Error 2
❯ brew install minisat
Warning: minisat 2.2.1 is already installed and up-to-date.
To reinstall 2.2.1, run:
  brew reinstall minisat

@t-dillon
Copy link
Owner

t-dillon commented Mar 6, 2022

Hi Ashish,

To build with brew-installed minisat on osx you can try adding these lines to CMakeLists.txt:

include_directories("/usr/local/include")
link_directories("/usr/local/lib")

To generate some hard puzzles you might run like this:

build/generate -c0 -g1 -d1 -e20 -n100 -p0 -s1

And if you also prefer to drive towards low-clue or high-clue puzzles you might change to -c1 or -c-1 respectively.

But bear in mind that this generator drives towards a notion of difficulty that doesn't always agree with human perceived difficulty (even if it's pretty well correlated). Consider using a separate rating tool to evaluate the generated puzzles if you want a rating that aligns with convention.

@afkcodes
Copy link
Author

afkcodes commented Mar 7, 2022

Tried adding those lines, it got built successfully now and yeah i am checking the sudoku with multiple rating tools to confirm the difficulty. you are just awesome. Thanks.

@afkcodes
Copy link
Author

All things are great thanks Tom closing this, you are just awesome.

@afkcodes
Copy link
Author

afkcodes commented Dec 2, 2023

@t-dillon came back here, just wanted to know how can i generate pretty easy puzzles so that a 10 year kid can play it easily. Any help would be a great.

@t-dillon
Copy link
Owner

t-dillon commented Dec 2, 2023

The closest thing tdoku has to puzzle rating is the guess count reported by its generator. If you tell it to look for puzzles that require few guesses by passing -g-1 it will converge on puzzles that require only easy techniques. That said, you'll get much better developed and human-aligned ratings from tools like Sudoku Explainer (http://forum.enjoysudoku.com/sudoku-explainer-t39865.html), so you may prefer to generate puzzles however you like and then filter them by evaluating with SE.

@afkcodes
Copy link
Author

afkcodes commented Dec 3, 2023

Thanks i am using Sudoku explainer already to rate but the command i was trying was giving some insane puzzles :)

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