MiniZincIDE icon indicating copy to clipboard operation
MiniZincIDE copied to clipboard

Uninformative error when using gecode from Windows cmd

Open arekpaterak opened this issue 1 year ago • 5 comments

I've encountered a problem while trying to use gecode from Windows cmd, like in the Basic Usage example here: https://docs.minizinc.dev/en/stable/command_line.html

Only output is =====ERROR=====.

Running the same model from MiniZinc IDE with gecode works. Also running the command with other solvers works.

I've tried reinstalling the whole MiniZinc bundle but this hasn't fixed the problem.

arekpaterak avatar Nov 03 '24 14:11 arekpaterak

I wonder if this is the same issue that's causing https://github.com/MiniZinc/minizinc-python/issues/174

Could you try running that command with -v for verbose output and see if it outputs anything else?

cyderize avatar Nov 03 '24 22:11 cyderize

Sorry that I haven't mentioned that I had already tried running this with --verbose. It stops in the same place as in the linked issue, only difference is that there is also:

=====ERROR=====

I get an error when I try just open fzn-gecode.exe from File Explorer too.

arekpaterak avatar Nov 04 '24 20:11 arekpaterak

Could you try running minizinc -c --solver gecode model.mzn data.dzn which should create model.fzn and then fzn-gecode model.fzn and see what error it gives you?

And if you're using powershell, could you run echo $LastExitCode afterwards and see the exit code it ends up with?

Thanks

cyderize avatar Nov 04 '24 22:11 cyderize

Actually, after doing some thinking - I suspect what's happening is that we package a version of Gecode which requires the Qt DLLs to be available.

Running from the IDE happens to allow them to be found since they're in the same folder as the IDE application, but then when running from the command line, the OS can't find them.

As a workaround, could you try adding the MiniZinc install directory to your PATH? E.g. in PowerShell, you can temporarily change your PATH with

$env:Path = $env:ProgramFiles + '\MiniZinc;' + $env:Path

Or if you installed just for your user:

$env:Path = $env:LocalAppData + '\Programs\MiniZinc;' + $env:Path

cyderize avatar Nov 05 '24 02:11 cyderize

Thanks, adding the MiniZinc directory to PATH solved the issue.

arekpaterak avatar Nov 13 '24 20:11 arekpaterak