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

Uninformative error when using gecode from Windows cmd #206

Open
arekpaterak opened this issue Nov 3, 2024 · 5 comments
Open

Uninformative error when using gecode from Windows cmd #206

arekpaterak opened this issue Nov 3, 2024 · 5 comments

Comments

@arekpaterak
Copy link

arekpaterak commented Nov 3, 2024

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.

@cyderize
Copy link
Member

cyderize commented Nov 3, 2024

I wonder if this is the same issue that's causing MiniZinc/minizinc-python#174

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

@arekpaterak
Copy link
Author

arekpaterak commented Nov 4, 2024

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.

@cyderize
Copy link
Member

cyderize commented Nov 4, 2024

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
Copy link
Member

cyderize commented Nov 5, 2024

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

@arekpaterak
Copy link
Author

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

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