-
Notifications
You must be signed in to change notification settings - Fork 18
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
Fails go test_glpk suite! #6
Comments
Please try adding
to The problem (if the answer is yes) is that some recent versions of glpk use (by default) thread local memory for faster allocation and dealocation of memory but this does not play nice with Go which may run the same goroutine on different threads which leads to similar deallocation problems as described above. There are four possible solutions:
|
After adding the init func and importing "runtime", go test gave the same error ;-(.
And many thanks for your plugin. I need it for my job. I will ASAP detail how I got to compile everything and build the glpk module on my Windows PC. |
I suffered from the same issue and tried the suggestion with The working solution was to add the following code before runtime.LockOSThread()
defer runtime.UnlockOSThread()
lp := glpk.New()
defer lp.Delete()
// ... I created repo with the working example: https://github.com/nskondratev/go-glpk-bench-example. |
I have succeeded in installing and building your go-glpk package, linking to libglpk.a
This static library is recompiled afresh using gcc and recent glpk version 4-64, and the check was successful: "OPTIMAL LP SOLUTION FOUND" on examples\plan.mps and examples\murtagh.mps and
Unfortunately, the (very thorough) test_glpk didn't succeed:
$ go test
glp_free: ptr = 0000000000982D10; invalid pointer
Error detected in file ..\src\env\alloc.c at line 59
exit status 3
FAIL github.com/lukpank/go-glpk/glpk 13.750s
I probably have to ask glpk specialists...
The text was updated successfully, but these errors were encountered: